@vostride/agent-qa-dashboard-ui 0.1.11 → 0.1.12

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 (78) hide show
  1. package/dist/assets/{arrow-up-down-D8UGCR46.js → arrow-up-down-CN-uHgX9.js} +1 -1
  2. package/dist/assets/{badge-Dd058S66.js → badge-DrW2vGVJ.js} +1 -1
  3. package/dist/assets/{batch-action-bar-BlKdJC25.js → batch-action-bar-uEhHVDds.js} +1 -1
  4. package/dist/assets/{circle-alert-Cr31wwud.js → circle-alert-BKX0IIz1.js} +1 -1
  5. package/dist/assets/{circle-x-CbsF-Or-.js → circle-x-yPIxYoz1.js} +1 -1
  6. package/dist/assets/{config-B6eE0o2y.js → config-TRu3J-E7.js} +1 -1
  7. package/dist/assets/{copy-BdD4bkD_.js → copy-Clw3wvSn.js} +1 -1
  8. package/dist/assets/{display-step-4AfU6w4K.js → display-step-NqsJgW_B.js} +1 -1
  9. package/dist/assets/{dist-KjoEChiB.js → dist-BPJgj1d0.js} +1 -1
  10. package/dist/assets/{dist-D9h3nbVK.js → dist-BPheZrD6.js} +1 -1
  11. package/dist/assets/{dist-DrO-WGvP.js → dist-m_OM4Je_.js} +1 -1
  12. package/dist/assets/{empty-state-c1UKljbh.js → empty-state-BTvOA5lp.js} +1 -1
  13. package/dist/assets/{external-link-MKpqbawt.js → external-link-C_uggQOc.js} +1 -1
  14. package/dist/assets/{eye-vXF-W3Sy.js → eye-CZrufbYE.js} +1 -1
  15. package/dist/assets/{file-code-C7vOuS4q.js → file-code-B3iDpJRP.js} +1 -1
  16. package/dist/assets/{file-search-COrO0ndH.js → file-search-DHHwYVza.js} +1 -1
  17. package/dist/assets/{filename-validation-Ccwuaki1.js → filename-validation-4sTTEagx.js} +1 -1
  18. package/dist/assets/{grip-vertical-B4rX3Pd9.js → grip-vertical-A-AANrBM.js} +1 -1
  19. package/dist/assets/{hook-editor-fVte-sFt.js → hook-editor-yhQoi-Ky.js} +1 -1
  20. package/dist/assets/{hook-runtime-CPPjqz70.js → hook-runtime-JF-0oZpz.js} +1 -1
  21. package/dist/assets/{hook-viewer-Ceps9GqL.js → hook-viewer-DIkxp9uJ.js} +1 -1
  22. package/dist/assets/{hooks-BwveYPPu.js → hooks-CDRbjPKv.js} +1 -1
  23. package/dist/assets/{id-badge-5c0D9pZV.js → id-badge-NwZYoNfB.js} +1 -1
  24. package/dist/assets/{index-CZotRLCc.js → index-Bvtm2F6f.js} +2 -2
  25. package/dist/assets/index-CW7tbJhs.css +2 -0
  26. package/dist/assets/{insights-D_d7szDN.js → insights-DuYBsUzB.js} +1 -1
  27. package/dist/assets/{insights-line-grid-DzQiRxUU.js → insights-line-grid-BKOqA-1W.js} +1 -1
  28. package/dist/assets/{lib-CCr9qhea.js → lib-58FyJI_k.js} +1 -1
  29. package/dist/assets/{live-run-BxEaMSEi.js → live-run-ucgeJa3o.js} +1 -1
  30. package/dist/assets/{memory-7vVmoZvP.js → memory-B7nfWNTH.js} +1 -1
  31. package/dist/assets/{memory-product-B30NAtAP.js → memory-product-D1u5V75o.js} +1 -1
  32. package/dist/assets/{monaco-editor-Ba9qdSve.js → monaco-editor-DNT0Mzki.js} +2 -2
  33. package/dist/assets/{monaco-editor-inner-CeD8qR_F.js → monaco-editor-inner-DuCqlGei.js} +1 -1
  34. package/dist/assets/{monaco.contribution-ZpEX2Im1.js → monaco.contribution-LYJB_lCm.js} +2 -2
  35. package/dist/assets/{observation-block-BRa3lkBV.js → observation-block-4AqYhL1h.js} +1 -1
  36. package/dist/assets/{observation-markdown-BJ9B18Mk.js → observation-markdown-Dx_5-T0t.js} +1 -1
  37. package/dist/assets/{pencil-BdoVUAcl.js → pencil-DdRoBrsh.js} +1 -1
  38. package/dist/assets/plus-pXO98OAE.js +1 -0
  39. package/dist/assets/{popover-BAlAEoO4.js → popover-DGZi688D.js} +1 -1
  40. package/dist/assets/{refresh-cw-3zJOKpgR.js → refresh-cw-C_0AkMuu.js} +1 -1
  41. package/dist/assets/{resizable-BuOu2RfX.js → resizable-BGEcNRZO.js} +1 -1
  42. package/dist/assets/{run-detail-BkmoKeU2.js → run-detail-3tlB8sew.js} +1 -1
  43. package/dist/assets/{runs-Bs16pBe9.js → runs-CywxkFZ6.js} +1 -1
  44. package/dist/assets/{scroll-area-48uajHeh.js → scroll-area-CnATfQoe.js} +1 -1
  45. package/dist/assets/{select-B2_tSMl_.js → select-CeVjgiKI.js} +1 -1
  46. package/dist/assets/{shortcut-hints-BnEYaq1r.js → shortcut-hints-Bs5o743i.js} +1 -1
  47. package/dist/assets/{split-button-C54F4hz3.js → split-button-DcY8ames.js} +1 -1
  48. package/dist/assets/square-D71GHEET.js +1 -0
  49. package/dist/assets/{step-name-pills-hCVbMRBe.js → step-name-pills-Dta5ZGMZ.js} +1 -1
  50. package/dist/assets/{suite-editor-HxXY0n_h.js → suite-editor-Bnf6KMna.js} +1 -1
  51. package/dist/assets/{suite-navbar-DzgJZNSk.js → suite-navbar-PStktQ6j.js} +1 -1
  52. package/dist/assets/{suite-viewer-DX-uI0KI.js → suite-viewer-BD74MY_X.js} +1 -1
  53. package/dist/assets/{suites-BrCm410e.js → suites-BvfwzFEd.js} +1 -1
  54. package/dist/assets/{switch-C7U17ptQ.js → switch-ByV5GV5L.js} +1 -1
  55. package/dist/assets/{tab-console-W4FDWhGS.js → tab-console-BQFkZJG_.js} +1 -1
  56. package/dist/assets/{table-BGMQ2E9D.js → table-D08QBBt4.js} +1 -1
  57. package/dist/assets/{tabs-CWnvxa-h.js → tabs-DrB_Acb3.js} +1 -1
  58. package/dist/assets/{test-editor-C7jMc_bm.js → test-editor-w7ZQPYgH.js} +1 -1
  59. package/dist/assets/{test-navbar-1FE5zQJP.js → test-navbar-DoHKAy1p.js} +1 -1
  60. package/dist/assets/{test-viewer-yi44-64J.js → test-viewer-BwUQNVa4.js} +1 -1
  61. package/dist/assets/{tests-D9iNxwue.js → tests-B5ELKDH2.js} +1 -1
  62. package/dist/assets/{tests-suites-table-widths-C3pXnpiW.js → tests-suites-table-widths-DNWnkAjA.js} +1 -1
  63. package/dist/assets/{textarea-C-0LUFGZ.js → textarea-DChEVvwQ.js} +1 -1
  64. package/dist/assets/{trash-2-Cj6kkRf4.js → trash-2-7P1Dp87k.js} +1 -1
  65. package/dist/assets/{tsMode-fizT3CAG.js → tsMode-DEhRZlmT.js} +1 -1
  66. package/dist/assets/{use-hook-run-session-RvECpdZN.js → use-hook-run-session-x-d_iodT.js} +1 -1
  67. package/dist/assets/{use-keyboard-shortcuts-BTppBDf3.js → use-keyboard-shortcuts-EAppuiKO.js} +1 -1
  68. package/dist/assets/{use-page-title-BeSr97vd.js → use-page-title-B1t9-5_U.js} +1 -1
  69. package/dist/assets/use-run-status-favicon-D69P46yH.js +1 -0
  70. package/dist/assets/{use-selection-queue-B7ZRHEAV.js → use-selection-queue-BboTDies.js} +1 -1
  71. package/dist/assets/{viewer-url-state-aAMA3-2e.js → viewer-url-state-6mOK5_sY.js} +1 -1
  72. package/dist/assets/{zap-oUNJUGP6.js → zap-KFJmkY3Y.js} +1 -1
  73. package/dist/index.html +2 -2
  74. package/package.json +2 -2
  75. package/dist/assets/index-cLLRFOsN.css +0 -2
  76. package/dist/assets/plus-BDA9KiOF.js +0 -1
  77. package/dist/assets/square-lmyO8EeE.js +0 -1
  78. package/dist/assets/use-run-status-favicon-ClaOG7BI.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{Qn as t,pr as n}from"./index-CZotRLCc.js";var r=e(n(),1),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=r.createContext&&r.createContext(i),o=[`attr`,`size`,`title`];function s(e,t){if(e==null)return{};var n,r,i=c(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=m(e,`string`);return typeof t==`symbol`?t:t+``}function m(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function h(e){return e&&e.map((e,t)=>r.createElement(e.tag,d({key:t},e.attr),h(e.child)))}function g(e){return t=>r.createElement(_,l({attr:d({},e.attr)},t),h(e.child))}function _(e){var t=t=>{var{attr:n,size:i,title:a}=e,c=s(e,o),u=i||t.size||`1em`,f;return t.className&&(f=t.className),e.className&&(f=(f?f+` `:``)+e.className),r.createElement(`svg`,l({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,c,{className:f,style:d(d({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:`http://www.w3.org/2000/svg`}),a&&r.createElement(`title`,null,a),e.children)};return a===void 0?t(i):r.createElement(a.Consumer,null,e=>t(e))}function v(e){return g({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 y(e){return g({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 b(e){return g({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 x=t();function S({className:e}){return(0,x.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,children:(0,x.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 C=[`node`,`bun`,`python`,`bash`],w={node:b,bun:S,python:y,bash:v},T={node:{label:`Node.js`,shortLabel:`JS`,icon:w.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(`
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{Qn as t,pr as n}from"./index-Bvtm2F6f.js";var r=e(n(),1),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=r.createContext&&r.createContext(i),o=[`attr`,`size`,`title`];function s(e,t){if(e==null)return{};var n,r,i=c(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=m(e,`string`);return typeof t==`symbol`?t:t+``}function m(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function h(e){return e&&e.map((e,t)=>r.createElement(e.tag,d({key:t},e.attr),h(e.child)))}function g(e){return t=>r.createElement(_,l({attr:d({},e.attr)},t),h(e.child))}function _(e){var t=t=>{var{attr:n,size:i,title:a}=e,c=s(e,o),u=i||t.size||`1em`,f;return t.className&&(f=t.className),e.className&&(f=(f?f+` `:``)+e.className),r.createElement(`svg`,l({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,c,{className:f,style:d(d({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:`http://www.w3.org/2000/svg`}),a&&r.createElement(`title`,null,a),e.children)};return a===void 0?t(i):r.createElement(a.Consumer,null,e=>t(e))}function v(e){return g({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 y(e){return g({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 b(e){return g({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 x=t();function S({className:e}){return(0,x.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,children:(0,x.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 C=[`node`,`bun`,`python`,`bash`],w={node:b,bun:S,python:y,bash:v},T={node:{label:`Node.js`,shortLabel:`JS`,icon:w.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
2
  `)},bun:{label:`Bun`,shortLabel:`BUN`,icon:w.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
3
  `)},python:{label:`Python`,shortLabel:`PY`,icon:w.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
4
  `)},bash:{label:`Bash`,shortLabel:`SH`,icon:w.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(`
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-Ba9qdSve.js";import{t as n}from"./use-page-title-BeSr97vd.js";import{t as ee}from"./scroll-area-48uajHeh.js";import{$n as r,A as te,Fn as i,G as ne,Jn as a,Nt as re,Qn as o,S as s,Wt as c,Yt as ie,cr as ae,lr as oe,pr as l,qt as se,r as ce,ur as le}from"./index-CZotRLCc.js";import{t as u}from"./badge-Dd058S66.js";import{i as d,r as f}from"./hook-runtime-CPPjqz70.js";import{a as p,i as m,n as h,o as g,r as _,t as ue}from"./use-hook-run-session-RvECpdZN.js";import{t as v}from"./empty-state-c1UKljbh.js";import{t as de}from"./use-keyboard-shortcuts-BTppBDf3.js";var fe=a(`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(l(),1),b=o(),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}=oe(),a=ae(),[o,l]=le(),u=e??``,x=ie(),[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`),l(e,{replace:!0})}},[o,l]),(0,y.useEffect)(()=>{let e=!1;return D(!0),k(!1),j(null),ne(u).then(t=>{e||E(t)}).catch(t=>{if(!e){if(E(null),t instanceof s&&t.status===404){k(!0);return}j(t instanceof Error?t.message:`Failed to load hook`)}}).finally(()=>{e||D(!1)}),()=>{e=!0}},[u]),n(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 te(u,{force:e}),a(r.hooks)}catch(e){if(e instanceof s){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,a]),Q=r.hookEdit(u);if(de({e:()=>{S&&a(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)(ce,{});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:()=>a(r.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:()=>a(r.hooks)});let $=(0,b.jsxs)(`div`,{className:c(`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:se(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:c(`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:c(`rounded-sm`,x?`h-[360px] min-h-[320px]`:`h-full min-h-[300px] flex-1`)}):(0,b.jsx)(`div`,{className:c(`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)(ee,{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:r.hookView(S.hook.id),editHref:r.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};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-DNT0Mzki.js";import{t as n}from"./use-page-title-B1t9-5_U.js";import{t as ee}from"./scroll-area-CnATfQoe.js";import{$n as r,A as te,Fn as i,G as ne,Jn as a,Nt as re,Qn as o,S as s,Wt as c,Yt as ie,cr as ae,lr as oe,pr as l,qt as se,r as ce,ur as le}from"./index-Bvtm2F6f.js";import{t as u}from"./badge-DrW2vGVJ.js";import{i as d,r as f}from"./hook-runtime-JF-0oZpz.js";import{a as p,i as m,n as h,o as g,r as _,t as ue}from"./use-hook-run-session-x-d_iodT.js";import{t as v}from"./empty-state-BTvOA5lp.js";import{t as de}from"./use-keyboard-shortcuts-EAppuiKO.js";var fe=a(`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(l(),1),b=o(),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}=oe(),a=ae(),[o,l]=le(),u=e??``,x=ie(),[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`),l(e,{replace:!0})}},[o,l]),(0,y.useEffect)(()=>{let e=!1;return D(!0),k(!1),j(null),ne(u).then(t=>{e||E(t)}).catch(t=>{if(!e){if(E(null),t instanceof s&&t.status===404){k(!0);return}j(t instanceof Error?t.message:`Failed to load hook`)}}).finally(()=>{e||D(!1)}),()=>{e=!0}},[u]),n(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 te(u,{force:e}),a(r.hooks)}catch(e){if(e instanceof s){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,a]),Q=r.hookEdit(u);if(de({e:()=>{S&&a(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)(ce,{});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:()=>a(r.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:()=>a(r.hooks)});let $=(0,b.jsxs)(`div`,{className:c(`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:se(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:c(`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:c(`rounded-sm`,x?`h-[360px] min-h-[320px]`:`h-full min-h-[300px] flex-1`)}):(0,b.jsx)(`div`,{className:c(`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)(ee,{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:r.hookView(S.hook.id),editHref:r.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};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-D8UGCR46.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-B2_tSMl_.js";import{t as s}from"./file-code-C7vOuS4q.js";import{n as c,r as l}from"./shortcut-hints-BnEYaq1r.js";import{t as u}from"./plus-BDA9KiOF.js";import{t as d}from"./use-page-title-BeSr97vd.js";import{n as ee,t as te}from"./scroll-area-48uajHeh.js";import{$n as f,Ht as ne,Mt as re,Nt as ie,Pt as ae,Qn as p,Ut as m,W as oe,Wt as h,a as se,cr as ce,jt as le,pr as g,qt as _,ur as v}from"./index-CZotRLCc.js";import{t as y}from"./badge-Dd058S66.js";import{a as ue,i as b,n as de,o as x,r as S,t as C}from"./table-BGMQ2E9D.js";import{r as w,t as fe}from"./hook-runtime-CPPjqz70.js";import{t as pe}from"./empty-state-c1UKljbh.js";import{t as me}from"./use-keyboard-shortcuts-BTppBDf3.js";var T=e(g(),1),E=new Set([`asc`,`desc`]);function D(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 he(){let[e,t]=v(),n=e.get(`search`)??``,r=e.get(`runtime`)??``,i=e.get(`health`)??``,a=e.get(`sort`)??``,o=e.get(`order`)??`asc`,s=E.has(o)?o:`asc`,c=(0,T.useMemo)(()=>a?[{id:a,desc:s===`desc`}]:[],[a,s]),l=(0,T.useRef)(c);l.current=c;let u=(0,T.useMemo)(()=>({search:n,runtime:r,health:i,sort:a,order:s}),[n,r,i,a,s]);(0,T.useEffect)(()=>{let n=D(u);n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,u]);let d=(0,T.useCallback)(e=>{t(D({...u,...e}),{replace:!0})},[t,u]);return{search:n,runtime:r,health:i,sort:a,order:s,sorting:c,onSortingChange:(0,T.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,T.useCallback)(e=>d({search:e}),[d]),setRuntime:(0,T.useCallback)(e=>d({runtime:e}),[d]),setHealth:(0,T.useCallback)(e=>d({health:e}),[d])}}var O=p(),k={hooks:[],filePath:null,errors:[],missing:!1},A=50;function j(e){return e.fileMissing?`file-missing`:`ready`}function M(e){return e===`file-missing`?`File missing`:`Ready`}function ge({hook:e}){return j(e)===`file-missing`?(0,O.jsx)(y,{variant:`outline`,className:`border-amber-500/30 text-amber-600`,children:`File missing`}):(0,O.jsx)(y,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600`,children:`Ready`})}function _e({runtime:e}){let t=w(e),n=t.icon;return(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,O.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,O.jsx)(`span`,{children:t.label})]})}function ve({title:e,body:t}){return(0,O.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm`,children:[(0,O.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,O.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t})]})}function ye({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 N(){d(`Hooks`);let e=ce(),[p,h]=(0,T.useState)(k),[g,v]=(0,T.useState)(null),[y,E]=(0,T.useState)(!0),[D,N]=(0,T.useState)(-1),[P,F]=(0,T.useState)(0),I=(0,T.useRef)([]),{search:L,runtime:R,health:z,sorting:B,onSortingChange:be,setSearch:V,setRuntime:H,setHealth:U}=he();(0,T.useEffect)(()=>{let e=!1;return oe().then(t=>{e||(h(t),v(null))}).catch(t=>{e||(h(k),v(t instanceof Error?t.message:`Failed to load hooks`))}).finally(()=>{e||E(!1)}),()=>{e=!0}},[]);let W=(0,T.useMemo)(()=>g?{title:`Hooks could not be loaded`,body:g}:p.missing?{title:`${p.filePath??`configured hooks file`} not found`,body:`Create the first hook to generate the configured hooks file for this workspace.`}:p.errors.length>0?{title:`Hooks could not be loaded from ${p.filePath??`configured hooks file`}`,body:p.errors[0]??`Unknown registry error`}:null,[p.errors,p.filePath,p.missing,g]),G=(0,T.useMemo)(()=>{let e=L.trim().toLowerCase(),t=B[0],n=p.hooks.filter(t=>R&&t.runtime!==R||z&&j(t)!==z?!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=w(e.runtime).label.localeCompare(w(n.runtime).label);break;case`timeout`:r=e.timeout-n.timeout;break;case`health`:r=M(j(e)).localeCompare(M(j(n)));break;default:r=e.name.localeCompare(n.name);break}return t.desc?r*-1:r}):n},[p.hooks,z,R,L,B]),K=G.length,q=Math.ceil(K/A),J=q>0?Math.min(P,q-1):0,Y=J*A,X=G.slice(Y,Y+A),xe=K>0?Y+1:0,Se=Math.min(Y+A,K);(0,T.useEffect)(()=>{P!==J&&F(J)},[P,J]);let Ce=(0,T.useCallback)(e=>{N(-1),F(0),V(e)},[V]),we=(0,T.useCallback)(e=>{N(-1),F(0),H(e===`all`?``:e)},[H]),Te=(0,T.useCallback)(e=>{N(-1),F(0),U(e===`all`?``:e)},[U]),Z=(0,T.useCallback)((t,n=!1)=>{let r=f.hookView(t.id);if(n){window.open(r,`_blank`);return}e(r)},[e]);me((0,T.useMemo)(()=>{let e=()=>N(e=>Math.min(e+1,X.length-1)),t=()=>N(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{D<0||!X[D]||Z(X[D],e.metaKey||e.ctrlKey)}}},[Z,D,X])),(0,T.useEffect)(()=>{if(X.length===0){D!==-1&&N(-1);return}D>=X.length&&N(X.length-1)},[D,X.length]),(0,T.useEffect)(()=>{if(D<0)return;let e=I.current[D];e&&document.activeElement!==e&&e.focus()},[D,X.length]);let Ee=(0,T.useCallback)((e,t)=>{t&&t.preventDefault(),Z(e,!!(t&&(t.metaKey||t.ctrlKey)))},[Z]);function Q(e){N(-1),F(0),be(t=>{let n=t[0];return!n||n.id!==e?[{id:e,desc:!1}]:n.desc?[]:[{id:e,desc:!0}]})}if(y)return(0,O.jsx)(se,{});let De=K===0,$=!p.errors.length&&!g;return(0,O.jsx)(ie,{children:(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Hooks`}),(0,O.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Manage reusable setup, teardown, and inline hook scripts for this workspace.`})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(le,{children:[(0,O.jsx)(ae,{asChild:!0,children:(0,O.jsx)(m,{variant:`ghost`,size:`icon-sm`,type:`button`,"aria-label":`Keyboard shortcuts`,children:(0,O.jsx)(l,{className:`h-4 w-4`})})}),(0,O.jsx)(re,{side:`bottom`,className:`p-3`,children:(0,O.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,O.jsxs)(m,{type:`button`,onClick:()=>e(f.hookNew),children:[(0,O.jsx)(u,{className:`h-4 w-4`}),`Create Hook`]})]})]}),W&&(0,O.jsx)(ve,{title:W.title,body:W.body}),(0,O.jsx)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,O.jsx)(ne,{value:L,onChange:e=>Ce(e.currentTarget.value),placeholder:`Search hooks`,className:`lg:max-w-sm`,"aria-label":`Search hooks`}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,O.jsxs)(o,{value:R||`all`,onValueChange:we,children:[(0,O.jsx)(i,{className:`w-full sm:w-44`,"aria-label":`Runtime filter`,children:(0,O.jsx)(a,{placeholder:`Runtime`})}),(0,O.jsxs)(r,{children:[(0,O.jsx)(n,{value:`all`,children:`All runtimes`}),fe.map(e=>(0,O.jsx)(n,{value:e,children:w(e).label},e))]})]}),(0,O.jsxs)(o,{value:z||`all`,onValueChange:Te,children:[(0,O.jsx)(i,{className:`w-full sm:w-44`,"aria-label":`Health filter`,children:(0,O.jsx)(a,{placeholder:`Health`})}),(0,O.jsxs)(r,{children:[(0,O.jsx)(n,{value:`all`,children:`All health`}),(0,O.jsx)(n,{value:`ready`,children:`Ready`}),(0,O.jsx)(n,{value:`file-missing`,children:`File missing`})]})]})]})]})}),De?(0,O.jsx)(pe,{icon:s,title:p.hooks.length===0?`No hooks yet`:`No hooks match your filters`,description:p.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(f.hookNew):void 0}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(te,{className:`rounded-md border`,children:[(0,O.jsxs)(C,{className:`min-w-full`,children:[(0,O.jsx)(ue,{children:(0,O.jsxs)(x,{children:[(0,O.jsx)(b,{className:`w-[40%]`,children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`name`),children:[`Hook`,(0,O.jsx)(t,{className:`h-4 w-4`})]})}),(0,O.jsx)(b,{children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`runtime`),children:[`Runtime`,(0,O.jsx)(t,{className:`h-4 w-4`})]})}),(0,O.jsx)(b,{children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`timeout`),children:[`Timeout / Network`,(0,O.jsx)(t,{className:`h-4 w-4`})]})}),(0,O.jsx)(b,{children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`health`),children:[`Health`,(0,O.jsx)(t,{className:`h-4 w-4`})]})})]})}),(0,O.jsx)(de,{children:X.map((e,t)=>{let n=t===D;return(0,O.jsxs)(x,{ref:e=>{I.current[t]=e},"data-hooks-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:ye({isActive:n}),onClick:()=>{N(t),Z(e)},onFocus:()=>N(t),onKeyDown:t=>{t.key===`Enter`&&Ee(e,t)},children:[(0,O.jsx)(S,{className:`max-w-0`,children:(0,O.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,O.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,O.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.file})]})}),(0,O.jsx)(S,{children:(0,O.jsx)(_e,{runtime:e.runtime})}),(0,O.jsx)(S,{children:(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(`div`,{className:`text-sm text-foreground`,children:_(e.timeout)}),(0,O.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.network?`Network on`:`Network off`})]})}),(0,O.jsx)(S,{children:(0,O.jsx)(ge,{hook:e})})]},e.id)})})]}),(0,O.jsx)(ee,{orientation:`horizontal`})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,O.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Showing `,xe,`-`,Se,` of `,K]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{N(-1),F(e=>Math.max(e-1,0))},disabled:J===0,children:`Previous`}),(0,O.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{N(-1),F(e=>Math.min(e+1,Math.max(q-1,0)))},disabled:J>=q-1,children:`Next`})]})]})]})]})})}export{N as default};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-CN-uHgX9.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-CeVjgiKI.js";import{t as s}from"./file-code-B3iDpJRP.js";import{n as c,r as l}from"./shortcut-hints-Bs5o743i.js";import{t as u}from"./plus-pXO98OAE.js";import{t as d}from"./use-page-title-B1t9-5_U.js";import{n as ee,t as te}from"./scroll-area-CnATfQoe.js";import{$n as f,Ht as ne,Mt as re,Nt as ie,Pt as ae,Qn as p,Ut as m,W as oe,Wt as h,a as se,cr as ce,jt as le,pr as g,qt as _,ur as v}from"./index-Bvtm2F6f.js";import{t as y}from"./badge-DrW2vGVJ.js";import{a as ue,i as b,n as de,o as x,r as S,t as C}from"./table-D08QBBt4.js";import{r as w,t as fe}from"./hook-runtime-JF-0oZpz.js";import{t as pe}from"./empty-state-BTvOA5lp.js";import{t as me}from"./use-keyboard-shortcuts-EAppuiKO.js";var T=e(g(),1),E=new Set([`asc`,`desc`]);function D(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 he(){let[e,t]=v(),n=e.get(`search`)??``,r=e.get(`runtime`)??``,i=e.get(`health`)??``,a=e.get(`sort`)??``,o=e.get(`order`)??`asc`,s=E.has(o)?o:`asc`,c=(0,T.useMemo)(()=>a?[{id:a,desc:s===`desc`}]:[],[a,s]),l=(0,T.useRef)(c);l.current=c;let u=(0,T.useMemo)(()=>({search:n,runtime:r,health:i,sort:a,order:s}),[n,r,i,a,s]);(0,T.useEffect)(()=>{let n=D(u);n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,u]);let d=(0,T.useCallback)(e=>{t(D({...u,...e}),{replace:!0})},[t,u]);return{search:n,runtime:r,health:i,sort:a,order:s,sorting:c,onSortingChange:(0,T.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,T.useCallback)(e=>d({search:e}),[d]),setRuntime:(0,T.useCallback)(e=>d({runtime:e}),[d]),setHealth:(0,T.useCallback)(e=>d({health:e}),[d])}}var O=p(),k={hooks:[],filePath:null,errors:[],missing:!1},A=50;function j(e){return e.fileMissing?`file-missing`:`ready`}function M(e){return e===`file-missing`?`File missing`:`Ready`}function ge({hook:e}){return j(e)===`file-missing`?(0,O.jsx)(y,{variant:`outline`,className:`border-amber-500/30 text-amber-600`,children:`File missing`}):(0,O.jsx)(y,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600`,children:`Ready`})}function _e({runtime:e}){let t=w(e),n=t.icon;return(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,O.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,O.jsx)(`span`,{children:t.label})]})}function ve({title:e,body:t}){return(0,O.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm`,children:[(0,O.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,O.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t})]})}function ye({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 N(){d(`Hooks`);let e=ce(),[p,h]=(0,T.useState)(k),[g,v]=(0,T.useState)(null),[y,E]=(0,T.useState)(!0),[D,N]=(0,T.useState)(-1),[P,F]=(0,T.useState)(0),I=(0,T.useRef)([]),{search:L,runtime:R,health:z,sorting:B,onSortingChange:be,setSearch:V,setRuntime:H,setHealth:U}=he();(0,T.useEffect)(()=>{let e=!1;return oe().then(t=>{e||(h(t),v(null))}).catch(t=>{e||(h(k),v(t instanceof Error?t.message:`Failed to load hooks`))}).finally(()=>{e||E(!1)}),()=>{e=!0}},[]);let W=(0,T.useMemo)(()=>g?{title:`Hooks could not be loaded`,body:g}:p.missing?{title:`${p.filePath??`configured hooks file`} not found`,body:`Create the first hook to generate the configured hooks file for this workspace.`}:p.errors.length>0?{title:`Hooks could not be loaded from ${p.filePath??`configured hooks file`}`,body:p.errors[0]??`Unknown registry error`}:null,[p.errors,p.filePath,p.missing,g]),G=(0,T.useMemo)(()=>{let e=L.trim().toLowerCase(),t=B[0],n=p.hooks.filter(t=>R&&t.runtime!==R||z&&j(t)!==z?!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=w(e.runtime).label.localeCompare(w(n.runtime).label);break;case`timeout`:r=e.timeout-n.timeout;break;case`health`:r=M(j(e)).localeCompare(M(j(n)));break;default:r=e.name.localeCompare(n.name);break}return t.desc?r*-1:r}):n},[p.hooks,z,R,L,B]),K=G.length,q=Math.ceil(K/A),J=q>0?Math.min(P,q-1):0,Y=J*A,X=G.slice(Y,Y+A),xe=K>0?Y+1:0,Se=Math.min(Y+A,K);(0,T.useEffect)(()=>{P!==J&&F(J)},[P,J]);let Ce=(0,T.useCallback)(e=>{N(-1),F(0),V(e)},[V]),we=(0,T.useCallback)(e=>{N(-1),F(0),H(e===`all`?``:e)},[H]),Te=(0,T.useCallback)(e=>{N(-1),F(0),U(e===`all`?``:e)},[U]),Z=(0,T.useCallback)((t,n=!1)=>{let r=f.hookView(t.id);if(n){window.open(r,`_blank`);return}e(r)},[e]);me((0,T.useMemo)(()=>{let e=()=>N(e=>Math.min(e+1,X.length-1)),t=()=>N(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{D<0||!X[D]||Z(X[D],e.metaKey||e.ctrlKey)}}},[Z,D,X])),(0,T.useEffect)(()=>{if(X.length===0){D!==-1&&N(-1);return}D>=X.length&&N(X.length-1)},[D,X.length]),(0,T.useEffect)(()=>{if(D<0)return;let e=I.current[D];e&&document.activeElement!==e&&e.focus()},[D,X.length]);let Ee=(0,T.useCallback)((e,t)=>{t&&t.preventDefault(),Z(e,!!(t&&(t.metaKey||t.ctrlKey)))},[Z]);function Q(e){N(-1),F(0),be(t=>{let n=t[0];return!n||n.id!==e?[{id:e,desc:!1}]:n.desc?[]:[{id:e,desc:!0}]})}if(y)return(0,O.jsx)(se,{});let De=K===0,$=!p.errors.length&&!g;return(0,O.jsx)(ie,{children:(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Hooks`}),(0,O.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Manage reusable setup, teardown, and inline hook scripts for this workspace.`})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(le,{children:[(0,O.jsx)(ae,{asChild:!0,children:(0,O.jsx)(m,{variant:`ghost`,size:`icon-sm`,type:`button`,"aria-label":`Keyboard shortcuts`,children:(0,O.jsx)(l,{className:`h-4 w-4`})})}),(0,O.jsx)(re,{side:`bottom`,className:`p-3`,children:(0,O.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,O.jsxs)(m,{type:`button`,onClick:()=>e(f.hookNew),children:[(0,O.jsx)(u,{className:`h-4 w-4`}),`Create Hook`]})]})]}),W&&(0,O.jsx)(ve,{title:W.title,body:W.body}),(0,O.jsx)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,O.jsx)(ne,{value:L,onChange:e=>Ce(e.currentTarget.value),placeholder:`Search hooks`,className:`lg:max-w-sm`,"aria-label":`Search hooks`}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,O.jsxs)(o,{value:R||`all`,onValueChange:we,children:[(0,O.jsx)(i,{className:`w-full sm:w-44`,"aria-label":`Runtime filter`,children:(0,O.jsx)(a,{placeholder:`Runtime`})}),(0,O.jsxs)(r,{children:[(0,O.jsx)(n,{value:`all`,children:`All runtimes`}),fe.map(e=>(0,O.jsx)(n,{value:e,children:w(e).label},e))]})]}),(0,O.jsxs)(o,{value:z||`all`,onValueChange:Te,children:[(0,O.jsx)(i,{className:`w-full sm:w-44`,"aria-label":`Health filter`,children:(0,O.jsx)(a,{placeholder:`Health`})}),(0,O.jsxs)(r,{children:[(0,O.jsx)(n,{value:`all`,children:`All health`}),(0,O.jsx)(n,{value:`ready`,children:`Ready`}),(0,O.jsx)(n,{value:`file-missing`,children:`File missing`})]})]})]})]})}),De?(0,O.jsx)(pe,{icon:s,title:p.hooks.length===0?`No hooks yet`:`No hooks match your filters`,description:p.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(f.hookNew):void 0}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(te,{className:`rounded-md border`,children:[(0,O.jsxs)(C,{className:`min-w-full`,children:[(0,O.jsx)(ue,{children:(0,O.jsxs)(x,{children:[(0,O.jsx)(b,{className:`w-[40%]`,children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`name`),children:[`Hook`,(0,O.jsx)(t,{className:`h-4 w-4`})]})}),(0,O.jsx)(b,{children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`runtime`),children:[`Runtime`,(0,O.jsx)(t,{className:`h-4 w-4`})]})}),(0,O.jsx)(b,{children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`timeout`),children:[`Timeout / Network`,(0,O.jsx)(t,{className:`h-4 w-4`})]})}),(0,O.jsx)(b,{children:(0,O.jsxs)(m,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`health`),children:[`Health`,(0,O.jsx)(t,{className:`h-4 w-4`})]})})]})}),(0,O.jsx)(de,{children:X.map((e,t)=>{let n=t===D;return(0,O.jsxs)(x,{ref:e=>{I.current[t]=e},"data-hooks-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:ye({isActive:n}),onClick:()=>{N(t),Z(e)},onFocus:()=>N(t),onKeyDown:t=>{t.key===`Enter`&&Ee(e,t)},children:[(0,O.jsx)(S,{className:`max-w-0`,children:(0,O.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,O.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,O.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.file})]})}),(0,O.jsx)(S,{children:(0,O.jsx)(_e,{runtime:e.runtime})}),(0,O.jsx)(S,{children:(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(`div`,{className:`text-sm text-foreground`,children:_(e.timeout)}),(0,O.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.network?`Network on`:`Network off`})]})}),(0,O.jsx)(S,{children:(0,O.jsx)(ge,{hook:e})})]},e.id)})})]}),(0,O.jsx)(ee,{orientation:`horizontal`})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,O.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Showing `,xe,`-`,Se,` of `,K]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{N(-1),F(e=>Math.max(e-1,0))},disabled:J===0,children:`Previous`}),(0,O.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{N(-1),F(e=>Math.min(e+1,Math.max(q-1,0)))},disabled:J>=q-1,children:`Next`})]})]})]})]})})}export{N as default};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{u as t}from"./select-B2_tSMl_.js";import{t as n}from"./copy-BdD4bkD_.js";import{t as r}from"./grip-vertical-B4rX3Pd9.js";import{t as i}from"./plus-BDA9KiOF.js";import{a}from"./dist-DrO-WGvP.js";import{Jn as o,Mt as s,Nn as c,Pt as l,Qn as u,Ut as d,V as f,W as p,Wt as m,ct as h,fr as g,jt as _,pr as v}from"./index-CZotRLCc.js";import{r as y,t as b}from"./step-name-pills-hCVbMRBe.js";var x=o(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),S=o(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),C=e(g()),w=e(v());function T(){var e=[...arguments];return(0,w.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var E=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ee(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function te(e){return`nodeType`in e}function D(e){return e?ee(e)?e:te(e)?e.ownerDocument?.defaultView??window:window:window}function O(e){let{Document:t}=D(e);return e instanceof t}function ne(e){return ee(e)?!1:e instanceof D(e).HTMLElement}function re(e){return e instanceof D(e).SVGElement}function k(e){return e?ee(e)?e.document:te(e)?O(e)?e:ne(e)||re(e)?e.ownerDocument:document:document:document}var A=E?w.useLayoutEffect:w.useEffect;function ie(e){let t=(0,w.useRef)(e);return A(()=>{t.current=e}),(0,w.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function ae(){let e=(0,w.useRef)(null);return[(0,w.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,w.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function oe(e,t){t===void 0&&(t=[e]);let n=(0,w.useRef)(e);return A(()=>{n.current!==e&&(n.current=e)},t),n}function j(e,t){let n=(0,w.useRef)();return(0,w.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function se(e){let t=ie(e),n=(0,w.useRef)(null);return[n,(0,w.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function ce(e){let t=(0,w.useRef)();return(0,w.useEffect)(()=>{t.current=e},[e]),t.current}var M={};function le(e,t){return(0,w.useMemo)(()=>{if(t)return t;let n=M[e]==null?0:M[e]+1;return M[e]=n,e+`-`+n},[e,t])}function ue(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var N=ue(1),P=ue(-1);function F(e){return`clientX`in e&&`clientY`in e}function I(e){if(!e)return!1;let{KeyboardEvent:t}=D(e.target);return t&&e instanceof t}function de(e){if(!e)return!1;let{TouchEvent:t}=D(e.target);return t&&e instanceof t}function fe(e){if(de(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return F(e)?{x:e.clientX,y:e.clientY}:null}var L=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[L.Translate.toString(e),L.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),pe=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function me(e){return e.matches(pe)?e:e.querySelector(pe)}var he={display:`none`};function ge(e){let{id:t,value:n}=e;return w.createElement(`div`,{id:t,style:he},n)}function _e(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return w.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function ve(){let[e,t]=(0,w.useState)(``);return{announce:(0,w.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ye=(0,w.createContext)(null);function be(e){let t=(0,w.useContext)(ye);(0,w.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function xe(){let[e]=(0,w.useState)(()=>new Set),t=(0,w.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,w.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Se={draggable:`
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{u as t}from"./select-CeVjgiKI.js";import{t as n}from"./copy-Clw3wvSn.js";import{t as r}from"./grip-vertical-A-AANrBM.js";import{t as i}from"./plus-pXO98OAE.js";import{a}from"./dist-m_OM4Je_.js";import{Jn as o,Mt as s,Nn as c,Pt as l,Qn as u,Ut as d,V as f,W as p,Wt as m,ct as h,fr as g,jt as _,pr as v}from"./index-Bvtm2F6f.js";import{r as y,t as b}from"./step-name-pills-Dta5ZGMZ.js";var x=o(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),S=o(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),C=e(g()),w=e(v());function T(){var e=[...arguments];return(0,w.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var E=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ee(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function te(e){return`nodeType`in e}function D(e){return e?ee(e)?e:te(e)?e.ownerDocument?.defaultView??window:window:window}function O(e){let{Document:t}=D(e);return e instanceof t}function ne(e){return ee(e)?!1:e instanceof D(e).HTMLElement}function re(e){return e instanceof D(e).SVGElement}function k(e){return e?ee(e)?e.document:te(e)?O(e)?e:ne(e)||re(e)?e.ownerDocument:document:document:document}var A=E?w.useLayoutEffect:w.useEffect;function ie(e){let t=(0,w.useRef)(e);return A(()=>{t.current=e}),(0,w.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function ae(){let e=(0,w.useRef)(null);return[(0,w.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,w.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function oe(e,t){t===void 0&&(t=[e]);let n=(0,w.useRef)(e);return A(()=>{n.current!==e&&(n.current=e)},t),n}function j(e,t){let n=(0,w.useRef)();return(0,w.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function se(e){let t=ie(e),n=(0,w.useRef)(null);return[n,(0,w.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function ce(e){let t=(0,w.useRef)();return(0,w.useEffect)(()=>{t.current=e},[e]),t.current}var M={};function le(e,t){return(0,w.useMemo)(()=>{if(t)return t;let n=M[e]==null?0:M[e]+1;return M[e]=n,e+`-`+n},[e,t])}function ue(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var N=ue(1),P=ue(-1);function F(e){return`clientX`in e&&`clientY`in e}function I(e){if(!e)return!1;let{KeyboardEvent:t}=D(e.target);return t&&e instanceof t}function de(e){if(!e)return!1;let{TouchEvent:t}=D(e.target);return t&&e instanceof t}function fe(e){if(de(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return F(e)?{x:e.clientX,y:e.clientY}:null}var L=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[L.Translate.toString(e),L.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),pe=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function me(e){return e.matches(pe)?e:e.querySelector(pe)}var he={display:`none`};function ge(e){let{id:t,value:n}=e;return w.createElement(`div`,{id:t,style:he},n)}function _e(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return w.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function ve(){let[e,t]=(0,w.useState)(``);return{announce:(0,w.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ye=(0,w.createContext)(null);function be(e){let t=(0,w.useContext)(ye);(0,w.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function xe(){let[e]=(0,w.useState)(()=>new Set),t=(0,w.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,w.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Se={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.