@vostride/agent-qa-dashboard-ui 0.1.18 → 0.1.20

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 (209) hide show
  1. package/dist/assets/{arrow-up-down-CwmMJuHC.js → arrow-up-down-B4k_G_pz.js} +1 -1
  2. package/dist/assets/badge-DHCU59H0.js +1 -0
  3. package/dist/assets/batch-action-bar-Dd_8W0p9.js +1 -0
  4. package/dist/assets/{circle-alert-RZI0g_tD.js → circle-alert-TPWM0719.js} +1 -1
  5. package/dist/assets/{circle-x-CcGlHxRU.js → circle-x-ITZ_DbXH.js} +1 -1
  6. package/dist/assets/config-DMv2WZOF.js +10 -0
  7. package/dist/assets/{copy-CWpai22Y.js → copy-D-NZb7QZ.js} +1 -1
  8. package/dist/assets/{cssMode-BB-fH2D6.js → cssMode-Ci86QdEV.js} +1 -1
  9. package/dist/assets/{display-step-nrAd20yH.js → display-step-CYKXUkbs.js} +1 -1
  10. package/dist/assets/dist-_gv57K8d.js +1 -0
  11. package/dist/assets/empty-state-3cB27tBp.js +1 -0
  12. package/dist/assets/{external-link-xaS9gsyo.js → external-link-DvyIDphy.js} +1 -1
  13. package/dist/assets/{eye-BmHDIr7J.js → eye-DkGk2gsF.js} +1 -1
  14. package/dist/assets/{file-code-B22xRpxi.js → file-code-DDa3GwxK.js} +1 -1
  15. package/dist/assets/{file-search-CeDGqauF.js → file-search-NMd1pdjr.js} +1 -1
  16. package/dist/assets/filename-validation-CaFIUcWo.js +1 -0
  17. package/dist/assets/{freemarker2-BZ9nT_ca.js → freemarker2-BAginoYi.js} +1 -1
  18. package/dist/assets/{grip-vertical-CJUfU7Zx.js → grip-vertical-MY-i_r9J.js} +1 -1
  19. package/dist/assets/{handlebars-CcFgORss.js → handlebars-C6jsxsLs.js} +1 -1
  20. package/dist/assets/hook-editor-Cjix8FD5.js +1 -0
  21. package/dist/assets/hook-runtime-DCkWsFrF.js +5 -0
  22. package/dist/assets/hook-viewer-Ca73H02j.js +1 -0
  23. package/dist/assets/hooks-3zdPj97l.js +1 -0
  24. package/dist/assets/{html-C5cEOw4y.js → html-Cyb0M0oP.js} +1 -1
  25. package/dist/assets/{htmlMode-B54wW7aG.js → htmlMode-DshMgI5s.js} +1 -1
  26. package/dist/assets/{id-badge-DO71VWC9.js → id-badge-CIlIhfqv.js} +2 -2
  27. package/dist/assets/index-Bu0wLCES.css +2 -0
  28. package/dist/assets/index-CWwAjH9Q.js +58 -0
  29. package/dist/assets/insights-_VG03kv7.js +1 -0
  30. package/dist/assets/{insights-line-grid-CJdb529A.js → insights-line-grid-eCcWaGgD.js} +5 -5
  31. package/dist/assets/{javascript-jZJvS0Ev.js → javascript-BsU_m_4o.js} +1 -1
  32. package/dist/assets/{jsonMode-BJu_sWuN.js → jsonMode-DUKNqYzB.js} +1 -1
  33. package/dist/assets/{lib-hhwTCYTD.js → lib-B4PNeU44.js} +1 -1
  34. package/dist/assets/{liquid-B0Wk3SRC.js → liquid-BYz2oQ7r.js} +1 -1
  35. package/dist/assets/live-run-CL1uuNh1.js +1 -0
  36. package/dist/assets/{lspLanguageFeatures-Bn8JS-MZ.js → lspLanguageFeatures-CPMJ3OMK.js} +1 -1
  37. package/dist/assets/{mdx-BE6dqG5T.js → mdx-Bfn3OASJ.js} +1 -1
  38. package/dist/assets/memory-CAPirlHn.js +1 -0
  39. package/dist/assets/memory-product-CBcChlmH.js +2 -0
  40. package/dist/assets/{monaco-editor-inner-C0PbrlIr.js → monaco-editor-inner-B2iWC3vK.js} +3 -3
  41. package/dist/assets/monaco-editor-q3UYuc-5.js +2 -0
  42. package/dist/assets/{monaco.contribution-Bq7keHQp.js → monaco.contribution-B-XUbmv5.js} +2 -2
  43. package/dist/assets/observation-block-DR8MBlgg.js +1 -0
  44. package/dist/assets/observation-markdown-BOJNfOw1.js +1 -0
  45. package/dist/assets/{pencil-Dga__f-A.js → pencil-DBjmgk_1.js} +1 -1
  46. package/dist/assets/plus-DWwmmJlz.js +1 -0
  47. package/dist/assets/popover-CuqW26_E.js +1 -0
  48. package/dist/assets/{python-DYEP_Px-.js → python-D7QiYvsM.js} +1 -1
  49. package/dist/assets/{razor-BARiZmvH.js → razor-ByxQWcvk.js} +1 -1
  50. package/dist/assets/{refresh-cw-Dhidp9m2.js → refresh-cw-BtT1wl9S.js} +1 -1
  51. package/dist/assets/resizable-C3bJVUPo.js +1 -0
  52. package/dist/assets/run-detail-Bo30AusG.js +1 -0
  53. package/dist/assets/runs-BDWggMSA.js +1 -0
  54. package/dist/assets/scroll-area-CPuygHdB.js +1 -0
  55. package/dist/assets/select-DF8sGWfv.js +1 -0
  56. package/dist/assets/shortcut-hints-CUbl8p3Z.js +1 -0
  57. package/dist/assets/split-button-BKCtgFiC.js +1 -0
  58. package/dist/assets/square-CEW9RAjr.js +1 -0
  59. package/dist/assets/step-name-pills-RalYL-ZJ.js +1 -0
  60. package/dist/assets/suite-editor-DMnWq7BC.js +5 -0
  61. package/dist/assets/suite-navbar-D9wliAeW.js +1 -0
  62. package/dist/assets/suite-viewer-D55qWO4b.js +1 -0
  63. package/dist/assets/suites-C02UROvF.js +1 -0
  64. package/dist/assets/switch-CgiZ-8Q1.js +1 -0
  65. package/dist/assets/tab-console-vamiKOKH.js +1 -0
  66. package/dist/assets/table-cLA2Rr2t.js +1 -0
  67. package/dist/assets/{tabs-C3NqUdx9.js → tabs-xxRH91gb.js} +1 -1
  68. package/dist/assets/test-editor-SQG9pODg.js +9 -0
  69. package/dist/assets/test-navbar-DGyMPxYJ.js +7 -0
  70. package/dist/assets/test-viewer-D3UUL8p1.js +1 -0
  71. package/dist/assets/tests-Dz-BuO2B.js +1 -0
  72. package/dist/assets/{tests-suites-table-widths-CPWjMEBc.js → tests-suites-table-widths-CAr7nQWt.js} +1 -1
  73. package/dist/assets/textarea-wN2tIsDn.js +1 -0
  74. package/dist/assets/{trash-2-sbLDCPlz.js → trash-2-B2a3jDA4.js} +1 -1
  75. package/dist/assets/{tsMode-BHB8FsID.js → tsMode-CPlGHPm6.js} +1 -1
  76. package/dist/assets/{typescript-BrDOgG8S.js → typescript-BAelS_Yl.js} +1 -1
  77. package/dist/assets/use-hook-run-session-RU-LfCyB.js +1 -0
  78. package/dist/assets/{use-keyboard-shortcuts-BM0qq0DE.js → use-keyboard-shortcuts-O6nfytzm.js} +1 -1
  79. package/dist/assets/use-page-title-C_f72ri7.js +1 -0
  80. package/dist/assets/use-run-status-favicon-CoVHCGAy.js +1 -0
  81. package/dist/assets/use-selection-queue-3FNZ4lRr.js +1 -0
  82. package/dist/assets/{viewer-url-state-BgjmiiI7.js → viewer-url-state-Dsu1DY22.js} +1 -1
  83. package/dist/assets/{workers-BbHjH3Kx.js → workers-Br5uqX4Z.js} +1 -1
  84. package/dist/assets/{xml-6YL6VXLw.js → xml-DB-ZrZ2e.js} +1 -1
  85. package/dist/assets/{yaml-sHG1-XNr.js → yaml-BeKBVxAt.js} +1 -1
  86. package/dist/assets/{zap-DwOV0Yov.js → zap-CHRkZMyJ.js} +1 -1
  87. package/dist/index.html +2 -2
  88. package/package.json +2 -2
  89. package/dist/assets/badge-D56AWxFv.js +0 -1
  90. package/dist/assets/batch-action-bar-DI05CPwy.js +0 -1
  91. package/dist/assets/config-BafxmOwJ.js +0 -10
  92. package/dist/assets/dist-CyWxUoCv.js +0 -1
  93. package/dist/assets/dist-DaacWHUX.js +0 -1
  94. package/dist/assets/dist-itgTE_D5.js +0 -1
  95. package/dist/assets/empty-state-DEbHhF9f.js +0 -1
  96. package/dist/assets/filename-validation-Dabe2ngK.js +0 -1
  97. package/dist/assets/hook-editor-CmPzPqnr.js +0 -1
  98. package/dist/assets/hook-runtime-D7L2zX15.js +0 -5
  99. package/dist/assets/hook-viewer-BvNgWI6w.js +0 -1
  100. package/dist/assets/hooks-C1lVbVNu.js +0 -1
  101. package/dist/assets/index-B5JVEaaS.css +0 -2
  102. package/dist/assets/index-C_HfATr4.js +0 -57
  103. package/dist/assets/insights-EjXDNx86.js +0 -1
  104. package/dist/assets/live-run-CnQOMMWG.js +0 -1
  105. package/dist/assets/memory-BSLWD6RW.js +0 -1
  106. package/dist/assets/memory-product-0B7_AV3X.js +0 -2
  107. package/dist/assets/monaco-editor-BYBlJAjA.js +0 -2
  108. package/dist/assets/observation-block-DvMkTmgC.js +0 -1
  109. package/dist/assets/observation-markdown-Bgcyet5t.js +0 -1
  110. package/dist/assets/plus-BhWnvE6F.js +0 -1
  111. package/dist/assets/popover-Boe1excX.js +0 -1
  112. package/dist/assets/resizable-o8j3Lihm.js +0 -1
  113. package/dist/assets/run-detail-CPo5ENE6.js +0 -1
  114. package/dist/assets/runs-CvH2p_Ks.js +0 -1
  115. package/dist/assets/scroll-area-B8cRs7wd.js +0 -1
  116. package/dist/assets/select-BE8tKMJy.js +0 -1
  117. package/dist/assets/shortcut-hints-BGIo5sip.js +0 -1
  118. package/dist/assets/split-button-CcR2TDPY.js +0 -1
  119. package/dist/assets/square-8TpalBCd.js +0 -1
  120. package/dist/assets/step-name-pills-0sDNmrmn.js +0 -1
  121. package/dist/assets/suite-editor-BUzpsLUR.js +0 -5
  122. package/dist/assets/suite-navbar-COFDYHho.js +0 -1
  123. package/dist/assets/suite-viewer-B62crjkX.js +0 -1
  124. package/dist/assets/suites-vH7UvBPg.js +0 -1
  125. package/dist/assets/switch-A6NW_YxI.js +0 -1
  126. package/dist/assets/tab-console-BXF3HNpW.js +0 -1
  127. package/dist/assets/table-D4kdbpq8.js +0 -1
  128. package/dist/assets/test-editor-BnD3gcCG.js +0 -9
  129. package/dist/assets/test-navbar-ZDxlwtJH.js +0 -7
  130. package/dist/assets/test-viewer-B-G8G6FH.js +0 -1
  131. package/dist/assets/tests-BcPHa9Nc.js +0 -1
  132. package/dist/assets/textarea-87HpNno6.js +0 -1
  133. package/dist/assets/use-hook-run-session-n1RKgcn6.js +0 -1
  134. package/dist/assets/use-page-title-CyHzJAcR.js +0 -1
  135. package/dist/assets/use-run-status-favicon-DTTz9_8q.js +0 -1
  136. package/dist/assets/use-selection-queue-CIpsCzay.js +0 -1
  137. /package/dist/assets/{abap-tccnpReA.js → abap-BEq1sfI-.js} +0 -0
  138. /package/dist/assets/{apex-BKVkKsbj.js → apex-B44QgtCx.js} +0 -0
  139. /package/dist/assets/{azcli-BRcTI6AW.js → azcli-DMZ9GGL6.js} +0 -0
  140. /package/dist/assets/{bat-CY1d4Jjr.js → bat-C9UmLmb8.js} +0 -0
  141. /package/dist/assets/{bicep--LouBhCq.js → bicep-DftblL_H.js} +0 -0
  142. /package/dist/assets/{cameligo-DSekJmSA.js → cameligo-CzLnGslK.js} +0 -0
  143. /package/dist/assets/{clojure-GBhsYY7r.js → clojure-ByLwyAQs.js} +0 -0
  144. /package/dist/assets/{coffee-9z_JJIkP.js → coffee-68kO868m.js} +0 -0
  145. /package/dist/assets/{cpp-D7LwQw_o.js → cpp-DzwB3t3R.js} +0 -0
  146. /package/dist/assets/{csharp-Df6S3RJJ.js → csharp-DYYXYf_U.js} +0 -0
  147. /package/dist/assets/{csp-AyuN80rc.js → csp-CM2i4rGd.js} +0 -0
  148. /package/dist/assets/{css-CYIs0S-t.js → css-DeSoHz_W.js} +0 -0
  149. /package/dist/assets/{cypher-CWTgbj6F.js → cypher-BKNyhJD3.js} +0 -0
  150. /package/dist/assets/{dart-BkjNQt7D.js → dart-BQc3JPCX.js} +0 -0
  151. /package/dist/assets/{dockerfile-jNxF4_km.js → dockerfile-BGxPbctm.js} +0 -0
  152. /package/dist/assets/{ecl-CybE3oEZ.js → ecl-CKjBzfQ2.js} +0 -0
  153. /package/dist/assets/{editor.api2-DEGvZ9jW.js → editor.api2-CX0IWJmc.js} +0 -0
  154. /package/dist/assets/{elixir-CdaOBnQZ.js → elixir-BBLR1E4J.js} +0 -0
  155. /package/dist/assets/{flow9-0HKoddfT.js → flow9-DZyS6Im9.js} +0 -0
  156. /package/dist/assets/{format-BpI4TiHn.js → format-Y_Dbfary.js} +0 -0
  157. /package/dist/assets/{fsharp-B4rCGS2D.js → fsharp-B_k18Kji.js} +0 -0
  158. /package/dist/assets/{go-BMkOAZO-.js → go-B5m-VPlE.js} +0 -0
  159. /package/dist/assets/{graphql-CT1i0Azo.js → graphql-B4NvZBRl.js} +0 -0
  160. /package/dist/assets/{hcl-Dqo24S10.js → hcl-CXiUP62m.js} +0 -0
  161. /package/dist/assets/{ini-B2qo6Bwi.js → ini-DIf6wU5x.js} +0 -0
  162. /package/dist/assets/{java-BIPaikgB.js → java-CpjOue3Z.js} +0 -0
  163. /package/dist/assets/{julia-DaOMlCPl.js → julia-dxHeF5LM.js} +0 -0
  164. /package/dist/assets/{kotlin-Bu1Cf0EE.js → kotlin-DRRSuc55.js} +0 -0
  165. /package/dist/assets/{less-CkzKMiAu.js → less-tNOoNPeH.js} +0 -0
  166. /package/dist/assets/{lexon-TKzNnbcT.js → lexon-zuaObGAE.js} +0 -0
  167. /package/dist/assets/{lua-6W3WJOvj.js → lua-BDGwBzPZ.js} +0 -0
  168. /package/dist/assets/{m3-B_B1XtJr.js → m3-FllEI98A.js} +0 -0
  169. /package/dist/assets/{markdown-LT3qFBoR.js → markdown-Dg9O28Mh.js} +0 -0
  170. /package/dist/assets/{marked.esm-Ba5AUJng.js → marked.esm-DGP46SGL.js} +0 -0
  171. /package/dist/assets/{mips-BuZ0JnPP.js → mips-BSEXxt-j.js} +0 -0
  172. /package/dist/assets/{msdax-BHMmXeIF.js → msdax-BUYxl4Gb.js} +0 -0
  173. /package/dist/assets/{mysql-B1RGnQ_F.js → mysql-CKjgZvko.js} +0 -0
  174. /package/dist/assets/{objective-c-CFGQUdp0.js → objective-c-CMAdlqWg.js} +0 -0
  175. /package/dist/assets/{pascal-Bunb0gdj.js → pascal-DnrBRw9P.js} +0 -0
  176. /package/dist/assets/{pascaligo-Ci9pazxY.js → pascaligo-DGZxRh0P.js} +0 -0
  177. /package/dist/assets/{perl-Brcsz0QG.js → perl-CKcCV5P6.js} +0 -0
  178. /package/dist/assets/{pgsql-BeM5icw2.js → pgsql-D117QWhR.js} +0 -0
  179. /package/dist/assets/{php-D_0c0usD.js → php-B7LpRV3v.js} +0 -0
  180. /package/dist/assets/{pla-BXJXsrLp.js → pla-75s5EwYc.js} +0 -0
  181. /package/dist/assets/{postiats-Bh7pQpS0.js → postiats-FKqEVO_y.js} +0 -0
  182. /package/dist/assets/{powerquery-17x2qNlN.js → powerquery-D2B9xeZA.js} +0 -0
  183. /package/dist/assets/{powershell-BK7CP1HA.js → powershell-DVyjSbmt.js} +0 -0
  184. /package/dist/assets/{protobuf-BIk_BSvx.js → protobuf-BBsLf-fq.js} +0 -0
  185. /package/dist/assets/{pug-AfVB1dqb.js → pug-CWV-ph9P.js} +0 -0
  186. /package/dist/assets/{qsharp-DdD7_Hjo.js → qsharp-QhIGXK1X.js} +0 -0
  187. /package/dist/assets/{r-BGqTutCA.js → r-BQomAm4N.js} +0 -0
  188. /package/dist/assets/{redis-Dlp6Na1w.js → redis-DzIifZp4.js} +0 -0
  189. /package/dist/assets/{redshift-i2kKyIGQ.js → redshift-C4TPhoa0.js} +0 -0
  190. /package/dist/assets/{restructuredtext-LmY6AGSd.js → restructuredtext-Dapr4eTe.js} +0 -0
  191. /package/dist/assets/{ruby-BxBoU2eR.js → ruby-BfU5yBGC.js} +0 -0
  192. /package/dist/assets/{rust-D9N2vQ1K.js → rust-BkuRlY3p.js} +0 -0
  193. /package/dist/assets/{sb-BLTMTQei.js → sb-C5vEAPYs.js} +0 -0
  194. /package/dist/assets/{scala-Ctl2an6m.js → scala-CUr1vafD.js} +0 -0
  195. /package/dist/assets/{scheme-DWYXU9Gm.js → scheme-wTgw6IJZ.js} +0 -0
  196. /package/dist/assets/{scss-Fo6PaAQp.js → scss-D_2qOFds.js} +0 -0
  197. /package/dist/assets/{shell-gQZQk28C.js → shell-CYPHnmAv.js} +0 -0
  198. /package/dist/assets/{solidity-np-sz1ji.js → solidity-Dg-teBwM.js} +0 -0
  199. /package/dist/assets/{sophia-Cpc3f9d7.js → sophia-BZcSzYf2.js} +0 -0
  200. /package/dist/assets/{sparql-BM_09I__.js → sparql-B198P2td.js} +0 -0
  201. /package/dist/assets/{sql-wg3M4gQ8.js → sql-DTwIGDsL.js} +0 -0
  202. /package/dist/assets/{st-CRbYFk1r.js → st-DRydv-vG.js} +0 -0
  203. /package/dist/assets/{swift-B8HA7HL5.js → swift-DsJ-FzuB.js} +0 -0
  204. /package/dist/assets/{systemverilog-Dm-upaoS.js → systemverilog-BfzGNA0B.js} +0 -0
  205. /package/dist/assets/{tcl-BroSe0zp.js → tcl-i-A18rYd.js} +0 -0
  206. /package/dist/assets/{twig-C-LV7gG6.js → twig-BcTx4v-O.js} +0 -0
  207. /package/dist/assets/{typespec-DxaoVH5m.js → typespec-C8pW8LGC.js} +0 -0
  208. /package/dist/assets/{vb-qvhMNncD.js → vb-DhhgAOPk.js} +0 -0
  209. /package/dist/assets/{wgsl-CZM87x1c.js → wgsl-CLi0cHxr.js} +0 -0
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{d as t,f as n,i as r,n as i,o as a,r as o,t as s,u as c}from"./tab-console-vamiKOKH.js";import{i as l,l as u,n as d,o as f,s as p,t as m,u as ee}from"./select-DF8sGWfv.js";import{C as h,c as g,i as _,n as v,r as y,w as te}from"./id-badge-CIlIhfqv.js";import{r as b}from"./monaco-editor-q3UYuc-5.js";import{t as ne}from"./circle-x-ITZ_DbXH.js";import{t as re}from"./copy-D-NZb7QZ.js";import{t as ie}from"./eye-DkGk2gsF.js";import{t as ae}from"./file-search-NMd1pdjr.js";import{i as oe}from"./split-button-BKCtgFiC.js";import{t as se}from"./refresh-cw-BtT1wl9S.js";import{t as ce}from"./square-CEW9RAjr.js";import{a as x}from"./dist-_gv57K8d.js";import{n as S,r as C,t as le}from"./popover-CuqW26_E.js";import{t as w}from"./switch-CgiZ-8Q1.js";import{i as ue,n as T,r as de,t as fe}from"./tabs-xxRH91gb.js";import{B as E,Bt as D,Cn as pe,Er as me,Ft as O,Gt as k,H as A,It as he,K as ge,Kt as _e,Lt as j,Tn as ve,U as M,V as N,Vt as P,Xt as F,en as I,mr as L,nr as ye,pr as R,qt as be,xn as xe,yr as Se}from"./index-CWwAjH9Q.js";import{t as z}from"./badge-DHCU59H0.js";import{t as B}from"./scroll-area-CPuygHdB.js";import{n as V,r as H,t as Ce}from"./resizable-C3bJVUPo.js";import{t as U}from"./empty-state-3cB27tBp.js";import{t as we}from"./display-step-CYKXUkbs.js";var Te=F(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ee=F(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),De=F(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),W=e(me(),1);function Oe(e){function t(e){if(y(e)){e.flow=!1;for(let n of e.items)t(n.value)}if(_(e)){e.flow=!1;for(let n of e.items)t(n)}}t(e.contents)}function ke(e){function t(e){return y(e)?(e.items=e.items.filter(e=>!t(e.value)),e.items.length===0):!1}t(e.contents)}var G=[`name`,`test-id`,`target`,`use`,`meta`,`context`,`steps`];function Ae(e){function t(e,n){if(y(e)){n?e.items.sort((e,t)=>{let n=G.indexOf(String(e.key)),r=G.indexOf(String(t.key));return(n===-1?G.length:n)-(r===-1?G.length:r)}):e.items.sort((e,t)=>String(e.key).localeCompare(String(t.key)));for(let n of e.items)t(n.value,!1)}}t(e.contents,!0)}function je(e){return ke(e),Oe(e),Ae(e),e.toString()}function K(e){let t=(0,W.useRef)(null),{doc:n,error:r}=(0,W.useMemo)(()=>{if(!e)return{doc:null,error:null};try{let n=v(e);return t.current=n,{doc:n,error:null}}catch(e){return{doc:t.current,error:e instanceof Error?e.message:`Invalid YAML`}}},[e]);return{doc:n,error:r,getIn:(0,W.useCallback)(e=>{if(n)return n.getIn(e)},[n]),setIn:(0,W.useCallback)((t,n)=>{let r=v(e);return r.setIn(t,n),je(r)},[e]),deleteIn:(0,W.useCallback)(t=>{let n=v(e);return n.deleteIn(t),je(n)},[e])}}var q=I(),Me=[{value:`chromium`,label:`Chromium`},{value:`firefox`,label:`Firefox`},{value:`webkit`,label:`WebKit`}];function J(e){return e==null?``:`${e} (inherited)`}function Y(e){return e===!0?`(inherited: on)`:e===!1?`(inherited: off)`:`(inherited)`}var Ne=/^[a-z][a-z0-9-]*[a-z0-9]$/,Pe=new Set([`name`,`load`,`capture`]);function Fe(e){return e===`preserve`?`Preserve app data (inherited)`:e===`reset`?`Reset app data (inherited)`:`Select app state`}function Ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function X(e){return Ne.test(e)}function Le(e){if(e===void 0)return{present:!1,valid:!1,name:``,load:!0,capture:!1};if(typeof e==`string`){let t=e.trim();return X(t)?{present:!0,valid:!0,name:t,load:!0,capture:!1}:{present:!0,valid:!1,name:``,load:!0,capture:!1}}if(Ie(e)){let t=Object.keys(e).every(e=>Pe.has(e)),n=typeof e.name==`string`?e.name.trim():``,r=e.load===void 0||typeof e.load==`boolean`,i=e.capture===void 0||typeof e.capture==`boolean`;if(t&&X(n)&&r&&i)return{present:!0,valid:!0,name:n,load:e.load!==!1,capture:e.capture===!0}}return{present:!0,valid:!1,name:``,load:!0,capture:!1}}function Re(e,t,n){return t&&!n?e:{name:e,...t?{}:{load:!1},...n?{capture:!0}:{}}}function ze({content:e,onChange:t,selectedTarget:n,showMeta:r=!0}){let{doc:i,getIn:a,setIn:o,deleteIn:s}=K(e);function c(e,n){t(n===``||n==null?s(e):o(e,n))}function u(e,n,r){t(n===(r??!1)?s(e):o(e,n))}let{targets:ee,globalUse:h}=g(),_=n?ee[n]?.platform:void 0,v=_===`android`||_===`ios`,y=a([`use`,`browser`,`name`]),te=a([`use`,`browser`,`headless`]),b=a([`use`,`browser`,`viewport`,`width`]),ne=a([`use`,`browser`,`viewport`,`height`]),re=a([`use`,`timeout`,`step`]),ie=a([`use`,`timeout`,`test`]),ae=a([`use`,`timeout`,`navigation`]),oe=a([`use`,`healing`,`maxAttempts`]),se=a([`use`,`planner`,`maxSubActions`]),ce=a([`use`,`planner`,`previousStepCount`]),S=a([`use`,`logCapture`,`console`]),C=a([`use`,`logCapture`,`network`]),le=a([`use`,`llm`]),ue=a([`use`,`parallel`]),T=a([`use`,`device`]),de=a([`use`,`mobile`,`appState`]),fe=(0,W.useMemo)(()=>{try{return(i?.toJSON())?.use?.authState}catch{return}},[i]),D=(0,W.useMemo)(()=>Le(fe),[fe]),[pe,me]=(0,W.useState)(D.valid?D.name:``),O=a([`meta`,`retries`]),k=a([`meta`,`record`]),A=h?.browser?.headless,he=h?.logCapture?.console,ge=h?.logCapture?.network,_e=h?.parallel,j=h?.mobile?.appState,ve=r?`Select a device for this mobile test.`:`Select a device for this mobile suite.`,M=pe.trim(),P=M.length>0&&!X(M),F=M.length>0&&!P,I=D.valid?D.load:!0,L=D.valid?D.capture:!1;(0,W.useEffect)(()=>{me(D.valid?D.name:``)},[D.valid,D.name]);function ye(e){t(e===j?s([`use`,`mobile`,`appState`]):o([`use`,`mobile`,`appState`],e))}function R(e,n,r){t(o([`use`,`authState`],Re(e,n,r)))}function be(e){me(e);let n=e.trim();if(n.length===0){t(s([`use`,`authState`]));return}X(n)&&R(n,I,L)}function xe(e){F&&R(M,e,L)}function Se(e){F&&R(M,I,e)}return(0,q.jsxs)(`div`,{className:`space-y-3`,children:[v?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-1 opacity-50`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Browser`}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Not applicable to mobile targets`})]}),(0,q.jsx)(E,{})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Browser`}),(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Engine`}),(0,q.jsxs)(m,{value:y??``,onValueChange:e=>c([`use`,`browser`,`name`],e||void 0),children:[(0,q.jsx)(f,{className:`w-full h-7 text-xs`,children:(0,q.jsx)(p,{placeholder:J(h?.browser?.name??`chromium`)})}),(0,q.jsx)(d,{children:Me.map(e=>(0,q.jsx)(l,{value:e.value,children:e.label},e.value))})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Headless `,te===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Y(A)})]}),(0,q.jsx)(w,{checked:te??A??!0,onCheckedChange:e=>u([`use`,`browser`,`headless`],e,A)})]}),(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Viewport W`}),(0,q.jsx)(N,{type:`number`,value:b??``,onChange:e=>c([`use`,`browser`,`viewport`,`width`],e.target.value?Number(e.target.value):void 0),placeholder:J(h?.browser?.viewport?.width??1280),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Viewport H`}),(0,q.jsx)(N,{type:`number`,value:ne??``,onChange:e=>c([`use`,`browser`,`viewport`,`height`],e.target.value?Number(e.target.value):void 0),placeholder:J(h?.browser?.viewport?.height??720),className:`h-7 text-xs`})]})]})]}),(0,q.jsx)(E,{})]}),v?D.present?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-1 opacity-70`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Auth State`}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Web auth state is not available for mobile targets. Use Mobile / App state to preserve app data.`})]}),(0,q.jsx)(E,{})]}):null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Auth State`}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-name`,className:`text-[11px] text-muted-foreground`,children:`Auth state name`}),(0,q.jsx)(N,{id:`auth-state-name`,value:pe,onChange:e=>be(e.target.value),placeholder:`demo-acc`,className:`h-7 text-xs font-mono`}),P?(0,q.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Auth state name must be a lowercase slug.`}):null]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-load`,className:`text-[11px] text-muted-foreground`,children:`Load before run`}),(0,q.jsx)(w,{id:`auth-state-load`,checked:F?I:!0,disabled:!F,onCheckedChange:xe})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-capture`,className:`text-[11px] text-muted-foreground`,children:`Capture after success`}),(0,q.jsx)(w,{id:`auth-state-capture`,checked:F?L:!1,disabled:!F,onCheckedChange:Se})]}),F&&L?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:I?`Loads this state first, then replaces it after a successful run.`:`Starts without saved auth state, then saves this name after a successful run.`}),(0,q.jsx)(`p`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1 text-[11px] text-amber-700 dark:text-amber-300`,children:`Capture creates or replaces the saved state after the run succeeds.`})]}):null]}),(0,q.jsx)(E,{})]}),v?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Mobile`}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Device`}),(0,q.jsx)(N,{value:T??``,onChange:e=>c([`use`,`device`],e.target.value||void 0),placeholder:ve,className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`App state`}),(0,q.jsxs)(m,{value:de??``,onValueChange:e=>ye(e),children:[(0,q.jsx)(f,{className:`w-full h-7 text-xs`,children:(0,q.jsx)(p,{placeholder:Fe(j)})}),(0,q.jsxs)(d,{children:[(0,q.jsx)(l,{value:`preserve`,children:`Preserve app data`}),(0,q.jsx)(l,{value:`reset`,children:`Reset app data`})]})]})]})]}),(0,q.jsx)(E,{})]}):null,(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Timeouts`}),(0,q.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Step`}),(0,q.jsx)(N,{value:re??``,onChange:e=>c([`use`,`timeout`,`step`],e.target.value||void 0),placeholder:J(h?.timeout?.step??`30s`),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Test`}),(0,q.jsx)(N,{value:ie??``,onChange:e=>c([`use`,`timeout`,`test`],e.target.value||void 0),placeholder:J(h?.timeout?.test??`5m`),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Navigation`}),(0,q.jsx)(N,{value:ae??``,onChange:e=>c([`use`,`timeout`,`navigation`],e.target.value||void 0),placeholder:J(h?.timeout?.navigation??`15s`),className:`h-7 text-xs`})]})]})]}),(0,q.jsx)(E,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Agent`}),(0,q.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Heal Attempts`}),(0,q.jsx)(N,{type:`number`,min:0,value:oe??``,onChange:e=>c([`use`,`healing`,`maxAttempts`],e.target.value?Number(e.target.value):void 0),placeholder:J(h?.healing?.maxAttempts??3),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Sub-Actions`}),(0,q.jsx)(N,{type:`number`,min:1,value:se??``,onChange:e=>c([`use`,`planner`,`maxSubActions`],e.target.value?Number(e.target.value):void 0),placeholder:J(h?.planner?.maxSubActions??5),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Prev Steps`}),(0,q.jsx)(N,{type:`number`,min:0,value:ce??``,onChange:e=>c([`use`,`planner`,`previousStepCount`],e.target.value?Number(e.target.value):void 0),placeholder:J(h?.planner?.previousStepCount??3),className:`h-7 text-xs`})]})]})]}),(0,q.jsx)(E,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Log Capture`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Console `,S===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Y(he)})]}),(0,q.jsx)(w,{checked:S??he??!1,onCheckedChange:e=>u([`use`,`logCapture`,`console`],e,he)})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Network `,C===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Y(ge)})]}),(0,q.jsx)(w,{checked:C??ge??!1,onCheckedChange:e=>u([`use`,`logCapture`,`network`],e,ge)})]})]}),(0,q.jsx)(E,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`LLM`}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`LLM Config`}),(0,q.jsx)(N,{value:le??``,onChange:e=>c([`use`,`llm`],e.target.value||void 0),placeholder:J(h?.llm??`default`),className:`h-7 text-xs`})]})]}),(0,q.jsx)(E,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Execution`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Parallel `,ue===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Y(_e)})]}),(0,q.jsx)(w,{checked:ue??_e??!1,onCheckedChange:e=>u([`use`,`parallel`],e,_e)})]}),r&&(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Retries`}),(0,q.jsx)(N,{type:`number`,min:0,value:O??``,onChange:e=>c([`meta`,`retries`],e.target.value?Number(e.target.value):void 0),placeholder:`0 (inherited)`,className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Record `,k===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:`(inherited: off)`})]}),(0,q.jsx)(`div`,{className:`flex items-center h-7`,children:(0,q.jsx)(w,{checked:k??!1,onCheckedChange:e=>u([`meta`,`record`],e,!1)})})]})]})]})]})}function Z({runId:e,onClose:n}){let[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(`connecting`),[s,c]=(0,W.useState)(),[l,u]=(0,W.useState)(0),d=(0,W.useRef)(null);if((0,W.useEffect)(()=>{if(!e)return;let t=!1;i([]),o(`connecting`),c(void 0),u(0);let n=Date.now();d.current=setInterval(()=>{t||u(Date.now()-n)},200);let r=ye(e,{onRunStart:()=>{t||o(`running`)},onStepStart:e=>{t||(o(`running`),i(t=>[...t,{name:e.stepName,status:`running`}]))},onStepComplete:e=>{t||i(t=>{let n=!1;return t.map(t=>n||t.name!==e.stepName||t.status!==`running`?t:(n=!0,{...t,status:Se(e.status),duration:e.duration,error:e.error??void 0}))})},onRunComplete:e=>{if(t)return;let n=L(e.status);c(n.normalized),o(n.normalized===`passed`?`complete`:`error`),i(t=>t.map(t=>t.status===`running`?{...t,status:R(e.status)}:t)),d.current&&clearInterval(d.current)},onRunError:e=>{t||(o(`error`),i(t=>[...t,{name:`Run Error`,status:`failed`,error:e.error}]),d.current&&clearInterval(d.current))}});return()=>{t=!0,d.current&&clearInterval(d.current),r.close()}},[e]),!e)return null;let f=s?L(s):null,p=a===`connecting`?`Connecting...`:a===`running`?`Running`:f?.label??(a===`complete`?`Passed`:`Failed`);return(0,q.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a===`running`||a===`connecting`?(0,q.jsx)(te,{className:`size-4 text-primary`}):f?.normalized===`passed`||a===`complete`?(0,q.jsx)(k,{className:`size-4 text-emerald-500`}):f?.normalized===`cancelled`?(0,q.jsx)(ce,{className:`size-4 text-muted-foreground`}):f?.normalized===`flaky`||f?.normalized===`healed`?(0,q.jsx)(se,{className:`size-4 text-amber-500`}):(0,q.jsx)(ne,{className:`size-4 text-red-500`}),(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:p}),(a===`running`||a===`connecting`)&&(0,q.jsxs)(z,{variant:`outline`,className:`text-xs gap-1`,children:[(0,q.jsx)(t,{className:`size-3`}),ge(l)]})]}),(0,q.jsx)(A,{variant:`ghost`,size:`icon-xs`,onClick:n,children:(0,q.jsx)(O,{className:`size-3.5`})})]}),(0,q.jsx)(B,{className:`flex-1 [&>[data-slot=scroll-area-viewport]>div]:!block`,children:(0,q.jsxs)(`div`,{className:`p-3 space-y-1.5`,children:[r.map((e,t)=>(0,q.jsxs)(`div`,{className:M(`relative overflow-hidden flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,e.status===`running`&&`live-running-surface border-border/60 bg-primary/5`,e.status===`passed`&&`border-emerald-500/20 bg-emerald-500/5`,e.status===`failed`&&`border-destructive/20 bg-destructive/5`,e.status===`cancelled`&&`border-border/60 bg-muted/30`,e.status===`flaky`&&`border-amber-500/20 bg-amber-500/5`,e.status!==`running`&&e.status!==`passed`&&e.status!==`failed`&&e.status!==`cancelled`&&e.status!==`flaky`&&`border-border/60 bg-card/40`),children:[e.status===`running`?(0,q.jsx)(te,{className:`size-3.5 mt-0.5 shrink-0 text-primary`}):e.status===`passed`||e.status===`completed`?(0,q.jsx)(k,{className:`size-3.5 mt-0.5 text-emerald-500 shrink-0`}):e.status===`cancelled`?(0,q.jsx)(ce,{className:`size-3.5 mt-0.5 text-muted-foreground shrink-0`}):e.status===`flaky`?(0,q.jsx)(se,{className:`size-3.5 mt-0.5 text-amber-500 shrink-0`}):(0,q.jsx)(ne,{className:`size-3.5 mt-0.5 text-red-500 shrink-0`}),(0,q.jsx)(`span`,{className:`flex-1 min-w-0 break-words`,children:e.name}),e.duration!==void 0&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:ge(e.duration)})]},`${e.name}-${t}`)),r.length===0&&a===`connecting`&&(0,q.jsx)(`div`,{className:`text-sm text-muted-foreground text-center py-8`,children:`Waiting for events...`})]})})]})}function Be({ariaTree:e,onRefresh:t,isExecuting:n}){return e?(0,q.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,q.jsx)(`div`,{className:`flex items-center justify-end px-3 py-1 border-b border-border/50`,children:t&&(0,q.jsxs)(`button`,{type:`button`,onClick:t,disabled:n,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50`,"aria-label":`Refresh ARIA tree`,children:[(0,q.jsx)(se,{className:`size-3`}),`Refresh`]})}),(0,q.jsx)(B,{className:`flex-1`,children:(0,q.jsx)(`pre`,{className:`font-mono text-xs p-3 whitespace-pre-wrap`,children:e})})]}):(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-sm text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:`Run a step or click Fetch to capture the accessibility tree`}),t&&(0,q.jsxs)(`button`,{type:`button`,onClick:t,disabled:n,className:`flex items-center gap-1.5 text-xs px-2.5 py-1 rounded border border-border hover:bg-muted transition-colors disabled:opacity-50`,children:[(0,q.jsx)(se,{className:`size-3`}),`Fetch`]})]})}function Ve(e){let t=[];return e.observation&&t.push({key:`observation`,label:`Observation`,icon:ie,content:e.observation,duration:e.phaseDurations?.observe??null}),e.reasoning&&t.push({key:`reasoning`,label:`Reasoning`,icon:n,content:e.reasoning,duration:e.phaseDurations?.plan??null}),e.plannedAction!=null&&t.push({key:`plannedAction`,label:`Planned Action`,icon:D,content:null,duration:e.phaseDurations?.execute??null,children:(0,q.jsx)(`pre`,{className:`max-w-full min-w-0 text-[10px] font-mono bg-muted/30 rounded-sm p-2 overflow-x-auto whitespace-pre-wrap break-words`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),e.verifierReasoning&&t.push({key:`verifier`,label:`Verifier`,icon:c,content:e.verifierReasoning,duration:e.phaseDurations?.verify??null}),t}function He(e){let t=[];return e.observation&&t.push({key:`observation`,label:`Observation`,icon:ie,content:e.observation,duration:null}),e.reasoning&&t.push({key:`reasoning`,label:`Reasoning`,icon:n,content:e.reasoning,duration:null}),e.plannedAction!=null&&t.push({key:`plannedAction`,label:`Planned Action`,icon:D,content:null,duration:null,children:(0,q.jsx)(`pre`,{className:`max-w-full min-w-0 text-[10px] font-mono bg-muted/30 rounded-sm p-2 overflow-x-auto whitespace-pre-wrap break-words`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),t}function Ue({step:e,subAction:t}){if(t){let e=Ve(t);return(0,q.jsxs)(`div`,{className:`p-3 space-y-3 min-w-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,q.jsxs)(`span`,{className:`font-medium`,children:[`Sub-action #`,t.index+1]}),(0,q.jsx)(`span`,{className:`text-xs font-medium ${t.result===`success`?`text-emerald-500`:`text-red-500`}`,children:t.result}),t.confidence!=null&&(0,q.jsx)(a,{confidence:t.confidence})]}),(0,q.jsx)(r,{mode:`static`,sections:e}),t.error&&(0,q.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded-sm p-2 text-xs break-words [overflow-wrap:anywhere]`,children:t.error})]})}let n=He(e);return(0,q.jsxs)(`div`,{className:`p-3 space-y-3 min-w-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,q.jsxs)(`span`,{className:`font-medium`,children:[`Step #`,e.stepOrder+1]}),e.confidence!=null&&(0,q.jsx)(a,{confidence:e.confidence})]}),n.length>0?(0,q.jsx)(r,{mode:`static`,sections:n}):(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No reasoning data yet.`}),e.error&&(0,q.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded-sm p-2 text-xs break-words [overflow-wrap:anywhere]`,children:e.error})]})}function We({screenshot:e,connectionState:t,onReconnect:n}){return(0,q.jsx)(`div`,{className:`relative flex h-full w-full items-center justify-center overflow-hidden bg-background`,children:e?(0,q.jsx)(`img`,{src:e,alt:`Browser preview`,className:`max-w-full max-h-full object-contain`}):t===`connecting`||t===`connected`&&!e?(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-muted-foreground`,children:[(0,q.jsx)(P,{className:`h-6 w-6 animate-spin`}),(0,q.jsx)(`span`,{className:`text-sm`,children:`Connecting to browser...`})]}):t===`disconnected`||t===`error`?(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-muted-foreground`,children:[(0,q.jsx)(De,{className:`h-6 w-6`}),(0,q.jsx)(`span`,{className:`text-sm`,children:`Browser disconnected`}),n&&(0,q.jsx)(A,{variant:`outline`,size:`sm`,onClick:n,children:`Reconnect`})]}):null})}var Ge=/^[a-z][a-z0-9-]*[a-z0-9]$/;function Ke(e){let t=e?.trim()??``;return Ge.test(t)?t:``}function qe({capture:e,disabled:t=!1}){let[n,r]=(0,W.useState)(!1),[i,a]=(0,W.useState)(()=>Ke(e.initialName)),[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(!1),d=e.targetName,f=i.trim(),p=t||c||e.isSaving===!0;(0,W.useEffect)(()=>{n&&(a(Ke(e.initialName)),s(null))},[e.initialName,n]);let m=(0,W.useMemo)(()=>e.authStates.filter(e=>e.target===d),[e.authStates,d]),ee=m.some(e=>e.name===f),h=o??e.error??null;return(0,q.jsxs)(le,{open:n,onOpenChange:e=>!p&&r(e),children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,q.jsx)(C,{asChild:!0,children:(0,q.jsxs)(A,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-r-sm`,disabled:p,onClick:()=>r(!0),children:[(0,q.jsx)(Te,{className:`size-3.5`}),`Save auth state`]})}),(0,q.jsx)(C,{asChild:!0,children:(0,q.jsx)(A,{type:`button`,variant:`outline`,size:`icon-sm`,className:`rounded-l-sm px-2`,disabled:p,"aria-label":`Open auth state save form`,onClick:()=>r(!0),children:p&&e.isSaving?(0,q.jsx)(P,{className:`size-3.5 animate-spin`}):(0,q.jsx)(u,{className:`size-3.5`})})})]}),(0,q.jsxs)(S,{align:`end`,className:`w-[360px] max-w-[calc(100vw-32px)] space-y-4`,children:[(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Save auth state`}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Capture the current browser session for this target.`})]}),(0,q.jsxs)(`div`,{className:`rounded-md border bg-muted/30 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Target`}),(0,q.jsx)(`div`,{className:`mt-1 min-w-0 font-mono text-xs [overflow-wrap:anywhere]`,children:d})]}),(0,q.jsxs)(`form`,{className:`space-y-4`,onSubmit:async t=>{if(t.preventDefault(),!p){if(!Ge.test(f)){s(`Auth state name must be a lowercase slug.`);return}s(null),l(!0);try{await e.onSave({name:f,replace:ee}),r(!1)}catch{s(`Could not save auth state "${f}" for target "${d}".`)}finally{l(!1)}}},children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-name`,children:`Auth state name`}),(0,q.jsx)(N,{id:`auth-state-name`,name:`authStateName`,value:i,placeholder:`admin`,onChange:e=>{a(e.target.value),s(null)},"aria-invalid":h?`true`:void 0,autoFocus:!0}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use lowercase letters, numbers, and hyphens.`})]}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Saved for this target`}),m.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:m.map(e=>(0,q.jsx)(z,{variant:e.name===f?`secondary`:`outline`,className:`font-mono text-[10px]`,children:e.name},`${e.target}:${e.name}`))}):(0,q.jsx)(`div`,{className:`rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground`,children:`No auth states saved for this target.`})]}),ee&&(0,q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,q.jsx)(j,{className:`mt-0.5 size-3.5 shrink-0`}),(0,q.jsx)(`span`,{children:`Existing auth state will be replaced.`})]}),h&&(0,q.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-2 py-2 text-xs text-destructive`,children:h}),(0,q.jsx)(`div`,{className:`flex justify-end`,children:(0,q.jsxs)(A,{type:`submit`,size:`sm`,disabled:p,className:M(ee&&`bg-primary`),children:[c||e.isSaving?(0,q.jsx)(P,{className:`size-3.5 animate-spin`}):null,ee?`Replace auth state`:`Save auth state`]})})]})]})]})}var Je={idle:{label:`Ready`,tone:`bg-muted-foreground/35`},connecting:{label:`Connecting`,tone:`bg-primary animate-pulse`},connected:{label:`Connected`,tone:`bg-emerald-500`},executing:{label:`Executing`,tone:`bg-primary animate-pulse`},disconnected:{label:`Disconnected`,tone:`bg-amber-500`},error:{label:`Error`,tone:`bg-destructive`}};function Ye(e){switch(e){case`invalid`:return{label:`Draft invalid`,className:`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`};case`saved`:return{label:`Saved draft`,className:`border-border/70 bg-background text-muted-foreground`};default:return{label:`Using unsaved draft`,className:`border-primary/25 bg-primary/10 text-primary`}}}function Xe(e,t){let n=e.trim();if(!n)return``;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return n;if(n.startsWith(`/`))try{return new URL(n,t??`https://example.com`).toString()}catch{return n}return/^[\w.-]+(?::\d+)?(?:[/?#]|$)/.test(n)?`https://${n}`:n}function Ze({hook:e}){return e.status===`passed`?(0,q.jsxs)(z,{className:`border-emerald-500/20 bg-emerald-500/15 text-emerald-500`,children:[(0,q.jsx)(k,{className:`size-3`}),`Passed`]}):e.status===`failed`?(0,q.jsxs)(z,{variant:`destructive`,children:[(0,q.jsx)(j,{className:`size-3`}),`Failed`]}):e.status===`running`?(0,q.jsxs)(z,{className:`border-primary/20 bg-primary/15 text-primary`,children:[(0,q.jsx)(P,{className:`size-3 animate-spin`}),`Running`]}):(0,q.jsx)(z,{variant:`outline`,children:`Pending`})}function Qe({hook:e}){return!e.variables||Object.keys(e.variables).length===0?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`This hook did not emit any variables`}):(0,q.jsx)(`div`,{className:`space-y-2 p-4`,children:Object.entries(e.variables).map(([e,t])=>(0,q.jsxs)(`div`,{className:`rounded-md border bg-background/80 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,q.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-all font-mono text-xs`,children:t})]},e))})}function $e({hook:e}){return(0,q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(he,{className:`size-4 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})]}),(0,q.jsx)(z,{variant:`outline`,className:`font-mono text-[10px]`,children:e.id}),(0,q.jsx)(z,{variant:`outline`,className:`text-[10px] uppercase tracking-wide`,children:e.phase}),(0,q.jsx)(Ze,{hook:e}),e.duration!=null&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.duration<1e3?`${e.duration}ms`:`${(e.duration/1e3).toFixed(1)}s`})]}),e.error&&(0,q.jsx)(`div`,{className:`min-w-0 max-w-full rounded-md border border-destructive/25 bg-destructive/10 px-3 py-2 text-sm text-destructive [overflow-wrap:anywhere]`,children:e.error}),e.stdout&&(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`stdout`}),(0,q.jsx)(`pre`,{className:`rounded-md border bg-background/80 p-3 text-xs whitespace-pre-wrap break-all`,children:e.stdout})]}),e.stderr&&(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`stderr`}),(0,q.jsx)(`pre`,{className:`rounded-md border border-destructive/20 bg-destructive/5 p-3 text-xs whitespace-pre-wrap break-all text-destructive`,children:e.stderr})]}),e.variables&&Object.keys(e.variables).length>0&&(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Emitted Variables`}),(0,q.jsx)(Qe,{hook:e})]}),!e.stdout&&!e.stderr&&(!e.variables||Object.keys(e.variables).length===0)&&!e.error&&(0,q.jsx)(U,{icon:he,title:`No hook output yet`,description:`Connect a live session, run a teardown hook, or end the current session to capture hook output.`})]})}function et(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n.status!==`idle`||n.phases.length>0||n.executionHistory.length>0||n.consoleLogs.length>0||n.networkLogs.length>0)return n}return null}function tt(e){switch(e){case`running`:return`border-primary/20 bg-primary/10 text-primary`;case`passed`:return`border-emerald-500/20 bg-emerald-500/10 text-emerald-500`;case`failed`:return`border-destructive/20 bg-destructive/10 text-destructive`;case`cancelled`:return`border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400`;default:return`border-border/70 bg-background text-muted-foreground`}}function nt(e){switch(e){case`running`:return`border-primary/20 bg-primary/10 text-primary`;case`passed`:case`healed`:case`flaky`:return`border-emerald-500/20 bg-emerald-500/10 text-emerald-500`;case`failed`:case`cancelled`:case`skipped`:return`border-destructive/20 bg-destructive/10 text-destructive`;default:return`border-border/70 bg-background text-muted-foreground`}}function rt({test:e,selectedStep:t,subAction:n}){let r=e.liveSteps.map(e=>we(e,e.stepIndex));return(0,q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium`,children:e.name}),(0,q.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.path})]}),(0,q.jsx)(z,{variant:`outline`,className:M(`text-[10px] uppercase tracking-wide`,tt(e.status)),children:e.status}),typeof e.duration==`number`&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.duration<1e3?`${e.duration}ms`:`${(e.duration/1e3).toFixed(1)}s`})]}),e.error&&(0,q.jsx)(`div`,{className:`min-w-0 max-w-full rounded-md border border-destructive/25 bg-destructive/10 px-3 py-2 text-sm text-destructive [overflow-wrap:anywhere]`,children:e.error}),(0,q.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,q.jsxs)(`div`,{className:`rounded-md border bg-background/80 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Setup Hooks`}),(0,q.jsx)(`div`,{className:`mt-2 text-sm`,children:e.perTestSetupHooks.length>0?e.perTestSetupHooks.map(e=>`${e.name} (${e.status})`).join(`, `):`No per-test setup hooks`})]}),(0,q.jsxs)(`div`,{className:`rounded-md border bg-background/80 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Teardown Hooks`}),(0,q.jsx)(`div`,{className:`mt-2 text-sm`,children:e.perTestTeardownHooks.length>0?e.perTestTeardownHooks.map(e=>`${e.name} (${e.status})`).join(`, `):`No per-test teardown hooks`})]})]}),r.length>0?(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Steps`}),(0,q.jsx)(`div`,{className:`space-y-3`,children:r.map(e=>{let r=t?.id===e.id,i=e.subActionsData??[];return(0,q.jsxs)(`div`,{className:M(`overflow-hidden rounded-md border bg-background/80`,r&&`border-primary/30 ring-1 ring-primary/20`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 border-b px-3 py-2`,children:[(0,q.jsxs)(`span`,{className:`shrink-0 text-sm font-medium`,children:[`Step #`,e.stepOrder+1]}),(0,q.jsx)(z,{variant:`outline`,className:M(`text-[10px] uppercase tracking-wide`,nt(e.status)),children:e.status}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e.name}),e.duration>0&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.duration<1e3?`${e.duration}ms`:`${(e.duration/1e3).toFixed(1)}s`})]}),i.length>0?(0,q.jsx)(`div`,{className:`divide-y divide-border/60`,children:i.map(t=>(0,q.jsx)(`div`,{className:M(r&&n?.index===t.index&&`bg-primary/5`),children:(0,q.jsx)(Ue,{step:e,subAction:t})},`${e.id}-sub-${t.index}`))}):(0,q.jsx)(Ue,{step:e,subAction:r?n:null})]},e.id)})})]}):(0,q.jsx)(`div`,{className:`rounded-md border border-dashed px-4 py-6 text-sm text-muted-foreground`,children:`This test has not produced any live step detail yet. Run it from the queue to inspect reasoning, console, network, and hook output.`})]})}function it({connectionState:e,isLaunching:t,targetName:n,targetLabel:r,platform:a,screenshot:c,currentUrl:l,pendingNavigation:u,steps:d,setupHooks:f,teardownHooks:p,tests:m=[],selection:g,runningStepId:_,terminalState:v,draftState:y,ariaTree:te,errorMessage:ne,devtoolsTab:ie,canRunAll:x,isRunningAll:S,isStoppingRunAll:C,setupHooksStale:le=!1,onDevtoolsTabChange:w,onRunAll:E,onStopAll:D,onEndSession:pe,onRestartSession:me,showEndSessionAction:O=!1,onCloseLiveMode:k,onStartFreshSession:he,onBack:ge,onForward:ve,onRefresh:N,onNavigate:F,onRequestAriaTree:I,executionUnit:L=`step`,runAllLabel:ye,stopAllLabel:R,liveSessionNumber:xe=null,unitRowsSlot:Se,authStateCapture:Te=null}){let[De,Oe]=(0,W.useState)(!1),[ke,G]=(0,W.useState)(``),[Ae,je]=(0,W.useState)(!1),K=t?`connecting`:e,Me=v?{label:v.reason===`ended`?`Ended`:`Disconnected`,tone:v.reason===`ended`?`bg-muted-foreground/45`:`bg-amber-500`}:Je[K],J=(0,W.useMemo)(()=>d.map((e,t)=>we(e,t)),[d]),Y=L===`test`,Ne=!Y,Pe=(0,W.useMemo)(()=>[...f,...p],[f,p]),Fe=(0,W.useMemo)(()=>_||(et(d)?.id??null),[_,d]),Ie=g&&`stepId`in g?g.stepId:Fe,X=(0,W.useMemo)(()=>J.find(e=>e.id===Ie)??null,[J,Ie]),Le=(0,W.useMemo)(()=>g?.type!==`subaction`||!X?null:X.subActionsData?.[g.subIndex]??null,[g,X]),Re=(0,W.useMemo)(()=>d.find(e=>e.id===X?.id)??null,[X,d]),ze=(0,W.useMemo)(()=>g?.type===`hook`?Pe.find(e=>e.id===g.hookId)??null:null,[g,Pe]),Z=(0,W.useMemo)(()=>!Y||!g?null:g.type===`test`||g.type===`test-hook`?m[g.testIndex]??null:`stepId`in g?m.find(e=>e.liveSteps.some(e=>e.id===g.stepId))??null:null,[g,Y,m]),Ve=(0,W.useMemo)(()=>!Y||g?.type!==`suite-hook`?null:(g.phase===`setup`?f:p).find(e=>e.id===g.hookId)??null,[g,f,Y,p]),He=(0,W.useMemo)(()=>{if(!Y||g?.type!==`test-hook`)return null;let e=m[g.testIndex];return e?(g.phase===`setup`?e.perTestSetupHooks:e.perTestTeardownHooks).find(e=>e.id===g.hookId)??null:null},[g,Y,m]),Ge=(0,W.useMemo)(()=>{if(!Y||!Z)return null;if(g&&`stepId`in g){let e=Z.liveSteps.find(e=>e.id===g.stepId);if(e)return e}if(Z.runningStepIndex!==null){let e=Z.liveSteps.find(e=>e.stepIndex===Z.runningStepIndex);if(e)return e}return et(Z.liveSteps)},[g,Z,Y]),Ke=(0,W.useMemo)(()=>Ge?we(Ge,Ge.stepIndex):null,[Ge]),Ze=(0,W.useMemo)(()=>g?.type!==`subaction`||!Ke?null:Ke.subActionsData?.[g.subIndex]??null,[g,Ke]),tt=(0,W.useMemo)(()=>Z?.liveSteps.map(e=>we(e,e.stepIndex))??[],[Z]),nt=Ge?.executionLogs??[],it=Re?.executionLogs??[],at=Ye(y),Q=a===`web`?l||r||`Configured start URL`:r||(a===`android`?`Android device`:`iOS device`),$=!!(a===`web`&&Te&&n&&(K===`connected`||K===`executing`)&&!v);(0,W.useEffect)(()=>{Ae||G(Q)},[Q,Ae]);let ot=(0,W.useMemo)(()=>{if(Y){let e=m.find(e=>e.status===`running`);return e?`Running ${e.name}`:null}if(!_)return null;let e=J.find(e=>e.id===_);return e?`Running step ${e.stepOrder+1}`:`Running current step`},[J,_,Y,m]),st=async()=>{Q&&(await navigator.clipboard.writeText(Q),Oe(!0),window.setTimeout(()=>Oe(!1),1500))},ct=()=>{let e=Xe(ke,l);if(!e){G(Q);return}G(e),je(!1),F(e)},lt=!Y&&!!(g&&g.type!==`hook`&&!X);return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card/30`,children:[(0,q.jsxs)(`div`,{className:`border-b px-4 py-3`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:n||`Live Session`}),(0,q.jsx)(z,{variant:`outline`,className:`text-[10px] uppercase tracking-wide`,children:Me.label}),(e===`connected`||e===`executing`)&&typeof xe==`number`&&(0,q.jsxs)(z,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,xe]}),ot&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ot})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[a===`web`?(0,q.jsx)(oe,{className:`size-3.5 shrink-0`}):(0,q.jsx)(h,{className:`size-3.5 shrink-0`}),(0,q.jsx)(`span`,{className:`truncate`,title:Q,children:Q})]}),ne&&!v&&(0,q.jsx)(`div`,{className:`min-w-0 max-w-2xl text-xs text-destructive [overflow-wrap:anywhere]`,children:ne})]}),!v&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,q.jsx)(z,{variant:`outline`,className:M(`text-[10px]`,at.className),children:at.label}),le&&(0,q.jsx)(z,{className:`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`,children:`Restart required`}),Ne&&(S?(0,q.jsxs)(A,{variant:`outline`,size:`sm`,onClick:D,disabled:C,children:[C?(0,q.jsx)(P,{className:`size-3.5 animate-spin`}):(0,q.jsx)(ce,{className:`size-3.5`}),C?`Stopping...`:R??`Stop All Steps`]}):(0,q.jsxs)(A,{variant:`outline`,size:`sm`,onClick:E,disabled:!x,children:[(0,q.jsx)(b,{className:`size-3.5`}),ye??`Run All Steps`]})),O&&(0,q.jsxs)(A,{variant:`destructive`,size:`sm`,onClick:pe,children:[(0,q.jsx)(ce,{className:`size-3.5`}),`End Live Session`]})]})]}),le&&!v&&(0,q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-start justify-between gap-3 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[(0,q.jsx)(j,{className:`mt-0.5 size-4 shrink-0`}),(0,q.jsx)(`span`,{children:`Hook order or names changed after this live session started. Continue using the current disposable session, or restart to apply the latest setup and teardown hooks.`})]}),me&&(0,q.jsx)(A,{type:`button`,size:`sm`,className:`shrink-0`,onClick:me,children:`Restart Live Session`})]}),!v&&(a===`web`?(0,q.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,onClick:ge,disabled:K===`executing`||K===`idle`,"aria-label":`Go back`,children:(0,q.jsx)(be,{className:`size-3.5`})}),(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,onClick:ve,disabled:K===`executing`||K===`idle`,"aria-label":`Go forward`,children:(0,q.jsx)(_e,{className:`size-3.5`})}),(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,onClick:N,disabled:K===`executing`||K===`idle`,"aria-label":`Refresh page`,children:(0,q.jsx)(se,{className:`size-3.5`})})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 rounded-full border bg-background px-3 py-2`,children:[u?(0,q.jsx)(P,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`}):(0,q.jsx)(oe,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,q.jsx)(`input`,{value:ke,title:Q,onFocus:()=>je(!0),onBlur:()=>{je(!1),G(Q)},onChange:e=>G(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ct()),e.key===`Escape`&&(e.preventDefault(),je(!1),G(Q))},disabled:K===`executing`||K===`idle`,className:M(`min-w-0 flex-1 bg-transparent text-sm outline-none`,Ae?`text-left`:`text-center`)})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-1`,children:[$&&Te&&(0,q.jsx)(qe,{capture:Te,disabled:K===`executing`}),(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,onClick:st,disabled:!Q,"aria-label":De?`URL copied`:`Copy URL`,title:De?`URL copied`:`Copy URL`,children:De?(0,q.jsx)(ee,{className:`size-3.5`}):(0,q.jsx)(re,{className:`size-3.5`})})]})]}):(0,q.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:O&&(0,q.jsxs)(A,{variant:`destructive`,size:`sm`,onClick:pe,children:[(0,q.jsx)(ce,{className:`size-3.5`}),`End Live Session`]})}))]}),L===`test`&&Se,(0,q.jsxs)(H,{orientation:`vertical`,className:`min-h-0 flex-1`,children:[(0,q.jsx)(V,{defaultSize:62,minSize:32,children:v?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 py-8`,children:(0,q.jsxs)(`div`,{className:`flex max-w-lg flex-col items-center gap-4 rounded-lg border bg-background/80 px-6 py-8 text-center`,children:[(0,q.jsx)(`div`,{className:`rounded-full bg-muted p-3`,children:(0,q.jsx)(Ee,{className:`size-6 text-muted-foreground`})}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold`,children:v.title}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v.description})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[k&&(0,q.jsx)(A,{variant:`outline`,size:`sm`,onClick:k,children:`Close Live Mode`}),he&&(0,q.jsx)(A,{size:`sm`,onClick:he,children:`Start Fresh Session`})]})]})}):K===`idle`?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 py-8`,children:(0,q.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-4 rounded-lg border bg-background/70 px-6 py-8 text-center`,children:[(0,q.jsx)(`div`,{className:`rounded-full bg-muted p-3`,children:(0,q.jsx)(Ee,{className:`size-6 text-muted-foreground`})}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold`,children:`Live mode is target-scoped`}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This workspace runs the current builder draft against the selected target. Sessions are disposable and draft changes only persist when you save the test.`})]})]})}):(0,q.jsx)(We,{screenshot:c,connectionState:K})}),(0,q.jsx)(Ce,{withHandle:!0}),(0,q.jsx)(V,{defaultSize:38,minSize:20,children:(0,q.jsxs)(fe,{value:ie,onValueChange:e=>w(e),className:`flex h-full min-h-0 flex-col`,children:[(0,q.jsxs)(de,{variant:`line`,className:`h-9 justify-start rounded-none border-b px-3`,children:[(0,q.jsx)(ue,{value:`reasoning`,className:`rounded-none text-xs`,children:`Reasoning`}),(0,q.jsx)(ue,{value:`env`,className:`rounded-none text-xs`,children:`Env`}),(0,q.jsx)(ue,{value:`network`,className:`rounded-none text-xs`,children:`Network`}),(0,q.jsx)(ue,{value:`console`,className:`rounded-none text-xs`,children:`Console`}),(0,q.jsx)(ue,{value:`aria`,className:`rounded-none text-xs`,children:`ARIA Tree`})]}),(0,q.jsx)(T,{value:`reasoning`,className:`m-0 flex-1 overflow-hidden`,children:(0,q.jsx)(B,{className:`h-full`,children:Y?Ve?(0,q.jsx)($e,{hook:Ve}):He?(0,q.jsx)($e,{hook:He}):Z?(0,q.jsx)(rt,{test:Z,selectedStep:Ke,subAction:Ze}):(0,q.jsx)(U,{icon:ae,title:`Select a test to inspect it`,description:`Choose a test in the live queue to see its reasoning, logs, hooks, and network activity.`}):ze?(0,q.jsx)($e,{hook:ze}):X?(0,q.jsx)(Ue,{step:X,subAction:Le}):lt?(0,q.jsx)(U,{icon:ae,title:`Selection is no longer available`,description:`Pick another step in the builder to inspect its reasoning.`}):(0,q.jsx)(U,{icon:ae,title:`No reasoning yet`,description:`Run a step from the builder or use Run All Steps to populate the live reasoning trace.`})})}),(0,q.jsx)(T,{value:`env`,className:`m-0 flex-1 overflow-hidden`,children:Y?Ve?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(Qe,{hook:Ve})}):He?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(Qe,{hook:He})}):Ge?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(o,{step:Ge,executionLogs:nt})}):Z?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test-owned hook or run a step to inspect variables and runJS output`}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test to inspect it`}):ze?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(Qe,{hook:ze})}):Re?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(o,{step:Re,executionLogs:it})}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a step to inspect variables and runJS output`})}),(0,q.jsx)(T,{value:`network`,className:`m-0 flex-1 overflow-hidden`,children:Y?Ve||He?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-sm text-muted-foreground`,children:`Hooks do not capture browser network activity. Select a test step to inspect requests.`}):Ge?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(i,{step:Ke,allSteps:tt,platform:a})}):Z?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Run this test to inspect its network activity`}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test to inspect it`}):ze?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-sm text-muted-foreground`,children:`Hooks do not capture browser network activity. Select a step to inspect requests.`}):X?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(i,{step:X,allSteps:J,platform:a})}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a step to inspect network activity`})}),(0,q.jsx)(T,{value:`console`,className:`m-0 flex-1 overflow-hidden`,children:Y?Ve?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)($e,{hook:Ve})}):He?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)($e,{hook:He})}):Ge?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(s,{step:Ke,allSteps:tt,executionLogs:nt,isHookStep:nt.length>0})}):Z?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Run this test to inspect console output`}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test to inspect it`}):ze?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)($e,{hook:ze})}):X?(0,q.jsx)(B,{className:`h-full`,children:(0,q.jsx)(s,{step:X,allSteps:J,executionLogs:it,isHookStep:it.length>0})}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a step to inspect console output`})}),(0,q.jsx)(T,{value:`aria`,className:`m-0 flex-1 overflow-hidden`,children:(0,q.jsx)(Be,{ariaTree:te,onRefresh:I,isExecuting:K===`executing`})})]})})]})]})}function at(){return typeof window<`u`&&window.localStorage!==void 0}function Q(){if(!at())return!1;try{return window.localStorage.getItem(`agent-qa:live-debug`)===`1`}catch{return!1}}function $(e,t,n){if(!Q())return;let r=`[agent-qa live:${e}] ${t}`;if(n){console.info(r,n);return}console.info(r)}function ot(e,t){let n=typeof e==`string`?{instruction:e}:e;return{id:t?.id??n.draftId??crypto.randomUUID(),draftId:n.draftId??t?.draftId??null,instruction:n.instruction,status:t?.status??`idle`,duration:t?.duration,error:t?.error,phases:t?.phases??[],executionHistory:t?.executionHistory??[],capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??[],networkLogs:t?.networkLogs??[],variableSnapshot:t?.variableSnapshot??null,originalStepName:t?.originalStepName??null,subActionsData:t?.subActionsData??null,executionLogs:t?.executionLogs??[],executionGeneration:t?.executionGeneration??0}}function st(e,t){return{id:e.hookId,executionId:t?.executionId??null,name:e.name??t?.name??e.hookId,phase:e.phase,status:t?.status??`pending`,duration:t?.duration,stdout:t?.stdout??null,stderr:t?.stderr??null,variables:t?.variables??null,error:t?.error,createdAt:t?.createdAt}}function ct(e,t){return{...ot({draftId:t?.draftId,instruction:e.instruction},t),id:t?.id??crypto.randomUUID(),stepIndex:e.stepIndex}}function lt(e,t){let n=e.findIndex(e=>e.id===t.id);return n===-1?[...e,t]:e.map((e,r)=>r===n?{...e,...t}:e)}function ut(e,t,n){let r=e.find(e=>e.stepIndex===t.stepIndex),i={...ct(t,r),...n};return[...r?e.map(e=>e.stepIndex===t.stepIndex?i:e):[...e,i]].sort((e,t)=>e.stepIndex-t.stepIndex)}function dt(e,t){let n=t.map(e=>({draftId:e.draftId,instruction:e.instruction}));if(e.length===n.length&&e.every((e,t)=>e.instruction===n[t].instruction&&e.draftId===n[t].draftId))return e;let r=new Map(e.filter(e=>!!e.draftId).map(e=>[e.draftId,e]));return n.map((t,n)=>ot(t,t.draftId?r.get(t.draftId):e[n]))}function ft(e,t,n){if(e.length===t.length&&e.every((e,r)=>e.id===t[r]&&e.phase===n))return e;let r=new Map(e.map(e=>[e.id,e]));return t.map(e=>st({hookId:e,phase:n},r.get(e)))}function pt(e,t,n){return{id:n?.id??`${e.testId}:${e.path}:${t}`,draftId:e.draftId??n?.draftId??null,testId:e.testId,path:e.path,name:e.name,status:n?.status??`idle`,duration:n?.duration,error:n?.error,testExecutionId:n?.testExecutionId??null,liveSteps:n?.liveSteps??[],runningStepIndex:n?.runningStepIndex??null,perTestSetupHooks:n?.perTestSetupHooks??[],perTestTeardownHooks:n?.perTestTeardownHooks??[],lastRunAt:n?.lastRunAt}}function mt(e,t){let n=e.findIndex(e=>e.testExecutionId===t.testExecutionId);if(n!==-1)return n;let r=e.findIndex(e=>e.testId===t.testId&&e.name===t.testName);return r===-1?t.testIndex>=0&&t.testIndex<e.length?t.testIndex:-1:r}function ht(e,t,n){let r=mt(e,t);return r===-1?e:e.map((e,t)=>t===r?n(e):e)}function gt(e){return e.scope===`test`}function _t(e,t={}){let n=t.steps,r=t.tests,i=t.setupHooks??[],a=t.teardownHooks??[],o=t.allowReconnect??!n,[s,c]=(0,W.useState)(`idle`),[l,u]=(0,W.useState)([]),[d,f]=(0,W.useState)(()=>ft([],i,`setup`)),[p,m]=(0,W.useState)(()=>ft([],a,`teardown`)),[ee,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),[te,b]=(0,W.useState)(null),[ne,re]=(0,W.useState)(null),[ie,ae]=(0,W.useState)([]),[oe,se]=(0,W.useState)(`web`),[ce,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(!1),[le,w]=(0,W.useState)(!1),[ue,T]=(0,W.useState)([]),[de,fe]=(0,W.useState)(null),[E,D]=(0,W.useState)(!1),[pe,me]=(0,W.useState)(!1),O=(0,W.useRef)(null),k=(0,W.useRef)(0),A=(0,W.useRef)(null),he=(0,W.useRef)(null),ge=(0,W.useRef)(`idle`),_e=(0,W.useRef)([]),j=(0,W.useRef)(null),ve=(0,W.useRef)(!1),M=(0,W.useRef)(null),N=(0,W.useRef)(null),P=(0,W.useRef)(!1),F=(0,W.useRef)(0),I=(0,W.useRef)(`web`),L=(0,W.useRef)(null),ye=(0,W.useRef)(!!n),R=(0,W.useRef)(null),be=(0,W.useRef)([]),xe=(0,W.useRef)(null),Se=(0,W.useRef)(!1),z=(0,W.useRef)(null);ge.current=s,_e.current=l,j.current=ne,I.current=oe,ye.current=!!n,be.current=ue,xe.current=de;let B=(0,W.useCallback)(()=>{he.current&&=(clearInterval(he.current),null)},[]),V=(0,W.useCallback)(e=>{let t=O.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]),H=(0,W.useCallback)(e=>{B(),he.current=setInterval(()=>{document.hidden||V({type:`get-screenshot`})},e)},[B,V]),Ce=(0,W.useCallback)(()=>new Promise(e=>{N.current=e,setTimeout(()=>{N.current===e&&(N.current=null,e())},5e3)}),[]),U=(0,W.useCallback)(()=>{let e=L.current;e&&(L.current=null,u(t=>dt(t,e)))},[]),we=(0,W.useCallback)(e=>{O.current&&=($(`hook`,`closing previous websocket before reconnect`,{sessionId:e}),O.current.close(),null),c(`connecting`),ve.current=!1,$(`hook`,`connecting websocket`,{sessionId:e});let t=`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}/api/live-editor/ws?sessionId=${e}`,n=new WebSocket(t);O.current=n,n.onopen=()=>{k.current=0,$(`hook`,`websocket opened`,{sessionId:e})},n.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case`session-ready`:{let t=n.platform??`web`;se(t),I.current=t;let r=n.interactive!==!1;c(r?`connected`:`error`),b(n.error??null),$(`hook`,`session ready`,{sessionId:e,platform:t,interactive:r}),r&&H(t===`web`?1e3:2e3);break}case`hook-start`:{let e=n.hook,t={id:e.hookId,executionId:e.executionId,name:e.hookName,phase:e.phase,status:`running`,duration:void 0,stdout:null,stderr:null,variables:null,error:void 0,createdAt:e.createdAt};if(e.owner.scope===`suite`)(e.phase===`setup`?f:m)(e=>lt(e,t)),R.current&&R.current.phase===e.phase&&R.current.hookId===e.hookId&&(R.current={...R.current,executionId:e.executionId});else if(gt(e.owner)){let n=e.owner;T(r=>ht(r,n,n=>({...n,perTestSetupHooks:e.phase===`setup`?lt(n.perTestSetupHooks,t):n.perTestSetupHooks,perTestTeardownHooks:e.phase===`teardown`?lt(n.perTestTeardownHooks,t):n.perTestTeardownHooks})))}break}case`hook-complete`:{let e=n.hook,t={id:e.hookId,executionId:e.executionId,name:e.hookName,phase:e.phase,status:e.status,duration:e.duration,stdout:e.stdout??null,stderr:e.stderr??null,variables:e.variables??null,error:e.error,createdAt:e.createdAt};if(e.owner.scope===`suite`)(t.phase===`setup`?f:m)(e=>lt(e,t)),R.current&&R.current.phase===t.phase&&R.current.hookId===t.id&&(!R.current.executionId||R.current.executionId===t.executionId)&&(R.current=null,c(`connected`),H(I.current===`web`?1e3:2e3),U());else if(gt(e.owner)){let n=e.owner;T(e=>ht(e,n,e=>({...e,perTestSetupHooks:t.phase===`setup`?lt(e.perTestSetupHooks,t):e.perTestSetupHooks,perTestTeardownHooks:t.phase===`teardown`?lt(e.perTestTeardownHooks,t):e.perTestTeardownHooks})))}break}case`step-phase`:u(e=>e.map((e,t)=>t===j.current&&e.status===`running`&&e.executionGeneration===F.current?{...e,phases:[...e.phases,{phase:n.phase,text:n.data?.text,confidence:n.data?.confidence,action:n.data?.action,success:n.data?.success,duration:n.data?.duration,timestamp:new Date().toISOString()}]}:e));break;case`step-complete`:{let t=n.result,r=j.current,i=t?.status===`passed`?`passed`:`failed`;u(e=>e.map((e,n)=>n===r&&e.status===`running`?{...e,status:i,duration:t?.duration,error:t?.error,capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??[],networkLogs:t?.networkLogs??[],variableSnapshot:t?.variableSnapshot??null,originalStepName:t?.originalStepName??null,subActionsData:t?.subActionsData??null,executionLogs:t?.executionLogs??[]}:e)),re(null),c(`connected`),$(`hook`,`step completed`,{sessionId:e,stepIndex:r??void 0,status:i}),H(I.current===`web`?1e3:2e3),M.current?.({status:i}),M.current=null,N.current?.(),N.current=null,U();break}case`test-start`:{let e=n.test;xe.current=e.testIndex,fe(e.testIndex),T(t=>ht(t,e,t=>({...t,status:`running`,duration:void 0,error:void 0,testExecutionId:e.testExecutionId,runningStepIndex:null,liveSteps:[],perTestSetupHooks:[],perTestTeardownHooks:[]})));break}case`test-step-start`:{let e=n.step;T(t=>ht(t,e,t=>({...t,status:`running`,testExecutionId:e.testExecutionId,runningStepIndex:e.stepIndex,liveSteps:ut(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`running`,duration:void 0,error:void 0,phases:[],consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,subActionsData:null,executionLogs:[]})})));break}case`test-step-phase`:{let e=n.step;T(t=>ht(t,e,t=>({...t,liveSteps:ut(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`running`,phases:[...t.liveSteps.find(t=>t.stepIndex===e.stepIndex)?.phases??[],{phase:n.phase,text:n.data?.text,confidence:n.data?.confidence,action:n.data?.action,success:n.data?.success,duration:n.data?.duration,timestamp:new Date().toISOString()}]})})));break}case`test-step-complete`:{let e=n.step,t=n.result;T(n=>ht(n,e,n=>({...n,runningStepIndex:n.runningStepIndex===e.stepIndex?null:n.runningStepIndex,liveSteps:ut(n.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:t?.status??`failed`,duration:t?.duration,error:t?.error,capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??[],networkLogs:t?.networkLogs??[],variableSnapshot:t?.variableSnapshot??null,originalStepName:t?.originalStepName??null,subActionsData:t?.subActionsData??null,executionLogs:t?.executionLogs??[]})})));break}case`test-step-cancelled`:{let e=n.step;T(t=>ht(t,e,t=>({...t,runningStepIndex:t.runningStepIndex===e.stepIndex?null:t.runningStepIndex,liveSteps:ut(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`cancelled`})})));break}case`test-step-error`:{let e=n.step;T(t=>ht(t,e,t=>({...t,runningStepIndex:t.runningStepIndex===e.stepIndex?null:t.runningStepIndex,liveSteps:ut(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`failed`,error:n.error})})));break}case`test-complete`:{let e=n.test,t=n.result,r=t?.status??`failed`,i=t?.error;if(!i&&r===`failed`&&Array.isArray(t?.stepResults)){let e=t.stepResults.find(e=>e?.status===`failed`);e?.error&&(i=`Step ${t.stepResults.indexOf(e)+1} failed: ${e.error}`)}T(n=>ht(n,e,n=>({...n,status:r,duration:t?.duration,error:i,testExecutionId:e.testExecutionId,runningStepIndex:null,lastRunAt:new Date().toISOString(),liveSteps:Array.isArray(t?.stepResults)?t.stepResults.reduce((e,t,r)=>{let i=n.liveSteps.find(e=>e.stepIndex===r);return i?ut(e,{stepIndex:r,instruction:i.instruction},{status:t?.status??i.status,duration:t?.duration,error:t?.error,capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??i.consoleLogs,networkLogs:t?.networkLogs??i.networkLogs,variableSnapshot:t?.variableSnapshot??i.variableSnapshot,originalStepName:t?.originalStepName??i.originalStepName,subActionsData:t?.subActionsData??i.subActionsData,executionLogs:t?.executionLogs??i.executionLogs}):e},n.liveSteps):n.liveSteps,perTestSetupHooks:Array.isArray(t?.setupHookExecutions)?t.setupHookExecutions.map(e=>({id:e.hookId,executionId:e.executionId??null,name:e.hookName,phase:e.phase,status:e.status,duration:e.duration,stdout:e.stdout??null,stderr:e.stderr??null,variables:e.variables??null,error:e.error,createdAt:e.createdAt})):n.perTestSetupHooks,perTestTeardownHooks:Array.isArray(t?.teardownHookExecutions)?t.teardownHookExecutions.map(e=>({id:e.hookId,executionId:e.executionId??null,name:e.hookName,phase:e.phase,status:e.status,duration:e.duration,stdout:e.stdout??null,stderr:e.stderr??null,variables:e.variables??null,error:e.error,createdAt:e.createdAt})):n.perTestTeardownHooks}))),xe.current=null,fe(null),c(`connected`),H(I.current===`web`?1e3:2e3);let a=z.current;z.current=null,a?.({status:r});break}case`test-error`:{let e=n.test;T(t=>ht(t,e,t=>({...t,status:`failed`,error:n.error,testExecutionId:e.testExecutionId,runningStepIndex:null,lastRunAt:new Date().toISOString()}))),xe.current=null,fe(null),c(`connected`),H(I.current===`web`?1e3:2e3);let t=z.current;z.current=null,t?.({status:`failed`});break}case`step-error`:$(`hook`,`step failed`,{sessionId:e,stepIndex:j.current??void 0,error:n.error}),u(e=>e.map((e,t)=>t===j.current?e.status===`cancelling`?{...e,status:`cancelled`}:e.status===`running`?{...e,status:`failed`,error:n.error}:e:e)),re(null),c(`connected`),H(I.current===`web`?1e3:2e3),M.current?.({status:`failed`}),M.current=null,N.current?.(),N.current=null,U();break;case`step-cancelled`:u(e=>e.map((e,t)=>t===j.current&&(e.status===`running`||e.status===`cancelling`)?{...e,status:`cancelled`}:e)),re(null),c(`connected`),$(`hook`,`step cancelled`,{sessionId:e,stepIndex:j.current??void 0}),H(I.current===`web`?1e3:2e3),M.current?.({status:`cancelled`}),M.current=null,N.current?.(),N.current=null,U();break;case`step-busy`:y(null),R.current&&(R.current=null,c(`connected`),H(I.current===`web`?1e3:2e3)),b(`Step already in progress: ${n.currentStep}`);break;case`screenshot`:h(`data:image/jpeg;base64,${n.data}`);break;case`navigate-complete`:_(n.url??null),y(null);break;case`session-state`:n.state&&`currentUrl`in n.state&&_(n.state.currentUrl??null),n.state?.interactive===!1&&(c(`error`),b(n.state.terminalError??`Live session is not ready`));break;case`device-logs`:ae(e=>[...e,...n.entries]);break;case`aria-tree`:x(n.tree);break;case`session-terminated`:c(`disconnected`),y(null),R.current=null,B(),U(),$(`hook`,`session terminated by server`,{sessionId:e});break;case`error`:y(null),R.current&&(R.current=null,c(`connected`),H(I.current===`web`?1e3:2e3),U()),b(n.message),$(`hook`,`server reported error`,{sessionId:e,message:n.message});break}},n.onclose=()=>{if(O.current=null,B(),ve.current){$(`hook`,`websocket closed after local termination`,{sessionId:e});return}if($(`hook`,`websocket closed unexpectedly`,{sessionId:e,allowReconnect:o,reconnectCount:k.current}),c(`disconnected`),y(null),R.current=null,u(e=>e.map(e=>e.status===`running`||e.status===`cancelling`?{...e,status:`cancelled`}:e)),j.current=null,re(null),M.current?.({status:`cancelled`}),M.current=null,N.current?.(),N.current=null,U(),o&&k.current<3){let t=2**k.current*1e3;k.current++,$(`hook`,`scheduling reconnect`,{sessionId:e,delay:t,reconnectCount:k.current}),A.current=setTimeout(()=>we(e),t)}},n.onerror=()=>{$(`hook`,`websocket error event`,{sessionId:e})}},[o,U,B,H]);(0,W.useEffect)(()=>{if(n){if(ge.current===`executing`){L.current=n,$(`hook`,`queued external step sync while executing`,{stepCount:n.length});return}L.current=null,$(`hook`,`syncing external steps`,{stepCount:n.length}),u(e=>dt(e,n))}},[n]),(0,W.useEffect)(()=>{f(e=>ft(e,i,`setup`))},[i]),(0,W.useEffect)(()=>{m(e=>ft(e,a,`teardown`))},[a]),(0,W.useEffect)(()=>{r&&T(e=>{let t=new Map(e.map(e=>[`${e.testId}::${e.path}`,e]));return r.map((e,n)=>pt(e,n,t.get(`${e.testId}::${e.path}`)))})},[r]),(0,W.useEffect)(()=>{if(!e){c(`idle`),u(n?dt([],n):[]),f(ft([],i,`setup`)),m(ft([],a,`teardown`)),h(null),_(null),y(null),b(null),R.current=null,ae([]),se(`web`),x(null),C(!1),w(!1),T(r?.map((e,t)=>pt(e,t))??[]),fe(null),D(!1),me(!1);return}return we(e),()=>{B(),A.current&&=(clearTimeout(A.current),null),O.current&&=($(`hook`,`cleaning up websocket for session effect`,{sessionId:e}),O.current.close(),null)}},[B,we,e]),(0,W.useEffect)(()=>{s===`executing`?H(oe===`web`?500:1e3):s===`connected`?H(oe===`web`?1e3:2e3):B()},[s,oe,H,B]),(0,W.useEffect)(()=>{let e=()=>{if(document.hidden)B();else{let e=ge.current,t=I.current;e===`executing`?H(t===`web`?500:1e3):e===`connected`&&H(t===`web`?1e3:2e3)}};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[B,H]);let Te=(0,W.useCallback)(e=>{if(ye.current)return;let t=_e.current.length;u(t=>[...t,{id:crypto.randomUUID(),draftId:null,instruction:e,status:`running`,phases:[],executionHistory:[],consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,subActionsData:null,executionLogs:[],executionGeneration:0}]),re(t),c(`executing`),b(null),V({type:`execute-step`,stepInstruction:e,stepIndex:t})},[V]),Ee=(0,W.useCallback)(async(t,n)=>{let r=_e.current[t];if(!r||!r.instruction.trim())return;if(j.current!==null){let e=j.current;P.current=!0,u(t=>t.map((t,n)=>n===e&&t.status===`running`?{...t,status:`cancelling`}:t)),V({type:`cancel-step`}),await Ce()}F.current++;let i=F.current;j.current=t,re(t),u(e=>e.map((e,n)=>n===t?{...e,status:`running`,phases:[],executionHistory:e.phases.length>0?[...e.executionHistory,{phases:e.phases,status:e.status,duration:e.duration,error:e.error,timestamp:new Date().toISOString()}]:e.executionHistory,error:void 0,duration:void 0,consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,subActionsData:null,executionLogs:[],executionGeneration:i}:e)),c(`executing`),b(null),$(`hook`,`executing step`,{sessionId:e,stepIndex:t,instruction:r.instruction,testName:n?.testName}),V({type:`execute-step`,stepInstruction:r.instruction,stepIndex:t,draft:n})},[V,e,Ce]),De=(0,W.useCallback)(async(t,n)=>{if(ge.current!==`connected`){b(`Live session is busy or not ready`);return}R.current={phase:t,hookId:n},(t===`setup`?f:m)(e=>e.map(e=>e.id===n?{...e,status:`running`,duration:void 0,stdout:null,stderr:null,variables:null,error:void 0}:e)),c(`executing`),b(null),$(`hook`,`executing hook`,{sessionId:e,phase:t,hookId:n}),V({type:`execute-hook`,phase:t,hookId:n})},[V,e]),Oe=(0,W.useCallback)(()=>{ye.current||u(e=>[...e,ot(``)])},[]),ke=(0,W.useCallback)(e=>{ye.current||u(t=>t.filter((t,n)=>n!==e))},[]),G=(0,W.useCallback)((e,t)=>{ye.current||u(n=>n.map((n,r)=>r===e?{...n,instruction:t}:n))},[]),Ae=(0,W.useCallback)((e,t)=>{if(ye.current)return;u(n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r});let n=j.current;if(n!==null){let r=n;n===e?r=t:e<n&&t>=n?r=n-1:e>n&&t<=n&&(r=n+1),r!==n&&(j.current=r,re(r))}},[]),je=(0,W.useCallback)(()=>{S&&(P.current=!0,w(!0)),u(e=>e.map((e,t)=>t===j.current&&e.status===`running`?{...e,status:`cancelling`}:e)),$(`hook`,`cancelling active step`,{sessionId:e}),V({type:`cancel-step`})},[S,V,e]),K=(0,W.useCallback)(()=>{V({type:`get-screenshot`})},[V]),q=(0,W.useCallback)(()=>{y({action:`refresh`}),V({type:`refresh-page`})},[V]),Me=(0,W.useCallback)(()=>{y({action:`back`}),V({type:`go-back`})},[V]),J=(0,W.useCallback)(()=>{y({action:`forward`}),V({type:`go-forward`})},[V]),Y=(0,W.useCallback)(()=>{V({type:`get-aria-tree`})},[V]),Ne=(0,W.useCallback)(e=>{y({action:`navigate`,targetUrl:e}),V({type:`navigate`,url:e})},[V]),Pe=(0,W.useCallback)((e,t)=>new Promise(n=>{M.current=n;let r=_e.current[e];if(!r||!r.instruction.trim()){M.current=null,n({status:`skipped`});return}F.current++;let i=F.current;j.current=e,re(e),u(t=>t.map((t,n)=>n===e?{...t,status:`running`,phases:[],executionHistory:t.phases.length>0?[...t.executionHistory,{phases:t.phases,status:t.status,duration:t.duration,error:t.error,timestamp:new Date().toISOString()}]:t.executionHistory,error:void 0,duration:void 0,consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,subActionsData:null,executionLogs:[],executionGeneration:i}:t)),c(`executing`),b(null),V({type:`execute-step`,stepInstruction:r.instruction,stepIndex:e,draft:t})}),[V]),Fe=(0,W.useCallback)(async t=>{if(S)return;P.current=!1;let n=_e.current.length;C(!0),w(!1),$(`hook`,`running all steps`,{sessionId:e,stepCount:n});try{for(let e=0;e<n&&!P.current;e++){if(!_e.current[e].instruction.trim())continue;let n=await Pe(e,t);if(n.status===`failed`||n.status===`cancelled`)break}}finally{P.current=!1,C(!1),w(!1)}},[Pe,S,e]),Ie=(0,W.useCallback)(()=>{S&&(P.current=!0,w(!0),u(e=>e.map((e,t)=>t===j.current&&e.status===`running`?{...e,status:`cancelling`}:e)),j.current!==null&&V({type:`cancel-step`}))},[S,V]),X=(0,W.useCallback)((e,t)=>new Promise(n=>{z.current=n;let r=be.current[e];if(!r){z.current=null,n({status:`skipped`});return}let i=crypto.randomUUID();xe.current=e,fe(e),T(t=>t.map((t,n)=>n===e?{...t,status:`running`,duration:void 0,error:void 0,testExecutionId:i,runningStepIndex:null,liveSteps:[],perTestSetupHooks:[],perTestTeardownHooks:[]}:t)),c(`executing`),b(null),V({type:`execute-test`,testExecutionId:i,testId:r.testId,path:r.path,testIndex:e,draft:t})}),[V]),Le=(0,W.useCallback)(async(e,t)=>{be.current[e]&&await X(e,t)},[X]),Re=(0,W.useCallback)(async e=>{if(E)return;Se.current=!1;let t=be.current.length;D(!0),me(!1);try{for(let n=0;n<t&&!Se.current;n++){let t=await X(n,e);if(t.status===`failed`||t.status===`cancelled`)break}}finally{Se.current=!1,D(!1),me(!1)}},[X,E]),ze=(0,W.useCallback)(()=>{E&&(Se.current=!0,me(!0),xe.current!==null&&V({type:`cancel-step`}))},[E,V]);return{connectionState:s,steps:l,setupHooks:d,teardownHooks:p,screenshot:ee,currentUrl:g,pendingNavigation:v,error:te,executeStep:Te,executeStepByIndex:Ee,executeHookById:De,cancelStep:je,requestScreenshot:K,refreshPage:q,goBack:Me,goForward:J,navigate:Ne,runAll:Fe,cancelRunAll:Ie,terminateSession:(0,W.useCallback)(()=>{P.current=!0,C(!1),w(!1),ve.current=!0,$(`hook`,`terminating session`,{sessionId:e}),V({type:`terminate-session`})},[V,e]),addStep:Oe,removeStep:ke,updateStepInstruction:G,reorderSteps:Ae,runningStepIndex:ne,runningStepId:ne===null?null:l[ne]?.id??null,sessionId:e,isTerminated:ve.current,deviceLogs:ie,platform:oe,ariaTree:ce,requestAriaTree:Y,isRunningAll:S,isStoppingRunAll:le,tests:ue,executeTestByIndex:Le,runAllTests:Re,cancelRunAllTests:ze,runningTestIndex:de,isRunningAllTests:E,isStoppingRunAllTests:pe}}var vt=/^[a-z][a-z0-9-]*[a-z0-9]$/,yt=new Set([`name`,`load`,`capture`]);function bt(e){try{let t=v(e);if(t.errors.length>0)return{};let n=t.toJSON(),r=n?.use?.mobile?.appState;return{headless:n?.use?.browser?.headless,device:typeof n?.use?.device==`string`?n.use.device:void 0,appState:r===`preserve`||r===`reset`?r:void 0}}catch{return{}}}function xt(e){try{let t=v(e);if(t.errors.length>0)return null;let n=t.toJSON()?.use?.authState,r=typeof n==`string`?n.trim():n&&typeof n==`object`&&!Array.isArray(n)&&Object.keys(n).every(e=>yt.has(e))&&(n.load===void 0||typeof n.load==`boolean`)&&(n.capture===void 0||typeof n.capture==`boolean`)&&typeof n.name==`string`?n.name.trim():``;return r&&vt.test(r)?r:null}catch{return null}}function St(e){let t=e.targets[e.targetName];if(!t)throw Error(`Selected target "${e.targetName}" was not found in workspace config`);let n=bt(e.content),r=n.headless??e.globalUse?.browser?.headless;if(t.platform===`web`){if(!t.url)throw Error(`Selected web target "${e.targetName}" is missing a URL`);return{platform:`web`,targetName:e.targetName,url:t.url,headless:r}}return{platform:t.platform,targetName:e.targetName,useDeviceName:n.device,appState:n.appState??e.globalUse?.mobile?.appState,bundleId:t.bundleId,appPackage:t.appPackage,appActivity:t.appActivity,headless:r}}var Ct=[{namespace:`runJS`,name:`document.title`,label:`Page title`},{namespace:`runJS`,name:`Date.now()`,label:`Current timestamp`},{namespace:`runJS`,name:`window.location.href`,label:`Current URL`},{namespace:`runJS`,name:`document.querySelector('...').textContent`,label:`Extract element text`}];function wt(e){let[t,n]=(0,W.useState)([]),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)([]),[s,c]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let t=!1;c(!0);let r=[pe().then(e=>{t||n(e.keys)}).catch(()=>{t||n([])}),ve().then(e=>{t||i(e.hooks.map(e=>({id:e.id,name:e.name})))}).catch(()=>{t||i([])})];return e&&r.push(xe(e).then(e=>{t||o(e.names)}).catch(()=>{t||o([])})),Promise.allSettled(r).then(()=>{t||c(!1)}),()=>{t=!0}},[e]),{suggestions:(0,W.useMemo)(()=>{let e=[];for(let n of t)e.push({namespace:`env`,name:n,label:`env`});for(let t of r)e.push({namespace:`runHook`,name:t.name,label:`hook`,insertValue:t.id,description:t.id});for(let t of a)e.push({namespace:`capture`,name:t,label:`captured`});return e.push(...Ct),e},[t,r,a]),isLoading:s}}var Tt=/^[a-zA-Z0-9._-]+$/,Et=/\.(yaml|yml)$/;function Dt(e){return e.trim().replace(/\\/g,`/`).replace(/^\.\//,``)}function Ot(e){let t=Dt(e).replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\?/g,`.`).replace(/\*\*\//g,`__DIRSTAR__`).replace(/\*\*/g,`__DIRSTAR__`).replace(/\*/g,`[^/]*`).replace(/__DIRSTAR__/g,`(?:.*/)?`);return RegExp(`^${t}$`)}function kt(e,t){let n=Dt(e);return t.some(e=>Ot(e).test(n))}function At(e){let t=e.trim();if(!t)return`Filename is required`;if(t.includes(`..`))return`Path must not contain '..' segments`;if(t.startsWith(`/`))return`Path must be relative, not absolute`;let n=t.split(`/`);for(let e of n){if(!e)return`Path contains empty segment (double slash)`;if(!Tt.test(e))return`Path must contain only letters, numbers, hyphens, dots, underscores, and forward slashes, ending with .yaml or .yml`}let r=n[n.length-1];return Et.test(r)?null:`File must end with .yaml or .yml`}function jt(e,t,n){let r=At(e);if(r)return r;let i=(t??[]).map(e=>e.trim()).filter(Boolean);return i.length===0?`workspace.${n} must contain at least one pattern`:kt(e.trim(),i)?null:`File path must match one of your workspace's ${n} patterns (${i.join(`, `)})`}export{_t as a,Z as c,xt as i,ze as l,wt as n,$ as o,St as r,it as s,jt as t};
@@ -1,3 +1,3 @@
1
- import{u as e}from"./editor.api2-DEGvZ9jW.js";var t=[`assign`,`flush`,`ftl`,`return`,`global`,`import`,`include`,`break`,`continue`,`local`,`nested`,`nt`,`setting`,`stop`,`t`,`lt`,`rt`,`fallback`],n=[`attempt`,`autoesc`,`autoEsc`,`compress`,`comment`,`escape`,`noescape`,`function`,`if`,`list`,`items`,`sep`,`macro`,`noparse`,`noParse`,`noautoesc`,`noAutoEsc`,`outputformat`,`switch`,`visit`,`recurse`],r={close:`>`,id:`angle`,open:`<`},i={close:`\\]`,id:`bracket`,open:`\\[`},a={close:`[>\\]]`,id:`auto`,open:`[<\\[]`},o={close:`\\}`,id:`dollar`,open1:`\\$`,open2:`\\{`},s={close:`\\]`,id:`bracket`,open1:`\\[`,open2:`=`};function c(r){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],comments:{blockComment:[`${r.open}--`,`--${r.close}`]},autoCloseBefore:`
1
+ import{u as e}from"./editor.api2-CX0IWJmc.js";var t=[`assign`,`flush`,`ftl`,`return`,`global`,`import`,`include`,`break`,`continue`,`local`,`nested`,`nt`,`setting`,`stop`,`t`,`lt`,`rt`,`fallback`],n=[`attempt`,`autoesc`,`autoEsc`,`compress`,`comment`,`escape`,`noescape`,`function`,`if`,`list`,`items`,`sep`,`macro`,`noparse`,`noParse`,`noautoesc`,`noAutoEsc`,`outputformat`,`switch`,`visit`,`recurse`],r={close:`>`,id:`angle`,open:`<`},i={close:`\\]`,id:`bracket`,open:`\\[`},a={close:`[>\\]]`,id:`auto`,open:`[<\\[]`},o={close:`\\}`,id:`dollar`,open1:`\\$`,open2:`\\{`},s={close:`\\]`,id:`bracket`,open1:`\\[`,open2:`=`};function c(r){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],comments:{blockComment:[`${r.open}--`,`--${r.close}`]},autoCloseBefore:`
2
2
  \r }]),.:;=`,autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`]}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`${r.open}#(?:${n.join(`|`)})([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),end:RegExp(`${r.open}/#(?:${n.join(`|`)})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:RegExp(`${r.open}#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),afterText:RegExp(`^${r.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${r.close}$`),action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`${r.open}#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),action:{indentAction:e.IndentAction.Indent}}]}}function l(){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],autoCloseBefore:`
3
3
  \r }]),.:;=`,autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`]}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`[<\\[]#(?:${n.join(`|`)})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:RegExp(`[<\\[]/#(?:${n.join(`|`)})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:RegExp(`[<\\[]#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:RegExp(`^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$`),action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`[<\\[]#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:e.IndentAction.Indent}}]}}function u(e,t){let n=`_${e.id}_${t.id}`,r=e=>e.replace(/__id__/g,n),i=e=>{let t=e.source.replace(/__id__/g,n);return new RegExp(t,e.flags)};return{unicode:!0,includeLF:!1,start:r(`default__id__`),ignoreCase:!1,defaultToken:`invalid`,tokenPostfix:`.freemarker2`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],[r(`open__id__`)]:new RegExp(e.open),[r(`close__id__`)]:new RegExp(e.close),[r(`iOpen1__id__`)]:new RegExp(t.open1),[r(`iOpen2__id__`)]:new RegExp(t.open2),[r(`iClose__id__`)]:new RegExp(t.close),[r(`startTag__id__`)]:i(/(@open__id__)(#)/),[r(`endTag__id__`)]:i(/(@open__id__)(\/#)/),[r(`startOrEndTag__id__`)]:i(/(@open__id__)(\/?#)/),[r(`closeTag1__id__`)]:i(/((?:@blank)*)(@close__id__)/),[r(`closeTag2__id__`)]:i(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:[`false`,`true`,`in`,`as`,`using`],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/&lt;=|&gt;=|\\lte|\\lt|&lt;|\\gte|\\gt|&gt;|&amp;&amp;|\\and|-&gt;|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:[`->`,`-&gt;`],delimiters:[`;`,`:`,`,`,`.`],stringOperators:[`lte`,`lt`,`gte`,`gt`],noParseTags:[`noparse`,`noParse`,`comment`],tokenizer:{[r(`default__id__`)]:[{include:r(`@directive_token__id__`)},{include:r(`@interpolation_and_text_token__id__`)}],[r(`fmExpression__id__.directive`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`fmExpression__id__.interpolation`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@expression_token__id__`)},{include:r(`@greater_operators_token__id__`)}],[r(`inParen__id__.plain`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`inParen__id__.gt`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@expression_token__id__`)},{include:r(`@greater_operators_token__id__`)}],[r(`noSpaceExpression__id__`)]:[{include:r(`@no_space_expression_end_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`unifiedCall__id__`)]:[{include:r(`@unified_call_token__id__`)}],[r(`singleString__id__`)]:[{include:r(`@string_single_token__id__`)}],[r(`doubleString__id__`)]:[{include:r(`@string_double_token__id__`)}],[r(`rawSingleString__id__`)]:[{include:r(`@string_single_raw_token__id__`)}],[r(`rawDoubleString__id__`)]:[{include:r(`@string_double_raw_token__id__`)}],[r(`expressionComment__id__`)]:[{include:r(`@expression_comment_token__id__`)}],[r(`noParse__id__`)]:[{include:r(`@no_parse_token__id__`)}],[r(`terseComment__id__`)]:[{include:r(`@terse_comment_token__id__`)}],[r(`directive_token__id__`)]:[[i(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{cases:{"@noParseTags":{token:`tag`,next:r(`@noParse__id__.$3`)},"@default":{token:`tag`}}},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:``,next:r(`@fmExpression__id__.directive`)}]],[i(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(@open__id__)(@)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`,next:r(`@unifiedCall__id__`)}]],[i(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(@open__id__)#--/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:{token:`comment`,next:r(`@terseComment__id__`)}],[i(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag.invalid`,next:r(`@fmExpression__id__.directive`)}]]],[r(`interpolation_and_text_token__id__`)]:[[i(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:t.id===`bracket`?`@brackets.interpolation`:`delimiter.interpolation`},{token:t.id===`bracket`?`delimiter.interpolation`:`@brackets.interpolation`,next:r(`@fmExpression__id__.interpolation`)}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:`source`}]],[r(`string_single_token__id__`)]:[[/[^'\\]/,{token:`string`}],[/@escapedChar/,{token:`string.escape`}],[/'/,{token:`string`,next:`@pop`}]],[r(`string_double_token__id__`)]:[[/[^"\\]/,{token:`string`}],[/@escapedChar/,{token:`string.escape`}],[/"/,{token:`string`,next:`@pop`}]],[r(`string_single_raw_token__id__`)]:[[/[^']+/,{token:`string.raw`}],[/'/,{token:`string.raw`,next:`@pop`}]],[r(`string_double_raw_token__id__`)]:[[/[^"]+/,{token:`string.raw`}],[/"/,{token:`string.raw`,next:`@pop`}]],[r(`expression_token__id__`)]:[[/(r?)(['"])/,{cases:{"r'":[{token:`keyword`},{token:`string.raw`,next:r(`@rawSingleString__id__`)}],'r"':[{token:`keyword`},{token:`string.raw`,next:r(`@rawDoubleString__id__`)}],"'":[{token:`source`},{token:`string`,next:r(`@singleString__id__`)}],'"':[{token:`source`},{token:`string`,next:r(`@doubleString__id__`)}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:`number`},"@default":{token:`number.float`}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:`delimiter`},{token:``},{token:`identifier`}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:`meta.arrow`},"@delimiters":{token:`delimiter`},"@default":{token:`operators`}}}],[/@id/,{cases:{"@keywords":{token:`keyword.$0`},"@stringOperators":{token:`operators`},"@default":{token:`identifier`}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"@default":{token:`@brackets`,next:r(`@inParen__id__.plain`)}}},"\\]":{cases:{...t.id===`bracket`?{"$S2==interpolation":{token:`@brackets.interpolation`,next:`@popall`}}:{},...e.id===`bracket`?{"$S2==directive":{token:`@brackets.directive`,next:`@popall`}}:{},[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}},"\\(":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"\\)":{cases:{[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}},"\\{":{cases:{"$S2==gt":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"@default":{token:`@brackets`,next:r(`@inParen__id__.plain`)}}},"\\}":{cases:{...t.id===`bracket`?{}:{"$S2==interpolation":{token:`@brackets.interpolation`,next:`@popall`}},[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}}}}],[/\$\{/,{token:`delimiter.invalid`}]],[r(`blank_and_expression_comment_token__id__`)]:[[/(?:@blank)+/,{token:``}],[/[<\[][#!]--/,{token:`comment`,next:r(`@expressionComment__id__`)}]],[r(`directive_end_token__id__`)]:[[/>/,e.id===`bracket`?{token:`operators`}:{token:`@brackets.directive`,next:`@popall`}],[i(/(\/)(@close__id__)/),[{token:`delimiter.directive`},{token:`@brackets.directive`,next:`@popall`}]]],[r(`greater_operators_token__id__`)]:[[/>/,{token:`operators`}],[/>=/,{token:`operators`}]],[r(`no_space_expression_end_token__id__`)]:[[/(?:@blank)+/,{token:``,switchTo:r(`@fmExpression__id__.directive`)}]],[r(`unified_call_token__id__`)]:[[/(@id)((?:@blank)+)/,[{token:`tag`},{token:``,next:r(`@fmExpression__id__.directive`)}]],[i(/(@id)(\/?)(@close__id__)/),[{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`,next:`@popall`}]],[/./,{token:`@rematch`,next:r(`@noSpaceExpression__id__`)}]],[r(`no_parse_token__id__`)]:[[i(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:``},{token:`@brackets.directive`,next:`@popall`}],"$S2==comment":[{token:`comment`},{token:`comment`},{token:`comment`},{token:`comment`},{token:`comment`}],"@default":[{token:`source`},{token:`source`},{token:`source`},{token:`source`},{token:`source`}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:`comment`},"@default":{token:`source`}}}]],[r(`expression_comment_token__id__`)]:[[/--[>\]]/,{token:`comment`,next:`@pop`}],[/[^\->\]]+|[>\]\-]/,{token:`comment`}]],[r(`terse_comment_token__id__`)]:[[i(/--(?:@close__id__)/),{token:`comment`,next:`@popall`}],[/[^<\[\-]+|[<\[\-]/,{token:`comment`}]]}}}function d(e){let t=u(r,e),n=u(i,e),o=u(a,e);return{...t,...n,...o,unicode:!0,includeLF:!1,start:`default_auto_${e.id}`,ignoreCase:!1,defaultToken:`invalid`,tokenPostfix:`.freemarker2`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],tokenizer:{...t.tokenizer,...n.tokenizer,...o.tokenizer}}}var f={conf:c(r),language:u(r,o)},p={conf:c(i),language:u(i,o)},m={conf:c(r),language:u(r,s)},h={conf:c(i),language:u(i,s)},g={conf:l(),language:d(o)},_={conf:l(),language:d(s)};export{m as TagAngleInterpolationBracket,f as TagAngleInterpolationDollar,_ as TagAutoInterpolationBracket,g as TagAutoInterpolationDollar,h as TagBracketInterpolationBracket,p as TagBracketInterpolationDollar};
@@ -1 +1 @@
1
- import{Zn as e}from"./index-C_HfATr4.js";var t=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);export{t};
1
+ import{Xt as e}from"./index-CWwAjH9Q.js";var t=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);export{t};
@@ -1 +1 @@
1
- import{u as e}from"./editor.api2-DEGvZ9jW.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`{{!--`,`--}}`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{{`,`}}`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`<`,close:`>`},{open:`"`,close:`"`},{open:`'`,close:`'`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:``,tokenPostfix:``,tokenizer:{root:[[/\{\{!--/,`comment.block.start.handlebars`,`@commentBlock`],[/\{\{!/,`comment.start.handlebars`,`@comment`],[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.root`}],[/<!DOCTYPE/,`metatag.html`,`@doctype`],[/<!--/,`comment.html`,`@commentHtml`],[/(<)(\w+)(\/>)/,[`delimiter.html`,`tag.html`,`delimiter.html`]],[/(<)(script)/,[`delimiter.html`,{token:`tag.html`,next:`@script`}]],[/(<)(style)/,[`delimiter.html`,{token:`tag.html`,next:`@style`}]],[/(<)([:\w]+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/(<\/)(\w+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/</,`delimiter.html`],[/\{/,`delimiter.html`],[/[^<{]+/]],doctype:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/[^>]+/,`metatag.content.html`],[/>/,`metatag.html`,`@pop`]],comment:[[/\}\}/,`comment.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentBlock:[[/--\}\}/,`comment.block.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentHtml:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/-->/,`comment.html`,`@pop`],[/[^-]+/,`comment.content.html`],[/./,`comment.content.html`]],otherTag:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.otherTag`}],[/\/?>/,`delimiter.html`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.script`}],[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],scriptAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterType`}],[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.scriptEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],style:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.style`}],[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],styleAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterType`}],[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.styleEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],handlebarsInSimpleState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`}],{include:`handlebarsRoot`}],handlebarsInEmbeddedState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`,nextEmbedded:`$S3`}],{include:`handlebarsRoot`}],handlebarsRoot:[[/"[^"]*"/,`string.handlebars`],[/[#/][^\s}]+/,`keyword.helper.handlebars`],[/else\b/,`keyword.helper.handlebars`],[/[\s]+/],[/[^}]/,`variable.parameter.handlebars`]]}};export{n as conf,r as language};
1
+ import{u as e}from"./editor.api2-CX0IWJmc.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`{{!--`,`--}}`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{{`,`}}`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`<`,close:`>`},{open:`"`,close:`"`},{open:`'`,close:`'`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:``,tokenPostfix:``,tokenizer:{root:[[/\{\{!--/,`comment.block.start.handlebars`,`@commentBlock`],[/\{\{!/,`comment.start.handlebars`,`@comment`],[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.root`}],[/<!DOCTYPE/,`metatag.html`,`@doctype`],[/<!--/,`comment.html`,`@commentHtml`],[/(<)(\w+)(\/>)/,[`delimiter.html`,`tag.html`,`delimiter.html`]],[/(<)(script)/,[`delimiter.html`,{token:`tag.html`,next:`@script`}]],[/(<)(style)/,[`delimiter.html`,{token:`tag.html`,next:`@style`}]],[/(<)([:\w]+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/(<\/)(\w+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/</,`delimiter.html`],[/\{/,`delimiter.html`],[/[^<{]+/]],doctype:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/[^>]+/,`metatag.content.html`],[/>/,`metatag.html`,`@pop`]],comment:[[/\}\}/,`comment.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentBlock:[[/--\}\}/,`comment.block.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentHtml:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/-->/,`comment.html`,`@pop`],[/[^-]+/,`comment.content.html`],[/./,`comment.content.html`]],otherTag:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.otherTag`}],[/\/?>/,`delimiter.html`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.script`}],[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],scriptAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterType`}],[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.scriptEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],style:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.style`}],[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],styleAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterType`}],[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.styleEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],handlebarsInSimpleState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`}],{include:`handlebarsRoot`}],handlebarsInEmbeddedState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`,nextEmbedded:`$S3`}],{include:`handlebarsRoot`}],handlebarsRoot:[[/"[^"]*"/,`string.handlebars`],[/[#/][^\s}]+/,`keyword.helper.handlebars`],[/else\b/,`keyword.helper.handlebars`],[/[\s]+/],[/[^}]/,`variable.parameter.handlebars`]]}};export{n as conf,r as language};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{i as t,n,o as r,s as ee,t as te}from"./select-DF8sGWfv.js";import{t as ne}from"./monaco-editor-q3UYuc-5.js";import{t as re}from"./refresh-cw-BtT1wl9S.js";import{a as i,t as a}from"./dist-_gv57K8d.js";import{t as ie}from"./switch-CgiZ-8Q1.js";import{En as ae,Er as o,H as oe,J as se,Lt as ce,Sr as le,U as s,V as c,en as l,fr as u,in as ue,ln as de,or as fe,r as pe,tn as d,xr as me}from"./index-CWwAjH9Q.js";import{t as he}from"./use-page-title-C_f72ri7.js";import{t as ge}from"./scroll-area-CPuygHdB.js";import{i as _e,n as f,r as ve,t as ye}from"./hook-runtime-DCkWsFrF.js";import{a as be,i as xe,n as Se,o as Ce,r as we,t as Te}from"./use-hook-run-session-RU-LfCyB.js";import{t as Ee}from"./empty-state-3cB27tBp.js";var p=e(o(),1),m=l();function De({title:e,body:t,tone:n=`warning`,children:r}){return(0,m.jsxs)(`div`,{className:`rounded-sm border px-4 py-3 text-sm ${n===`error`?`border-destructive/30 bg-destructive/10`:n===`neutral`?`border-border bg-muted/40`:`border-amber-500/30 bg-amber-500/10`}`,children:[(0,m.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,m.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t}),r?(0,m.jsx)(`div`,{className:`mt-3`,children:r}):null]})}function Oe(e){if(e===0)return`0ms`;for(let t of[{suffix:`d`,value:864e5},{suffix:`h`,value:36e5},{suffix:`m`,value:6e4},{suffix:`s`,value:1e3}])if(e%t.value===0)return`${e/t.value}${t.suffix}`;return`${e}ms`}function h(e){return JSON.stringify({name:e.name,runtime:e.runtime,file:e.file,timeout:e.timeout,network:e.network,source:e.source})}function g(e,t){return e.find(e=>e.field===t)??null}function ke(e){return Array.isArray(e)}function Ae(e){switch(e){case`javascript`:return`JavaScript`;case`typescript`:return`TypeScript`;case`python`:return`Python`;case`shell`:return`Shell`;default:return e}}function _(){let{id:e}=le(),o=me(),l=se(),_=!e,v=e??``,y=(0,p.useMemo)(()=>f(`node`),[]),b=(0,p.useRef)(_?a():v),[x,S]=(0,p.useState)(b.current),[C,w]=(0,p.useState)(``),[T,E]=(0,p.useState)(`node`),[D,O]=(0,p.useState)(y.file),[k,A]=(0,p.useState)(`30s`),[j,M]=(0,p.useState)(!0),[N,P]=(0,p.useState)(y.source),[F,I]=(0,p.useState)([]),[je,L]=(0,p.useState)(!_),[Me,R]=(0,p.useState)(!1),[Ne,z]=(0,p.useState)(!1),[Pe,B]=(0,p.useState)(null),[Fe,V]=(0,p.useState)([]),[Ie,H]=(0,p.useState)(null),[Le,Re]=(0,p.useState)(!1),[ze,Be]=(0,p.useState)(!1),[Ve,He]=(0,p.useState)(()=>h({name:``,runtime:`node`,file:y.file,timeout:`30s`,network:!0,source:y.source})),U=(0,p.useRef)(y.file),W=(0,p.useRef)(y.source);he(_?`New Hook`:C.trim()||`Hook`);let G=h({name:C,runtime:T,file:D,timeout:k,network:j,source:N})!==Ve,Ue=F.find(e=>e.code===`file_missing`)??null,K=Te({hookId:x}),q=_e(T),We=Ae(q),J=(0,p.useMemo)(()=>_||!x||G?`Save this hook to run the latest changes.`:F.length>0?F.map(e=>e.message).join(` `):null,[F,x,_,G]);(0,p.useEffect)(()=>{if(_){S(b.current),R(!1);return}let e=!1;return L(!0),ae(v).then(t=>{if(e)return;let n=Oe(t.hook.timeout),r=t.source??``;S(t.hook.id),w(t.hook.name),E(t.hook.runtime),O(t.hook.file),A(n),M(t.hook.network),P(r),I(t.fieldErrors),B(null),H(null),V([]),R(!1),He(h({name:t.hook.name,runtime:t.hook.runtime,file:t.hook.file,timeout:n,network:t.hook.network,source:r})),U.current=t.hook.file,W.current=r}).catch(t=>{if(!e){if(t instanceof d&&t.status===404){R(!0);return}B(t instanceof Error?t.message:`Failed to load hook`)}}).finally(()=>{e||L(!1)}),()=>{e=!0}},[_,v]);function Ge(e){if(_){let t=f(e,C);(D===U.current||!D.trim())&&O(t.file),(N===W.current||!N.trim())&&P(t.source),U.current=t.file,W.current=t.source}E(e)}function Ke(e){if(w(e),!_)return;let t=f(T,e);(D===U.current||!D.trim())&&O(t.file),U.current=t.file}function qe(){if(!_)return;let e=a();b.current=e,S(e)}async function Je(){z(!0),B(null),H(null),V([]);let e={hook:{id:x,name:C.trim(),runtime:T,file:D.trim(),timeout:k.trim(),network:j},source:N};try{let t=_?await ue(e):await fe(x,e),n=Oe(t.hook.timeout),r=t.source??N;S(t.hook.id),w(t.hook.name),E(t.hook.runtime),O(t.hook.file),A(n),M(t.hook.network),P(r),I(t.fieldErrors),He(h({name:t.hook.name,runtime:t.hook.runtime,file:t.hook.file,timeout:n,network:t.hook.network,source:r})),U.current=t.hook.file,W.current=r,_&&o(u.hookEdit(t.hook.id),{replace:!0})}catch(e){if(e instanceof d){let t=e.payload?.error,n=e.payload?.fieldErrors;t===`validation_failed`&&ke(n)?(I(n),B(`Couldn't save this hook. Fix the highlighted issues and try again.`)):B(e.message)}else B(e instanceof Error?e.message:`Failed to save hook`)}finally{z(!1)}}async function Ye(e=!1){if(!(_||!x)){Re(!0),H(null);try{await de(x,{force:e}),o(u.hooks)}catch(e){if(e instanceof d){let t=e.payload?.error,n=e.payload?.references;if(t===`hook_in_use`&&Array.isArray(n)){V(n);return}H(e.message)}else H(e instanceof Error?e.message:`Failed to delete hook`)}finally{Re(!1)}}}function Xe(){H(null),V([]),Be(!0)}function Ze(e){Be(e),e||(H(null),V([]))}async function Qe(){J||await K.submitRun()}if(je)return(0,m.jsx)(pe,{});if(Me)return(0,m.jsx)(Ee,{icon:ce,title:`Hook not found`,description:`This hook doesn't exist or could not be loaded.`,actionLabel:`View All Hooks`,onAction:()=>o(u.hooks)});let Y=g(F,`name`),X=g(F,`runtime`),Z=g(F,`file`),Q=g(F,`timeout`),$=g(F,`network`),$e=(0,m.jsxs)(`div`,{className:s(`p-3`,l?`space-y-3`:`flex h-full min-h-0 flex-col gap-3 overflow-hidden`),children:[(0,m.jsxs)(`div`,{className:`space-y-3 shrink-0`,children:[Pe?(0,m.jsx)(De,{title:`Couldn't save this hook.`,body:Pe,tone:`error`}):null,Ue?(0,m.jsx)(De,{title:`Hook file missing`,body:`This hook is still registered, but its source file can't be found. Update the path or recreate the file, then save again.`}):null,(0,m.jsxs)(`section`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-name`,children:`Hook name`}),(0,m.jsx)(c,{id:`hook-name`,value:C,onChange:e=>Ke(e.currentTarget.value),placeholder:`Capture auth session`,"aria-invalid":!!Y}),Y?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:Y.message}):null]}),_?(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-id`,children:`Hook ID`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(c,{id:`hook-id`,value:x,readOnly:!0,disabled:!0,"aria-label":`Hook ID`}),(0,m.jsx)(oe,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:qe,"aria-label":`Generate new hook ID`,children:(0,m.jsx)(re,{className:`size-3.5`})})]})]}):null,(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-file`,children:`File path`}),(0,m.jsx)(c,{id:`hook-file`,value:D,onChange:e=>O(e.currentTarget.value),placeholder:`./hooks/login.js`,"aria-invalid":!!Z}),Z?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:Z.message}):null]}),(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)_minmax(0,0.8fr)]`,children:[(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-runtime`,children:`Runtime`}),(0,m.jsxs)(te,{value:T,onValueChange:e=>Ge(e),children:[(0,m.jsx)(r,{id:`hook-runtime`,"aria-invalid":!!X,children:(0,m.jsx)(ee,{placeholder:`Runtime`})}),(0,m.jsx)(n,{children:ye.map(e=>(0,m.jsx)(t,{value:e,children:ve(e).label},e))})]}),X?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:X.message}):null]}),(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-timeout`,children:`Timeout`}),(0,m.jsx)(c,{id:`hook-timeout`,value:k,onChange:e=>A(e.currentTarget.value),placeholder:`5s`,"aria-invalid":!!Q}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Examples: 5s, 10m, 250ms`}),Q?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:Q.message}):null]}),(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-network`,children:`Network`}),(0,m.jsxs)(`div`,{className:`flex h-10 items-center justify-between rounded-sm border bg-background/70 px-3`,children:[(0,m.jsx)(`span`,{className:`text-sm text-foreground`,children:j?`Enabled`:`Disabled`}),(0,m.jsx)(ie,{id:`hook-network`,checked:j,onCheckedChange:M,"aria-invalid":!!$})]}),$?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:$.message}):null]})]})]})]}),(0,m.jsxs)(`section`,{className:s(`space-y-2`,l?``:`flex min-h-[300px] flex-1 flex-col overflow-hidden`),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Source`}),(0,m.jsx)(`span`,{className:`rounded-sm border px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:We})]}),(0,m.jsx)(ne,{value:N,onChange:P,onSave:Je,language:q,className:s(`rounded-sm`,l?`h-[360px] min-h-[320px]`:`h-full min-h-[300px] flex-1`)})]})]}),et=l?(0,m.jsx)(ge,{className:`h-full`,children:$e}):$e,tt=(0,m.jsx)(we,{baselineCount:K.baselineVariables.length,baselineFilePath:K.baselineFilePath,baselineInfo:K.baselineInfo,isBaselineLoading:K.isBaselineLoading,overrideRows:K.overrideRows,overridingRowIds:K.overridingRowIds,recentRuns:K.recentRuns,selectedRunId:K.selectedRunId,isRunning:K.isRunning,runDisabledReason:J,runError:K.runError,onAddOverride:()=>K.addOverrideRow(),onUpdateOverride:K.updateOverrideRow,onRemoveOverride:K.removeOverrideRow,onRun:()=>{Qe()},onSelectRun:K.selectRun}),nt=(0,m.jsx)(xe,{selectedRun:K.selectedRun});return(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,m.jsx)(be,{hookName:C.trim()||`New Hook`,isCreateMode:_,mode:`edit`,hookHref:_?void 0:u.hookView(x),editHref:_?void 0:u.hookEdit(x),unsaved:G,isSaving:Ne,isRunning:K.isRunning,isDeleting:Le,onSave:Je,onRun:_?void 0:()=>{Qe()},runDisabled:!!J,onDelete:_?void 0:Xe}),(0,m.jsx)(Se,{isMobile:l,leftPane:et,rightTopPane:tt,rightBottomPane:nt}),_?null:(0,m.jsx)(Ce,{open:ze,onOpenChange:Ze,hook:{id:x,name:C.trim()||`Hook`,runtime:T,file:D},isDeleting:Le,deleteError:Ie,blockedReferences:Fe,onDelete:()=>{Ye(!1)},onForceDelete:()=>{Ye(!0)}})]})}export{_ as default};
@@ -0,0 +1,5 @@
1
+ import{en as e,k as t}from"./index-CWwAjH9Q.js";function n(e){return t({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M432 32H80a64.07 64.07 0 0 0-64 64v320a64.07 64.07 0 0 0 64 64h352a64.07 64.07 0 0 0 64-64V96a64.07 64.07 0 0 0-64-64zM96 256a16 16 0 0 1-10-28.49L150.39 176 86 124.49a16 16 0 1 1 20-25l80 64a16 16 0 0 1 0 25l-80 64A16 16 0 0 1 96 256zm160 0h-64a16 16 0 0 1 0-32h64a16 16 0 0 1 0 32z`},child:[]}]})(e)}function r(e){return t({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M314 36.38c-18.59-3.06-45.8-4.47-64.27-4.38a311.09 311.09 0 0 0-51.66 4.38c-45.74 8-54.07 24.7-54.07 55.54V128h112v16H107.62C66.06 144 32.33 193.67 32 255.12v.88a162.91 162.91 0 0 0 3.13 32c9.29 46.28 38.23 80 72.49 80H128v-54c0-31.3 20.84-59.95 55-66.1l9.87-1.23H314a56.05 56.05 0 0 0 15.06-2A52.48 52.48 0 0 0 368 193.68V91.92c0-28.92-24.68-50.73-54-55.54zM194.93 105.5a20.37 20.37 0 1 1 20.3-20.3 20.29 20.29 0 0 1-20.3 20.3z`},child:[]},{tag:`path`,attr:{d:`M475.28 217c-10.7-42.61-38.41-73-70.9-73h-17.71v47.45c0 39.57-26 68.22-57.74 73.13a63.54 63.54 0 0 1-9.69.75H198.08a60 60 0 0 0-15.23 1.95C160.54 273.14 144 291.7 144 315.77v101.77c0 29 29.14 46 57.73 54.31 34.21 9.95 71.48 11.75 112.42 0 27.19-7.77 53.85-23.48 53.85-54.31V384H256v-16h148.38c29.44 0 54.95-24.93 67.45-61.31A156.83 156.83 0 0 0 480 256a160.64 160.64 0 0 0-4.72-39zM316.51 404a20.37 20.37 0 1 1-20.3 20.3 20.29 20.29 0 0 1 20.3-20.3z`},child:[]}]})(e)}function i(e){return t({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M429.76 130.07 274.33 36.85a37 37 0 0 0-36.65 0L82.24 130.06A38.2 38.2 0 0 0 64 162.83V349a38.26 38.26 0 0 0 18.24 32.8L123 406.14l.23.13c20.58 10.53 28.46 10.53 37.59 10.53 32.14 0 52.11-20.8 52.11-54.29V182a8.51 8.51 0 0 0-8.42-8.58h-22.38a8.51 8.51 0 0 0-8.42 8.58v180.51a15 15 0 0 1-6.85 13.07c-5.9 3.6-14.47 2.84-24.14-2.15l-39.06-23.51a1.1 1.1 0 0 1-.48-.92V165.46a1.32 1.32 0 0 1 .59-1.06l151.84-93a.82.82 0 0 1 .73 0l151.93 93a1.34 1.34 0 0 1 .55 1.1V349a1.28 1.28 0 0 1-.45 1l-152.06 90.65a1.22 1.22 0 0 1-.8 0l-38.83-23.06a7.8 7.8 0 0 0-7.83-.41l-.34.2c-10.72 6.35-13.6 8-23.54 11.62-1.62.59-5.43 2-5.76 5.77s3.29 6.45 6.51 8.32l51.9 31.87a35.67 35.67 0 0 0 18.3 5.07h.58a35.87 35.87 0 0 0 17.83-5.07l155.43-93.13A38.37 38.37 0 0 0 448 349V162.83a38.21 38.21 0 0 0-18.24-32.76z`},child:[]},{tag:`path`,attr:{d:`M307.88 318.05c-37.29 0-45.24-10.42-47.6-27.24a8.43 8.43 0 0 0-8.22-7.32h-19.8a8.44 8.44 0 0 0-8.26 8.58c0 14.58 5.12 62.17 83.92 62.17 24.38 0 44.66-5.7 58.63-16.49S388 311.26 388 292.55c0-37.55-24.5-47.83-72.75-54.55-49.05-6.82-49.05-10.29-49.05-17.89 0-5.47 0-18.28 35.46-18.28 25.23 0 38.74 3.19 43.06 20a8.35 8.35 0 0 0 8.06 6.67h19.87a8.24 8.24 0 0 0 6.16-2.86 8.91 8.91 0 0 0 2.12-6.44c-2.57-35.55-28.56-53.58-79.24-53.58-46.06 0-73.55 20.75-73.55 55.5 0 38.1 28.49 48.87 71.29 53.33 50 5.17 50 12.71 50 19.37.03 10.38-4.28 24.23-41.55 24.23z`},child:[]}]})(e)}var a=e();function o({className:e}){return(0,a.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,children:(0,a.jsx)(`path`,{fill:`currentColor`,d:`M11.966 22.566c6.609 0 11.966-4.326 11.966-9.661 0-3.308-2.051-6.23-5.204-7.963-1.283-.713-2.291-1.353-3.13-1.885-1.58-1.004-2.555-1.623-3.632-1.623-1.094 0-2.327.783-3.955 1.816a49.78 49.78 0 0 1-2.808 1.692C2.051 6.675 0 9.597 0 12.905c0 5.335 5.357 9.66 11.966 9.66Zm-1.397-17.83a5.885 5.885 0 0 0 .497-2.403c0-.144.201-.186.229-.028.656 2.775-.9 4.15-2.051 4.61-.124.048-.199-.12-.103-.208a5.748 5.748 0 0 0 1.428-1.971Zm2.052-.102a5.795 5.795 0 0 0-.78-2.3v-.015c-.068-.123.086-.263.185-.172 1.956 2.105 1.303 4.055.554 5.037-.082.102-.229-.003-.188-.126a5.837 5.837 0 0 0 .229-2.424Zm1.771-.559a5.708 5.708 0 0 0-1.607-1.801V2.26c-.112-.085-.024-.274.113-.218 2.588 1.084 2.766 3.171 2.452 4.395a.116.116 0 0 1-.048.071.11.11 0 0 1-.153-.026.118.118 0 0 1-.022-.083 5.864 5.864 0 0 0-.735-2.324Zm-5.072.559c-.616.544-1.279.758-2.058.997-.116 0-.194-.078-.155-.18 1.747-.907 2.369-1.645 2.99-2.771 0 0 .155-.117.188.085 0 .303-.348 1.325-.965 1.869Zm4.931 11.205a2.949 2.949 0 0 1-.935 1.549 2.16 2.16 0 0 1-1.282.618 2.167 2.167 0 0 1-1.323-.618 2.95 2.95 0 0 1-.923-1.549.243.243 0 0 1 .064-.197.23.23 0 0 1 .192-.069h3.954a.226.226 0 0 1 .19.07.239.239 0 0 1 .063.196Zm-5.443-2.17a1.85 1.85 0 0 1-2.377-.244 1.969 1.969 0 0 1-.233-2.44c.207-.318.502-.565.846-.711a1.84 1.84 0 0 1 1.089-.11c.365.075.701.26.964.53.264.27.443.616.515.99a1.98 1.98 0 0 1-.108 1.118 1.923 1.923 0 0 1-.696.866Zm8.471.005a1.849 1.849 0 0 1-2.374-.252 1.956 1.956 0 0 1-.546-1.362c0-.383.11-.758.319-1.076.207-.318.502-.566.847-.711a1.84 1.84 0 0 1 1.09-.108c.366.076.702.261.965.533s.44.617.512.993a1.98 1.98 0 0 1-.113 1.118 1.922 1.922 0 0 1-.7.865Z`})})}var s=[`node`,`bun`,`python`,`bash`],c={node:i,bun:o,python:r,bash:n},l={node:{label:`Node.js`,shortLabel:`JS`,icon:c.node,monacoLanguage:`javascript`,extension:`.js`,template:[`const fs = require('node:fs')`,``,`const envLines = [`,` 'HOOK_STATUS=ready',`,` 'HOOK_RUNTIME=node',`,`].join('\\n')`,``,"fs.writeFileSync('/tmp/agent-qa.env', `${envLines}\\n`)",`console.log('Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env')`,`console.error('Sample stderr: replace with warnings or debug details when needed')`,``].join(`
2
+ `)},bun:{label:`Bun`,shortLabel:`BUN`,icon:c.bun,monacoLanguage:`typescript`,extension:`.ts`,template:[`const envLines = [`,` 'HOOK_STATUS=ready',`,` 'HOOK_RUNTIME=bun',`,`].join('\\n')`,``,"await Bun.write('/tmp/agent-qa.env', `${envLines}\\n`)",`console.log('Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env')`,`console.error('Sample stderr: replace with warnings or debug details when needed')`,``].join(`
3
+ `)},python:{label:`Python`,shortLabel:`PY`,icon:c.python,monacoLanguage:`python`,extension:`.py`,template:[`from pathlib import Path`,`import sys`,``,`env_lines = '\\n'.join([`,` 'HOOK_STATUS=ready',`,` 'HOOK_RUNTIME=python',`,`]) + '\\n'`,``,`Path('/tmp/agent-qa.env').write_text(env_lines, encoding='utf-8')`,`print('Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env')`,`print('Sample stderr: replace with warnings or debug details when needed', file=sys.stderr)`,``].join(`
4
+ `)},bash:{label:`Bash`,shortLabel:`SH`,icon:c.bash,monacoLanguage:`shell`,extension:`.sh`,template:[`#!/usr/bin/env bash`,`set -euo pipefail`,``,`cat > /tmp/agent-qa.env <<'EOF'`,`HOOK_STATUS=ready`,`HOOK_RUNTIME=bash`,`EOF`,``,`echo 'Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env'`,`echo 'Sample stderr: replace with warnings or debug details when needed' >&2`,``].join(`
5
+ `)}};function u(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`new-hook`}function d(e){return l[e]}function f(e){return l[e].monacoLanguage}function p(e,t=``){let n=d(e);return{file:`./hooks/${u(t)}${n.extension}`,source:n.template}}export{f as i,p as n,d as r,s as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-q3UYuc-5.js";import{Cr as n,En as ee,Er as r,J as te,K as ne,Lt as i,M as re,Sr as ie,U as a,Xt as o,en as s,fr as c,ln as ae,r as oe,tn as l,xr as se}from"./index-CWwAjH9Q.js";import{t as u}from"./badge-DHCU59H0.js";import{t as ce}from"./use-page-title-C_f72ri7.js";import{t as le}from"./scroll-area-CPuygHdB.js";import{i as d,r as f}from"./hook-runtime-DCkWsFrF.js";import{a as p,i as m,n as h,o as g,r as _,t as ue}from"./use-hook-run-session-RU-LfCyB.js";import{t as v}from"./empty-state-3cB27tBp.js";import{t as de}from"./use-keyboard-shortcuts-O6nfytzm.js";var fe=o(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),y=e(r(),1),b=s(),x=[`overview`,`source`,`run`];function S(e){return e!==null&&x.includes(e)}function pe(e){let t=e.get(`tab`);return S(t)?t:`overview`}function C({title:e,body:t,tone:n=`warning`}){return(0,b.jsxs)(`div`,{className:`rounded-sm border px-4 py-3 text-sm ${n===`error`?`border-destructive/30 bg-destructive/10`:n===`neutral`?`border-border bg-muted/40`:`border-amber-500/30 bg-amber-500/10`}`,children:[(0,b.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,b.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t})]})}function w({fileMissing:e}){return e?(0,b.jsx)(u,{variant:`outline`,className:`border-amber-500/30 text-amber-600`,children:`File missing`}):(0,b.jsx)(u,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600`,children:`Ready`})}function T({label:e,value:t,mono:n=!1}){return(0,b.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,b.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,b.jsx)(`div`,{className:n?`font-mono text-xs text-foreground break-all`:`text-sm text-foreground`,children:t})]})}function E(){let{id:e}=ie(),r=se(),[o,s]=n(),u=e??``,x=te(),[S,E]=(0,y.useState)(null),[me,D]=(0,y.useState)(!0),[O,k]=(0,y.useState)(!1),[A,j]=(0,y.useState)(null),[M,N]=(0,y.useState)(!1),[P,F]=(0,y.useState)(null),[I,L]=(0,y.useState)([]),[R,z]=(0,y.useState)(!1),[he,B]=(0,y.useState)(!1),V=(0,y.useRef)(null),H=(0,y.useRef)(null),U=(0,y.useRef)(o.has(`tab`)?pe(o):null),W=ue({hookId:u});(0,y.useEffect)(()=>{if(o.has(`tab`)){let e=new URLSearchParams(o);e.delete(`tab`),s(e,{replace:!0})}},[o,s]),(0,y.useEffect)(()=>{let e=!1;return D(!0),k(!1),j(null),ee(u).then(t=>{e||E(t)}).catch(t=>{if(!e){if(E(null),t instanceof l&&t.status===404){k(!0);return}j(t instanceof Error?t.message:`Failed to load hook`)}}).finally(()=>{e||D(!1)}),()=>{e=!0}},[u]),ce(S?.hook.name??`Hook`);let G=(0,y.useMemo)(()=>S?f(S.hook.runtime):null,[S]),K=G?.icon,q=S?.fieldErrors.some(e=>e.code===`file_missing`)??!1,J=S?.fieldErrors.filter(e=>e.code!==`file_missing`)??[],Y=(0,y.useMemo)(()=>S?S.fieldErrors.length===0?null:S.fieldErrors.map(e=>e.message).join(` `):`Hook details are still loading.`,[S]),X=(0,y.useCallback)(async()=>{H.current?.scrollIntoView?.({block:`start`}),!Y&&await W.submitRun()},[Y,W]),ge=(0,y.useCallback)(()=>{F(null),L([]),N(!0)},[]),_e=(0,y.useCallback)(e=>{N(e),e||(F(null),L([]))},[]),Z=(0,y.useCallback)(async(e=!1)=>{if(u){z(!0),F(null);try{await ae(u,{force:e}),r(c.hooks)}catch(e){if(e instanceof l){let t=e.payload?.error,n=e.payload?.references;if(t===`hook_in_use`&&Array.isArray(n)){L(n);return}F(e.message)}else F(e instanceof Error?e.message:`Failed to delete hook`)}finally{z(!1)}}},[u,r]),Q=c.hookEdit(u);if(de({e:()=>{S&&r(Q)},r:()=>{X()},"shift+?":()=>B(e=>!e)}),(0,y.useEffect)(()=>{!S||!U.current||(U.current===`source`&&V.current?.scrollIntoView?.({block:`start`}),U.current===`run`&&H.current?.scrollIntoView?.({block:`start`}),U.current=null)},[S]),me)return(0,b.jsx)(oe,{});if(O)return(0,b.jsx)(v,{icon:fe,title:`Hook not found`,description:`This hook doesn't exist or could not be loaded.`,actionLabel:`View All Hooks`,onAction:()=>r(c.hooks)});if(!S)return(0,b.jsx)(v,{icon:i,title:`Hook couldn't be loaded`,description:A??`This hook could not be loaded right now.`,actionLabel:`View All Hooks`,onAction:()=>r(c.hooks)});let $=(0,b.jsxs)(`div`,{className:a(`p-3`,x?`space-y-3`:`flex h-full min-h-0 flex-col gap-3 overflow-hidden`),children:[(0,b.jsxs)(`div`,{className:`space-y-3 shrink-0`,children:[A?(0,b.jsx)(C,{title:`Hook could not be loaded`,body:A,tone:`error`}):null,q?(0,b.jsx)(C,{title:`Hook file missing`,body:`This hook is still registered, but its source file can't be found. Update the path or recreate the file, then save again.`}):null,J.length>0?(0,b.jsx)(C,{title:`Hook has recoverable authoring issues`,body:J.map(e=>e.message).join(` `)}):null,(0,b.jsxs)(`section`,{className:`space-y-3`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Hook`}),(0,b.jsx)(`div`,{className:`text-base font-semibold text-foreground`,children:S.hook.name})]}),(0,b.jsx)(w,{fileMissing:q})]}),(0,b.jsxs)(`div`,{className:`grid gap-x-5 gap-y-3 sm:grid-cols-2`,children:[(0,b.jsx)(T,{label:`File`,value:S.hook.file,mono:!0}),(0,b.jsx)(T,{label:`Hook ID`,value:S.hook.id,mono:!0}),(0,b.jsx)(T,{label:`Runtime`,value:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K?(0,b.jsx)(K,{className:`h-4 w-4 text-muted-foreground`}):null,(0,b.jsx)(`span`,{children:G?.label??S.hook.runtime})]})}),(0,b.jsx)(T,{label:`Timeout`,value:ne(S.hook.timeout)}),(0,b.jsx)(T,{label:`Network`,value:S.hook.network?`Enabled`:`Disabled`}),(0,b.jsx)(T,{label:`Health`,value:(0,b.jsx)(w,{fileMissing:q})})]})]})]}),(0,b.jsxs)(`section`,{ref:V,className:a(`space-y-2`,x?``:`flex min-h-[300px] flex-1 flex-col overflow-hidden`),children:[(0,b.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Source`}),S.source?(0,b.jsx)(t,{value:S.source,onChange:()=>{},readOnly:!0,language:d(S.hook.runtime),className:a(`rounded-sm`,x?`h-[360px] min-h-[320px]`:`h-full min-h-[300px] flex-1`)}):(0,b.jsx)(`div`,{className:a(`flex items-center justify-center rounded-sm border border-dashed px-6 py-12 text-center`,x?`min-h-[320px]`:`min-h-[300px] flex-1`),children:(0,b.jsxs)(`div`,{children:[(0,b.jsx)(i,{className:`mx-auto h-5 w-5 text-muted-foreground`}),(0,b.jsx)(`div`,{className:`mt-3 text-sm font-medium text-foreground`,children:`No hook source found for this record.`}),(0,b.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:`Update the path or recreate the file in edit mode.`})]})})]})]}),ve=x?(0,b.jsx)(le,{className:`h-full`,children:$}):$,ye=(0,b.jsx)(`div`,{ref:H,className:`h-full`,children:(0,b.jsx)(_,{baselineCount:W.baselineVariables.length,baselineFilePath:W.baselineFilePath,baselineInfo:W.baselineInfo,isBaselineLoading:W.isBaselineLoading,overrideRows:W.overrideRows,overridingRowIds:W.overridingRowIds,recentRuns:W.recentRuns,selectedRunId:W.selectedRunId,isRunning:W.isRunning,runDisabledReason:Y,runError:W.runError,onAddOverride:()=>W.addOverrideRow(),onUpdateOverride:W.updateOverrideRow,onRemoveOverride:W.removeOverrideRow,onRun:()=>{X()},onSelectRun:W.selectRun})}),be=(0,b.jsx)(m,{selectedRun:W.selectedRun});return(0,b.jsx)(re,{children:(0,b.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,b.jsx)(p,{hookName:S.hook.name,isCreateMode:!1,mode:`view`,hookHref:c.hookView(S.hook.id),editHref:c.hookEdit(S.hook.id),isRunning:W.isRunning,onRun:()=>{X()},runDisabled:!!Y,onDelete:ge,isDeleting:R,shortcutsOpen:he,onToggleShortcuts:()=>B(e=>!e)}),(0,b.jsx)(h,{isMobile:x,leftPane:ve,rightTopPane:ye,rightBottomPane:be}),(0,b.jsx)(g,{open:M,onOpenChange:_e,hook:{id:S.hook.id,name:S.hook.name,runtime:S.hook.runtime,file:S.hook.file},isDeleting:R,deleteError:P,blockedReferences:I,onDelete:()=>{Z(!1)},onForceDelete:()=>{Z(!0)}})]})})}export{E as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-B4k_G_pz.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-DF8sGWfv.js";import{t as s}from"./file-code-DDa3GwxK.js";import{n as c,r as l}from"./shortcut-hints-CUbl8p3Z.js";import{t as u}from"./plus-DWwmmJlz.js";import{A as d,Cr as f,Er as p,H as m,K as ee,M as te,N as ne,Tn as re,U as h,V as ie,a as ae,en as g,fr as _,j as oe,xr as se}from"./index-CWwAjH9Q.js";import{t as v}from"./badge-DHCU59H0.js";import{t as ce}from"./use-page-title-C_f72ri7.js";import{a as le,i as y,n as ue,o as b,r as x,t as de}from"./table-cLA2Rr2t.js";import{n as fe,t as S}from"./scroll-area-CPuygHdB.js";import{r as C,t as pe}from"./hook-runtime-DCkWsFrF.js";import{t as me}from"./empty-state-3cB27tBp.js";import{t as he}from"./use-keyboard-shortcuts-O6nfytzm.js";var w=e(p(),1),T=new Set([`asc`,`desc`]);function E(e){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),e.runtime&&t.set(`runtime`,e.runtime),e.health&&t.set(`health`,e.health),e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),t}function ge(){let[e,t]=f(),n=e.get(`search`)??``,r=e.get(`runtime`)??``,i=e.get(`health`)??``,a=e.get(`sort`)??``,o=e.get(`order`)??`asc`,s=T.has(o)?o:`asc`,c=(0,w.useMemo)(()=>a?[{id:a,desc:s===`desc`}]:[],[a,s]),l=(0,w.useRef)(c);l.current=c;let u=(0,w.useMemo)(()=>({search:n,runtime:r,health:i,sort:a,order:s}),[n,r,i,a,s]);(0,w.useEffect)(()=>{let n=E(u);n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,u]);let d=(0,w.useCallback)(e=>{t(E({...u,...e}),{replace:!0})},[t,u]);return{search:n,runtime:r,health:i,sort:a,order:s,sorting:c,onSortingChange:(0,w.useCallback)(e=>{let t=typeof e==`function`?e(l.current):e;t.length>0?d({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):d({sort:``,order:`asc`})},[d]),setSearch:(0,w.useCallback)(e=>d({search:e}),[d]),setRuntime:(0,w.useCallback)(e=>d({runtime:e}),[d]),setHealth:(0,w.useCallback)(e=>d({health:e}),[d])}}var D=g(),O={hooks:[],filePath:null,errors:[],missing:!1},k=50;function A(e){return e.fileMissing?`file-missing`:`ready`}function j(e){return e===`file-missing`?`File missing`:`Ready`}function _e({hook:e}){return A(e)===`file-missing`?(0,D.jsx)(v,{variant:`outline`,className:`border-amber-500/30 text-amber-600`,children:`File missing`}):(0,D.jsx)(v,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600`,children:`Ready`})}function ve({runtime:e}){let t=C(e),n=t.icon;return(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,D.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,D.jsx)(`span`,{children:t.label})]})}function ye({title:e,body:t}){return(0,D.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm`,children:[(0,D.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,D.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t})]})}function be({isActive:e}){return h(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function M(){ce(`Hooks`);let e=se(),[f,p]=(0,w.useState)(O),[h,g]=(0,w.useState)(null),[v,T]=(0,w.useState)(!0),[E,M]=(0,w.useState)(-1),[N,P]=(0,w.useState)(0),F=(0,w.useRef)([]),{search:I,runtime:L,health:R,sorting:z,onSortingChange:xe,setSearch:B,setRuntime:V,setHealth:H}=ge();(0,w.useEffect)(()=>{let e=!1;return re().then(t=>{e||(p(t),g(null))}).catch(t=>{e||(p(O),g(t instanceof Error?t.message:`Failed to load hooks`))}).finally(()=>{e||T(!1)}),()=>{e=!0}},[]);let U=(0,w.useMemo)(()=>h?{title:`Hooks could not be loaded`,body:h}:f.missing?{title:`${f.filePath??`configured hooks file`} not found`,body:`Create the first hook to generate the configured hooks file for this workspace.`}:f.errors.length>0?{title:`Hooks could not be loaded from ${f.filePath??`configured hooks file`}`,body:f.errors[0]??`Unknown registry error`}:null,[f.errors,f.filePath,f.missing,h]),W=(0,w.useMemo)(()=>{let e=I.trim().toLowerCase(),t=z[0],n=f.hooks.filter(t=>L&&t.runtime!==L||R&&A(t)!==R?!1:e?t.name.toLowerCase().includes(e)||t.file.toLowerCase().includes(e)||t.id.toLowerCase().includes(e):!0);return t?[...n].sort((e,n)=>{let r=0;switch(t.id){case`runtime`:r=C(e.runtime).label.localeCompare(C(n.runtime).label);break;case`timeout`:r=e.timeout-n.timeout;break;case`health`:r=j(A(e)).localeCompare(j(A(n)));break;default:r=e.name.localeCompare(n.name);break}return t.desc?r*-1:r}):n},[f.hooks,R,L,I,z]),G=W.length,K=Math.ceil(G/k),q=K>0?Math.min(N,K-1):0,J=q*k,Y=W.slice(J,J+k),Se=G>0?J+1:0,Ce=Math.min(J+k,G);(0,w.useEffect)(()=>{N!==q&&P(q)},[N,q]);let we=(0,w.useCallback)(e=>{M(-1),P(0),B(e)},[B]),Te=(0,w.useCallback)(e=>{M(-1),P(0),V(e===`all`?``:e)},[V]),X=(0,w.useCallback)(e=>{M(-1),P(0),H(e===`all`?``:e)},[H]),Z=(0,w.useCallback)((t,n=!1)=>{let r=_.hookView(t.id);if(n){window.open(r,`_blank`);return}e(r)},[e]);he((0,w.useMemo)(()=>{let e=()=>M(e=>Math.min(e+1,Y.length-1)),t=()=>M(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{E<0||!Y[E]||Z(Y[E],e.metaKey||e.ctrlKey)}}},[Z,E,Y])),(0,w.useEffect)(()=>{if(Y.length===0){E!==-1&&M(-1);return}E>=Y.length&&M(Y.length-1)},[E,Y.length]),(0,w.useEffect)(()=>{if(E<0)return;let e=F.current[E];e&&document.activeElement!==e&&e.focus()},[E,Y.length]);let Ee=(0,w.useCallback)((e,t)=>{t&&t.preventDefault(),Z(e,!!(t&&(t.metaKey||t.ctrlKey)))},[Z]);function Q(e){M(-1),P(0),xe(t=>{let n=t[0];return!n||n.id!==e?[{id:e,desc:!1}]:n.desc?[]:[{id:e,desc:!0}]})}if(v)return(0,D.jsx)(ae,{});let De=G===0,$=!f.errors.length&&!h;return(0,D.jsx)(te,{children:(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Hooks`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Manage reusable setup, teardown, and inline hook scripts for this workspace.`})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(d,{children:[(0,D.jsx)(ne,{asChild:!0,children:(0,D.jsx)(m,{variant:`ghost`,size:`icon-sm`,type:`button`,"aria-label":`Keyboard shortcuts`,children:(0,D.jsx)(l,{className:`h-4 w-4`})})}),(0,D.jsx)(oe,{side:`bottom`,className:`p-3`,children:(0,D.jsx)(c,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open hook`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,D.jsxs)(m,{type:`button`,"data-tour-id":`tour-hooks-new`,onClick:()=>e(_.hookNew),children:[(0,D.jsx)(u,{className:`h-4 w-4`}),`Create Hook`]})]})]}),U&&(0,D.jsx)(ye,{title:U.title,body:U.body}),(0,D.jsx)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,D.jsx)(ie,{value:I,onChange:e=>we(e.currentTarget.value),placeholder:`Search hooks`,className:`lg:max-w-sm`,"aria-label":`Search hooks`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,D.jsxs)(o,{value:L||`all`,onValueChange:Te,children:[(0,D.jsx)(i,{className:`w-full sm:w-44`,"aria-label":`Runtime filter`,children:(0,D.jsx)(a,{placeholder:`Runtime`})}),(0,D.jsxs)(r,{children:[(0,D.jsx)(n,{value:`all`,children:`All runtimes`}),pe.map(e=>(0,D.jsx)(n,{value:e,children:C(e).label},e))]})]}),(0,D.jsxs)(o,{value:R||`all`,onValueChange:X,children:[(0,D.jsx)(i,{className:`w-full sm:w-44`,"aria-label":`Health filter`,children:(0,D.jsx)(a,{placeholder:`Health`})}),(0,D.jsxs)(r,{children:[(0,D.jsx)(n,{value:`all`,children:`All health`}),(0,D.jsx)(n,{value:`ready`,children:`Ready`}),(0,D.jsx)(n,{value:`file-missing`,children:`File missing`})]})]})]})]})}),De?(0,D.jsx)(`div`,{"data-tour-id":`tour-hooks-table`,children:(0,D.jsx)(me,{icon:s,title:f.hooks.length===0?`No hooks yet`:`No hooks match your filters`,description:f.hooks.length===0?`Create a hook to add reusable setup, teardown, or inline automation to this workspace.`:`Adjust your search or filters to see more hook records.`,actionLabel:$?`Create Hook`:void 0,onAction:$?()=>e(_.hookNew):void 0})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(S,{"data-tour-id":`tour-hooks-table`,className:`rounded-md border`,children:[(0,D.jsxs)(de,{className:`min-w-full`,children:[(0,D.jsx)(le,{children:(0,D.jsxs)(b,{children:[(0,D.jsx)(y,{className:`w-[40%]`,children:(0,D.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`name`),children:[`Hook`,(0,D.jsx)(t,{className:`h-4 w-4`})]})}),(0,D.jsx)(y,{children:(0,D.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`runtime`),children:[`Runtime`,(0,D.jsx)(t,{className:`h-4 w-4`})]})}),(0,D.jsx)(y,{children:(0,D.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`timeout`),children:[`Timeout / Network`,(0,D.jsx)(t,{className:`h-4 w-4`})]})}),(0,D.jsx)(y,{children:(0,D.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`health`),children:[`Health`,(0,D.jsx)(t,{className:`h-4 w-4`})]})})]})}),(0,D.jsx)(ue,{children:Y.map((e,t)=>{let n=t===E;return(0,D.jsxs)(b,{ref:e=>{F.current[t]=e},"data-hooks-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:be({isActive:n}),onClick:()=>{M(t),Z(e)},onFocus:()=>M(t),onKeyDown:t=>{t.key===`Enter`&&Ee(e,t)},children:[(0,D.jsx)(x,{className:`max-w-0`,children:(0,D.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,D.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,D.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.file})]})}),(0,D.jsx)(x,{children:(0,D.jsx)(ve,{runtime:e.runtime})}),(0,D.jsx)(x,{children:(0,D.jsxs)(`div`,{className:`space-y-1`,children:[(0,D.jsx)(`div`,{className:`text-sm text-foreground`,children:ee(e.timeout)}),(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.network?`Network on`:`Network off`})]})}),(0,D.jsx)(x,{children:(0,D.jsx)(_e,{hook:e})})]},e.id)})})]}),(0,D.jsx)(fe,{orientation:`horizontal`})]}),(0,D.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,D.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Showing `,Se,`-`,Ce,` of `,G]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{M(-1),P(e=>Math.max(e-1,0))},disabled:q===0,children:`Previous`}),(0,D.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{M(-1),P(e=>Math.min(e+1,Math.max(K-1,0)))},disabled:q>=K-1,children:`Next`})]})]})]})]})})}export{M as default};
@@ -1 +1 @@
1
- import{u as e}from"./editor.api2-DEGvZ9jW.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:RegExp(`^\\s*<!--\\s*#region\\b.*-->`),end:RegExp(`^\\s*<!--\\s*#endregion\\b.*-->`)}}},r={defaultToken:``,tokenPostfix:`.html`,ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,`metatag`,`@doctype`],[/<!--/,`comment`,`@comment`],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,[`delimiter`,`tag`,``,`delimiter`]],[/(<)(script)/,[`delimiter`,{token:`tag`,next:`@script`}]],[/(<)(style)/,[`delimiter`,{token:`tag`,next:`@style`}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/</,`delimiter`],[/[^<]+/]],doctype:[[/[^>]+/,`metatag.content`],[/>/,`metatag`,`@pop`]],comment:[[/-->/,`comment`,`@pop`],[/[^-]+/,`comment.content`],[/./,`comment.content`]],otherTag:[[/\/?>/,`delimiter`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],scriptAfterType:[[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/"module"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/'module'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/>/,{token:`delimiter`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]],style:[[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],styleAfterType:[[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/>/,{token:`delimiter`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]]}};export{n as conf,r as language};
1
+ import{u as e}from"./editor.api2-CX0IWJmc.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:RegExp(`^\\s*<!--\\s*#region\\b.*-->`),end:RegExp(`^\\s*<!--\\s*#endregion\\b.*-->`)}}},r={defaultToken:``,tokenPostfix:`.html`,ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,`metatag`,`@doctype`],[/<!--/,`comment`,`@comment`],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,[`delimiter`,`tag`,``,`delimiter`]],[/(<)(script)/,[`delimiter`,{token:`tag`,next:`@script`}]],[/(<)(style)/,[`delimiter`,{token:`tag`,next:`@style`}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/</,`delimiter`],[/[^<]+/]],doctype:[[/[^>]+/,`metatag.content`],[/>/,`metatag`,`@pop`]],comment:[[/-->/,`comment`,`@pop`],[/[^-]+/,`comment.content`],[/./,`comment.content`]],otherTag:[[/\/?>/,`delimiter`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],scriptAfterType:[[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/"module"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/'module'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/>/,{token:`delimiter`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]],style:[[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],styleAfterType:[[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/>/,{token:`delimiter`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]]}};export{n as conf,r as language};
@@ -1 +1 @@
1
- import{u as e}from"./editor.api2-DEGvZ9jW.js";import{t}from"./workers-BbHjH3Kx.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-Bn8JS-MZ.js";var b=120*1e3,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-CQP8QQsS.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};
1
+ import{u as e}from"./editor.api2-CX0IWJmc.js";import{t}from"./workers-Br5uqX4Z.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-CPMJ3OMK.js";var b=120*1e3,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-CQP8QQsS.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};