@vostride/agent-qa-dashboard-ui 0.1.10 → 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.
- package/dist/assets/{arrow-up-down-DyIZvSrC.js → arrow-up-down-CN-uHgX9.js} +1 -1
- package/dist/assets/{badge-BbhOGRC0.js → badge-DrW2vGVJ.js} +1 -1
- package/dist/assets/{batch-action-bar-CZxUcNFZ.js → batch-action-bar-uEhHVDds.js} +1 -1
- package/dist/assets/{circle-alert-pBH5T6su.js → circle-alert-BKX0IIz1.js} +1 -1
- package/dist/assets/{circle-x-DLBotPS8.js → circle-x-yPIxYoz1.js} +1 -1
- package/dist/assets/config-TRu3J-E7.js +10 -0
- package/dist/assets/{copy-Gj5_oF-8.js → copy-Clw3wvSn.js} +1 -1
- package/dist/assets/display-step-NqsJgW_B.js +1 -0
- package/dist/assets/dist-BPJgj1d0.js +1 -0
- package/dist/assets/{dist-DZYW0-Ta.js → dist-BPheZrD6.js} +1 -1
- package/dist/assets/{dist-DFSjTjXY.js → dist-m_OM4Je_.js} +1 -1
- package/dist/assets/{empty-state-Dluv5C1Q.js → empty-state-BTvOA5lp.js} +1 -1
- package/dist/assets/{external-link-BZ9gsZx_.js → external-link-C_uggQOc.js} +1 -1
- package/dist/assets/{eye-CZ7GiZXJ.js → eye-CZrufbYE.js} +1 -1
- package/dist/assets/{file-code-GHpcb0ud.js → file-code-B3iDpJRP.js} +1 -1
- package/dist/assets/{file-search-CIA16Vb8.js → file-search-DHHwYVza.js} +1 -1
- package/dist/assets/filename-validation-4sTTEagx.js +1 -0
- package/dist/assets/{grip-vertical-aDoBVncr.js → grip-vertical-A-AANrBM.js} +1 -1
- package/dist/assets/{hook-editor-Dvrur2VR.js → hook-editor-yhQoi-Ky.js} +1 -1
- package/dist/assets/{hook-runtime-ChJ0-jZo.js → hook-runtime-JF-0oZpz.js} +1 -1
- package/dist/assets/hook-viewer-DIkxp9uJ.js +1 -0
- package/dist/assets/hooks-CDRbjPKv.js +1 -0
- package/dist/assets/{id-badge-Dzm7eQ9l.js → id-badge-NwZYoNfB.js} +2 -2
- package/dist/assets/{index-B3xPCIyH.js → index-Bvtm2F6f.js} +2 -2
- package/dist/assets/index-CW7tbJhs.css +2 -0
- package/dist/assets/{insights-rNBE_Oot.js → insights-DuYBsUzB.js} +1 -1
- package/dist/assets/{insights-line-grid-G3ouKANt.js → insights-line-grid-BKOqA-1W.js} +4 -4
- package/dist/assets/{lib-BPEPp1D-.js → lib-58FyJI_k.js} +1 -1
- package/dist/assets/live-run-ucgeJa3o.js +1 -0
- package/dist/assets/{memory-DcKox3BM.js → memory-B7nfWNTH.js} +1 -1
- package/dist/assets/memory-product-D1u5V75o.js +2 -0
- package/dist/assets/{monaco-editor-CDJrOpKK.js → monaco-editor-DNT0Mzki.js} +2 -2
- package/dist/assets/{monaco-editor-inner-Q9WqqJ52.js → monaco-editor-inner-DuCqlGei.js} +2 -2
- package/dist/assets/{monaco.contribution-DTHp-zXN.js → monaco.contribution-LYJB_lCm.js} +2 -2
- package/dist/assets/{observation-block-DdB7C1c0.js → observation-block-4AqYhL1h.js} +1 -1
- package/dist/assets/observation-markdown-Dx_5-T0t.js +1 -0
- package/dist/assets/{pencil-BmkcPKBm.js → pencil-DdRoBrsh.js} +1 -1
- package/dist/assets/plus-pXO98OAE.js +1 -0
- package/dist/assets/popover-DGZi688D.js +1 -0
- package/dist/assets/{refresh-cw-v_0wwa0P.js → refresh-cw-C_0AkMuu.js} +1 -1
- package/dist/assets/{resizable-COfX_iMb.js → resizable-BGEcNRZO.js} +1 -1
- package/dist/assets/run-detail-3tlB8sew.js +1 -0
- package/dist/assets/runs-CywxkFZ6.js +1 -0
- package/dist/assets/{scroll-area-DfPMtFw0.js → scroll-area-CnATfQoe.js} +1 -1
- package/dist/assets/select-CeVjgiKI.js +1 -0
- package/dist/assets/{shortcut-hints-CfVf0REF.js → shortcut-hints-Bs5o743i.js} +1 -1
- package/dist/assets/split-button-DcY8ames.js +1 -0
- package/dist/assets/square-D71GHEET.js +1 -0
- package/dist/assets/{step-name-pills-COKv64-4.js → step-name-pills-Dta5ZGMZ.js} +1 -1
- package/dist/assets/suite-editor-Bnf6KMna.js +5 -0
- package/dist/assets/suite-navbar-PStktQ6j.js +1 -0
- package/dist/assets/suite-viewer-BD74MY_X.js +1 -0
- package/dist/assets/{suites-Cbjz7uPI.js → suites-BvfwzFEd.js} +1 -1
- package/dist/assets/{switch-BOdp7A9U.js → switch-ByV5GV5L.js} +1 -1
- package/dist/assets/tab-console-BQFkZJG_.js +1 -0
- package/dist/assets/table-D08QBBt4.js +1 -0
- package/dist/assets/{tabs-CfNQIHt-.js → tabs-DrB_Acb3.js} +1 -1
- package/dist/assets/test-editor-w7ZQPYgH.js +9 -0
- package/dist/assets/test-navbar-DoHKAy1p.js +7 -0
- package/dist/assets/{test-viewer-C6Rg-HeW.js → test-viewer-BwUQNVa4.js} +1 -1
- package/dist/assets/tests-B5ELKDH2.js +1 -0
- package/dist/assets/{tests-suites-table-widths-tlOYaS72.js → tests-suites-table-widths-DNWnkAjA.js} +1 -1
- package/dist/assets/{textarea-ByegDm2e.js → textarea-DChEVvwQ.js} +1 -1
- package/dist/assets/{trash-2-CawFHfTJ.js → trash-2-7P1Dp87k.js} +1 -1
- package/dist/assets/{tsMode-DGJI_hpV.js → tsMode-DEhRZlmT.js} +1 -1
- package/dist/assets/{use-hook-run-session-Cjqu9VED.js → use-hook-run-session-x-d_iodT.js} +1 -1
- package/dist/assets/{use-keyboard-shortcuts-BRF3cm7O.js → use-keyboard-shortcuts-EAppuiKO.js} +1 -1
- package/dist/assets/{use-page-title-CK82kWb2.js → use-page-title-B1t9-5_U.js} +1 -1
- package/dist/assets/use-run-status-favicon-D69P46yH.js +1 -0
- package/dist/assets/{use-selection-queue-CZ4rXNAT.js → use-selection-queue-BboTDies.js} +1 -1
- package/dist/assets/{viewer-url-state-CZTYs75z.js → viewer-url-state-6mOK5_sY.js} +1 -1
- package/dist/assets/{zap-C7OZlYXQ.js → zap-KFJmkY3Y.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/assets/config-BfxB7vJt.js +0 -10
- package/dist/assets/display-step-CV3zilMS.js +0 -1
- package/dist/assets/dist-o2A-YJGQ.js +0 -1
- package/dist/assets/filename-validation-BOmZP9gf.js +0 -1
- package/dist/assets/hook-viewer-DwQt3CRN.js +0 -1
- package/dist/assets/hooks-DcW2AVgE.js +0 -1
- package/dist/assets/index-cLLRFOsN.css +0 -2
- package/dist/assets/live-run-C2WLFzlf.js +0 -1
- package/dist/assets/memory-product-oHTD8fqS.js +0 -2
- package/dist/assets/observation-markdown-CvCuqq7R.js +0 -1
- package/dist/assets/plus-C6Zz9JLt.js +0 -1
- package/dist/assets/popover-CvQRjfg5.js +0 -1
- package/dist/assets/run-detail-B6QhqCjq.js +0 -1
- package/dist/assets/runs-DO4LkmoV.js +0 -1
- package/dist/assets/select-B5gV6YUf.js +0 -1
- package/dist/assets/split-button-C7J0EKrF.js +0 -1
- package/dist/assets/square-CvSqzenY.js +0 -1
- package/dist/assets/suite-editor-CaMQ5mWb.js +0 -5
- package/dist/assets/suite-navbar-CnJmeIp-.js +0 -1
- package/dist/assets/suite-viewer-HsI0Pn4t.js +0 -1
- package/dist/assets/tab-console-CLKFTABo.js +0 -1
- package/dist/assets/table-DL0PmHAE.js +0 -1
- package/dist/assets/test-editor-CIRL6zSb.js +0 -9
- package/dist/assets/test-navbar-CZhYoxgB.js +0 -7
- package/dist/assets/tests-C0Xhq39F.js +0 -1
- package/dist/assets/use-run-status-favicon-DoJZcfHz.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./use-run-status-favicon-DoJZcfHz.js";import{c as u,d,f as ee,l as f,s as p}from"./tab-console-CLKFTABo.js";import{i as te,n as ne,o as re,s as ie,t as ae,u as m}from"./select-B5gV6YUf.js";import{t as oe}from"./circle-alert-pBH5T6su.js";import{t as se}from"./copy-Gj5_oF-8.js";import{t as h}from"./external-link-BZ9gsZx_.js";import{t as ce}from"./file-search-CIA16Vb8.js";import{n as le,r as ue}from"./shortcut-hints-CfVf0REF.js";import{t as de}from"./use-page-title-CK82kWb2.js";import{n as fe,r as pe,t as me}from"./popover-CvQRjfg5.js";import{t as he}from"./scroll-area-DfPMtFw0.js";import{i as ge,n as _e,r as ve,t as ye}from"./tabs-CfNQIHt-.js";import{At as g,Ft as be,H as xe,Ht as _,I as Se,It as Ce,Kt as v,Lt as we,Mn as Te,Mt as Ee,Nt as y,Pt as b,Q as De,Qn as x,Rt as Oe,Un as S,Ut as C,Z as ke,Zn as w,cr as Ae,er as je,fr as Me,jt as T,kt as E,lr as Ne,n as Pe,qn as D,sr as Fe,tr as O,xt as Ie,zt as k}from"./index-B3xPCIyH.js";import{t as A}from"./badge-BbhOGRC0.js";import{n as Le,r as Re,t as ze}from"./resizable-COfX_iMb.js";import{t as Be}from"./empty-state-Dluv5C1Q.js";import{t as Ve}from"./use-keyboard-shortcuts-BRF3cm7O.js";import{t as j}from"./format-BpI4TiHn.js";import{i as He,n as Ue}from"./display-step-CV3zilMS.js";var We=D(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Ge=D(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Ke=D(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),qe=D(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),M=e(Me(),1),N=w();function Je({status:e}){switch(e){case`passed`:return(0,N.jsx)(A,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,N.jsx)(A,{variant:`destructive`,children:`Failed`});case`healed`:return(0,N.jsx)(A,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,N.jsx)(A,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`skipped`:return(0,N.jsx)(A,{variant:`secondary`,children:`Skipped`});case`cancelled`:return(0,N.jsx)(A,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,N.jsx)(A,{variant:`outline`,children:e})}}function Ye({run:e,steps:t,shortcutsOpen:n,onToggleShortcuts:a,onOpenArtifacts:o}){let s=Fe(),c=t.reduce((e,t)=>e+(t.totalTokens??0),0),l=t.reduce((e,t)=>e+(t.promptTokens??0),0),u=t.reduce((e,t)=>e+(t.completionTokens??0),0),f=e.suiteId!=null&&e.parentRunId==null,p=f&&e.suiteId?x.suiteView(e.suiteId):e.testId?x.testView(e.testId):null,te=f&&e.suiteId?`Open suite`:`Open test`,ne=r(e.id,e.videoPath),re=e.metadata?.farmSessionUrl;return(0,N.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,N.jsx)(`button`,{onClick:()=>s(x.runs),className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Runs`}),(0,N.jsx)(S,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,N.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),p?(0,N.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,"aria-label":te,className:`shrink-0 text-muted-foreground transition-colors hover:text-foreground`,children:(0,N.jsx)(i,{className:`h-3.5 w-3.5`})}):null,(0,N.jsx)(Je,{status:e.status})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[e.modelName&&(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,N.jsx)(ee,{className:`h-3.5 w-3.5`}),e.modelName]}),c>0&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1 cursor-default`,children:[(0,N.jsx)(We,{className:`h-3.5 w-3.5`}),j(l),` / `,j(u)]})}),(0,N.jsx)(T,{children:`Prompt tokens / Completion tokens`})]}),(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,N.jsx)(d,{className:`h-3.5 w-3.5`}),v(e.duration)]}),(0,N.jsx)(`div`,{className:`h-4 w-px bg-border`}),(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run artifacts`,onClick:()=>o?.(`attributes`),children:(0,N.jsx)(Ge,{className:`h-3.5 w-3.5`})})}),(0,N.jsx)(T,{children:`Run details (I/C/M)`})]}),(0,N.jsxs)(me,{open:n,onOpenChange:e=>{e!==n&&a()},children:[(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsx)(pe,{asChild:!0,children:(0,N.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,N.jsx)(ue,{className:`h-3.5 w-3.5`})})})}),(0,N.jsx)(T,{children:`Shortcuts (Shift+?)`})]}),(0,N.jsx)(fe,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Navigation`}),(0,N.jsx)(le,{hints:[{key:`↑ / K`,label:`Previous item`},{key:`↓ / J`,label:`Next item`},{key:`Shift+↑`,label:`Previous step`},{key:`Shift+↓`,label:`Next step`}]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Tabs`}),(0,N.jsx)(le,{hints:[{key:`1`,label:`Overview`},{key:`2`,label:`Env`},{key:`3`,label:`Network`},{key:`4`,label:`Console`},{key:`5`,label:`ARIA`},{key:`6`,label:`A11y`}]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Screenshots`}),(0,N.jsx)(le,{hints:[{key:`B`,label:`Before screenshot`},{key:`A`,label:`After screenshot`}]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Phases`}),(0,N.jsx)(le,{hints:[{key:`Shift+1`,label:`Toggle Observe`},{key:`Shift+2`,label:`Toggle Plan`},{key:`Shift+3`,label:`Toggle Execute`},{key:`Shift+4`,label:`Toggle Verify`}]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,N.jsx)(le,{hints:[{key:`I`,label:`Details: Attributes`},{key:`C`,label:`Artifacts: Config`},{key:`M`,label:`Artifacts: Memory`},{key:`R`,label:`Re-run`},{key:`V`,label:`Video`},{key:`Shift+?`,label:`Shortcuts`},{key:`Esc`,label:`Close`}]})]})]})})]}),(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`Re-run`,onClick:()=>{let t=e.attributes[`agent-qa.runner`]===`local`;Ie({file:e.filePath??e.name,local:t}).then(e=>{E.success(`Re-run started`),s(x.runLive(e.runId))}).catch(()=>E.error(`Failed to start re-run`))},children:(0,N.jsx)(Ke,{className:`h-3.5 w-3.5`})})}),(0,N.jsx)(T,{children:`Re-run (R)`})]}),ne&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsx)(`a`,{href:ne,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open recording`,children:(0,N.jsx)(_,{variant:`ghost`,size:`icon-sm`,children:(0,N.jsx)(qe,{className:`h-3.5 w-3.5`})})})}),(0,N.jsx)(T,{children:`Recording (V)`})]}),re&&(0,N.jsxs)(g,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsx)(`a`,{href:re,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(_,{variant:`ghost`,size:`icon-sm`,children:(0,N.jsx)(h,{className:`h-3.5 w-3.5`})})})}),(0,N.jsx)(T,{children:`BrowserStack`})]})]})]})}function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Xe(e){return Array.isArray(e)}function F(e,t=`Not captured`){return e===void 0?t:e===null?`None`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?Number.isFinite(e)?String(e):`None`:typeof e==`string`?e.length>0?e:`None`:Array.isArray(e)?`${e.length} ${e.length===1?`item`:`items`}`:P(e)?`${Object.keys(e).length} ${Object.keys(e).length===1?`field`:`fields`}`:String(e)}function Ze({section:e}){return(0,N.jsxs)(`div`,{className:`rounded-[2px] border border-border px-4 py-4 text-sm text-muted-foreground`,children:[e,` was not captured for this run.`]})}function I({title:e,badges:t=[],children:n,className:r}){return(0,N.jsxs)(`section`,{className:C(`rounded-[2px] border border-border bg-transparent`,r),children:[(0,N.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b px-4 py-3`,children:[(0,N.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:e}),t.map(e=>(0,N.jsx)(A,{variant:`outline`,className:`text-[10px]`,children:e},e))]}),(0,N.jsx)(`div`,{className:`space-y-3 px-4 py-4`,children:n})]})}function L({rows:e}){return(0,N.jsx)(`div`,{className:`divide-y divide-border/50`,children:e.map(e=>(0,N.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,N.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:e.label}),(0,N.jsx)(`dd`,{className:C(`min-w-0 break-words text-foreground`,e.mono&&`break-all font-mono`),children:e.value})]},e.label))})}function Qe({value:e}){return(0,N.jsx)(`span`,{className:C(`break-words`,(e==null||typeof e==`boolean`||typeof e==`number`)&&`font-mono text-[11px]`,e==null?`text-muted-foreground`:`text-foreground`),children:F(e)})}function R({value:e,label:t=`root`,level:n=0}){if(Xe(e))return(0,N.jsxs)(p,{children:[(0,N.jsxs)(f,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,N.jsx)(S,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,N.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,N.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[e.length,` `,e.length===1?`item`:`items`]})]}),(0,N.jsx)(u,{children:(0,N.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:e.length===0?(0,N.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):e.map((e,r)=>(0,N.jsx)(R,{label:`${r}`,value:e,level:n+1},`${t}-${r}`))})})]});if(P(e)){let r=Object.entries(e);return(0,N.jsxs)(p,{defaultOpen:n===0,children:[(0,N.jsxs)(f,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,N.jsx)(S,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,N.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,N.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[r.length,` `,r.length===1?`field`:`fields`]})]}),(0,N.jsx)(u,{children:(0,N.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:r.length===0?(0,N.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):r.map(([e,t])=>(0,N.jsx)(R,{label:e,value:t,level:n+1},e))})})]})}return(0,N.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,N.jsx)(`span`,{className:`min-w-0 break-words font-medium text-muted-foreground`,children:t}),(0,N.jsx)(Qe,{value:e})]})}function z({label:e,content:t}){return t?(0,N.jsxs)(p,{children:[(0,N.jsxs)(f,{className:`group flex w-full items-center gap-1.5 rounded-[2px] py-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,N.jsx)(S,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e]}),(0,N.jsx)(u,{children:(0,N.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-x-auto overflow-y-auto rounded-[2px] border border-border bg-muted/30 p-3 font-mono text-[11px] leading-relaxed whitespace-pre text-foreground`,children:t})})]}):null}function B(e,t){return e?e[t]:void 0}function V(e,t){let n=B(e,t);return typeof n==`string`&&n.length>0?n:null}function H(e,t){let n=B(e,t);return P(n)?n:null}function U(e,t){let n=B(e,t);return Xe(n)?n:[]}function W(e){return P(e)&&[V(e,`code`),V(e,`phase`),V(e,`message`)].filter(Boolean).join(` - `)||null}function G(e){let t=V(e,`kind`);return t===`test`||t===`suite`?t:`unknown`}function $e(e,t){let n=V(e,`childRunId`);if(n)return n;let r=V(e,`testId`),i=V(e,`name`);return t.children.find(({run:e})=>!!(r&&e.testId===r||i&&e.name===i))?.run.id??null}function K({config:e}){let t=H(e,`envFile`),n=H(e,`secretsFile`),r=U(e,`hooks`),i=H(e,`model`),a=V(n,`path`),o=V(n,`status`),s=typeof B(n,`count`)==`number`?B(n,`count`):null;return(0,N.jsx)(L,{rows:[{label:`Raw config`,value:V(e,`rawConfigContent`)?`Captured`:`Not captured`},{label:`Env file`,value:F(V(t,`path`))},{label:`Secrets file`,value:n?(0,N.jsxs)(`span`,{className:`inline-flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`break-all font-mono text-xs`,children:F(a)}),o?(0,N.jsx)(A,{variant:`outline`,className:`text-[10px]`,children:o}):null,s===null?null:(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s,` secret`,s===1?``:`s`]})]}):`Not captured`},{label:`CLI vars`,value:F(Object.keys(H(e,`cliVars`)??{}).length),mono:!0},{label:`Inline vars`,value:F(Object.keys(H(e,`inlineVars`)??{}).length),mono:!0},{label:`Hooks`,value:F(r.length),mono:!0},{label:`Model`,value:i?(0,N.jsx)(R,{label:`model`,value:i}):`Not captured`}]})}function et({source:e}){let t=G(e),n=W(B(e,`error`));return(0,N.jsx)(L,{rows:[{label:`Kind`,value:t,mono:!0},{label:`Name`,value:F(V(e,`name`))},{label:t===`suite`?`Suite ID`:`Test ID`,value:F(V(e,t===`suite`?`suiteId`:`testId`)),mono:!0},{label:`Path`,value:F(V(e,`filePath`)),mono:!0},{label:`Load status`,value:F(V(e,`loadStatus`)),mono:!0},{label:`Error`,value:n??`None`}]})}function tt({source:e,response:t}){let n=U(e,`members`).filter(P).sort((e,t)=>(typeof e.index==`number`?e.index:0)-(typeof t.index==`number`?t.index:0));return n.length===0?null:(0,N.jsx)(I,{title:`Suite Members`,badges:[`${n.length} members`],children:(0,N.jsx)(`div`,{className:`space-y-3`,children:n.map(e=>{let n=H(e,`ref`),r=typeof e.index==`number`?e.index:0,i=$e(e,t),a=W(B(e,`error`));return(0,N.jsxs)(`div`,{"data-suite-member-index":r,className:`rounded-[2px] border border-border p-3`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,N.jsxs)(A,{variant:`outline`,className:`text-[10px]`,children:[`#`,r+1]}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-sm font-medium`,children:V(e,`name`)??V(n,`test`)??`Unnamed member`}),(0,N.jsx)(A,{variant:`outline`,className:`text-[10px]`,children:F(V(e,`loadStatus`))})]}),(0,N.jsx)(L,{rows:[{label:`Test ID`,value:F(V(e,`testId`)),mono:!0},{label:`Ref`,value:F(V(n,`test`)),mono:!0},{label:`Ref ID`,value:F(V(n,`id`)),mono:!0},{label:`Path`,value:F(V(e,`filePath`)),mono:!0},{label:`Target`,value:F(V(e,`target`))},{label:`Child run`,value:i?(0,N.jsx)(`a`,{className:`break-all text-primary hover:underline`,href:x.runDetail(i),children:i}):`Not captured`,mono:!!i},{label:`Error`,value:a??`None`}]}),(0,N.jsxs)(p,{children:[(0,N.jsxs)(f,{className:`group mt-2 flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,N.jsx)(S,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),`Member snapshots`]}),(0,N.jsxs)(u,{className:`mt-2 space-y-2`,children:[(0,N.jsx)(z,{label:`Raw member YAML`,content:V(e,`rawYaml`)}),B(e,`resolvedDefinition`)===void 0?null:(0,N.jsx)(R,{label:`resolvedDefinition`,value:B(e,`resolvedDefinition`)})]})]})]},`${r}-${V(e,`testId`)??V(n,`test`)??`member`}`)})})})}function nt({response:e}){let t=e.artifact,n=t?.payload??{schemaVersion:1},r=P(n)?n:{schemaVersion:1},i=H(r,`config`),a=H(r,`source`),o=H(r,`runtime`),s=U(r,`errors`),c=new Set(e.missingSections),l=G(a);return(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsx)(I,{title:`Run Summary`,badges:[t?.kind??`unknown`],children:(0,N.jsx)(L,{rows:[{label:`Run`,value:e.run.name},{label:`Run ID`,value:e.run.id,mono:!0},{label:`Artifact kind`,value:t?.kind??`unknown`,mono:!0},{label:`Schema version`,value:t?.schemaVersion??r.schemaVersion??`Not captured`,mono:!0},{label:`Finalized`,value:t?.finalizedAt??`Not finalized`,mono:!0},{label:`Test ID`,value:F(e.run.testId),mono:!0},{label:`Suite ID`,value:F(e.run.suiteId),mono:!0},{label:`Platform`,value:F(e.run.platform)},{label:`Target`,value:F(e.run.targetName)}]})}),(0,N.jsx)(I,{title:`Global Config`,children:c.has(`config`)||!i?(0,N.jsx)(Ze,{section:`Config`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(K,{config:i}),B(i,`parsedConfig`)===void 0?null:(0,N.jsx)(R,{label:`parsedConfig`,value:B(i,`parsedConfig`)}),(0,N.jsx)(z,{label:`Raw global config`,content:V(i,`rawConfigContent`)})]})}),(0,N.jsx)(I,{title:`Effective Config`,children:c.has(`config`)||!i?(0,N.jsx)(Ze,{section:`Config`}):(0,N.jsx)(R,{label:`effectiveConfig`,value:B(i,`effectiveConfig`)})}),(0,N.jsx)(I,{title:`Source Snapshot`,badges:[l],children:c.has(`source`)||!a?(0,N.jsx)(Ze,{section:`Source`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(et,{source:a}),(0,N.jsx)(z,{label:l===`suite`?`Raw suite YAML`:`Raw test YAML`,content:V(a,`rawYaml`)}),B(a,`resolvedDefinition`)===void 0?null:(0,N.jsx)(R,{label:`resolvedDefinition`,value:B(a,`resolvedDefinition`)})]})}),a?(0,N.jsx)(tt,{source:a,response:e}):null,o||s.length>0?(0,N.jsxs)(I,{title:`Runtime and Errors`,badges:s.length>0?[`${s.length} errors`]:[],children:[o?(0,N.jsx)(R,{label:`runtime`,value:o}):null,s.length>0?(0,N.jsx)(`div`,{className:`space-y-2`,children:s.map((e,t)=>(0,N.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm`,children:W(e)??JSON.stringify(e)},t))}):null]}):null]})}var q=[{action:`add`,title:`Added`,className:`border-emerald-500/20 bg-emerald-500/5 text-emerald-500`},{action:`confirm`,title:`Updated/Confirmed`,className:`border-blue-500/20 bg-blue-500/5 text-blue-500`},{action:`deprecate`,title:`Deprecated`,className:`border-amber-500/25 bg-amber-500/5 text-amber-500`},{action:`delete`,title:`Deleted`,className:`border-red-500/20 bg-red-500/5 text-red-500`}];function J(e,t){return e?e[t]:void 0}function Y(e,t){let n=J(e,t);return typeof n==`string`&&n.length>0?n:null}function X(e,t){let n=J(e,t);return typeof n==`number`&&Number.isFinite(n)?n:null}function rt(e){if(!P(e))return null;let t=Y(e,`id`),n=Y(e,`title`),r=Y(e,`content`),i=X(e,`trust`),a=X(e,`confirmed_count`),o=X(e,`contradicted_count`);return!t||!n||!r||i===null||a===null||o===null?null:{id:t,title:n,content:r,trust:i,last_confirmed:Y(e,`last_confirmed`)??`Not captured`,confirmed_count:a,contradicted_count:o,source_test:Y(e,`source_test`)??`Not captured`}}function Z(e){if(!P(e))return null;let t=Y(e,`action`);if(t!==`add`&&t!==`confirm`&&t!==`deprecate`&&t!==`delete`)return null;let n=Y(e,`tier`);return n!==`products`&&n!==`suites`&&n!==`tests`?null:{action:t,tier:n,scope:Y(e,`scope`)??`unknown`,observationId:Y(e,`observationId`)??rt(J(e,`after`))?.id??rt(J(e,`before`))?.id??`unknown`,reasoning:Y(e,`reasoning`)??`No curator reasoning captured.`,before:rt(J(e,`before`)),after:rt(J(e,`after`)),error:Y(e,`error`)??void 0}}function Q(e){let t=e.artifact?.payload;if(!P(t))return null;let n=J(t,`memory`);if(!P(n))return null;let r=J(n,`log`);return P(r)?r:null}function it(e){let t=J(e,`deltas`);return Xe(t)?t.map(Z).filter(e=>!!e):[]}function at(e){return Object.fromEntries(q.map(t=>[t.action,e.filter(e=>e.action===t.action)]))}function $(e,t,n){return X(e,t===`confirm`?`confirmed`:t===`add`?`added`:t===`deprecate`?`deprecated`:`deleted`)??n}function ot(e,t){if(e==null||t==null)return null;let n=Math.round((t-e)*1e3)/1e3;return n===0?`0`:n>0?`+${n}`:String(n)}function st(e,t){return!e||!t?[]:[`title`,`content`,`trust`,`confirmed_count`,`contradicted_count`,`last_confirmed`,`source_test`].filter(n=>e[n]!==t[n])}function ct({log:e,counts:t}){let n=J(e,`tokenUsage`),r=X(e,`curatorDuration`),i=P(n)?X(n,`promptTokens`):null,a=P(n)?X(n,`completionTokens`):null,o=P(n)?X(n,`totalTokens`):null;return(0,N.jsxs)(`section`,{className:`rounded-[2px] border border-border`,children:[(0,N.jsx)(`div`,{className:`grid grid-cols-2 divide-x divide-y divide-border/50 sm:grid-cols-4 sm:divide-y-0`,children:q.map(e=>(0,N.jsxs)(`div`,{className:`px-3 py-3`,children:[(0,N.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:e.title}),(0,N.jsx)(`div`,{className:`mt-1 font-mono text-lg text-foreground`,children:t[e.action]})]},e.action))}),(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-3 border-t px-3 py-2 text-xs text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[`Curator duration: `,r==null?`Not captured`:v(r)]}),(0,N.jsxs)(`span`,{children:[`Tokens: `,o==null?`Not captured`:`${j(i??0)} / ${j(a??0)} / ${j(o)}`]})]})]})}function lt({label:e,observation:t,tone:n}){return t?(0,N.jsxs)(`div`,{className:C(`rounded-[2px] border border-border border-l-2 p-3`,n===`before`?`border-l-red-500/60 bg-red-500/5`:`border-l-emerald-500/60 bg-emerald-500/5`),children:[(0,N.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold text-muted-foreground`,children:e}),(0,N.jsx)(L,{rows:[{label:`Title`,value:t.title},{label:`ID`,value:t.id,mono:!0},{label:`Trust`,value:t.trust,mono:!0},{label:`Confirmed`,value:t.confirmed_count,mono:!0},{label:`Contradicted`,value:t.contradicted_count,mono:!0},{label:`Source test`,value:t.source_test,mono:!0},{label:`Last confirmed`,value:t.last_confirmed,mono:!0}]}),(0,N.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-foreground`,children:t.content})]}):null}function ut({delta:e,groupClassName:t}){let n=e.after?.title??e.before?.title??e.observationId,r=ot(e.before?.trust,e.after?.trust),i=ot(e.before?.confirmed_count,e.after?.confirmed_count),a=ot(e.before?.contradicted_count,e.after?.contradicted_count),o=st(e.before,e.after);return(0,N.jsx)(p,{children:(0,N.jsxs)(`div`,{className:`rounded-[2px] border border-border p-3`,children:[(0,N.jsxs)(f,{className:`group flex w-full min-w-0 items-start gap-2 text-left`,children:[(0,N.jsx)(S,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,N.jsx)(`h4`,{className:`min-w-0 flex-1 break-words text-sm font-medium text-foreground`,children:n}),(0,N.jsx)(A,{variant:`outline`,className:C(`text-[10px]`,t),children:q.find(t=>t.action===e.action)?.title??e.action}),(0,N.jsxs)(A,{variant:`outline`,className:`max-w-full whitespace-normal break-all text-left text-[10px]`,children:[e.tier,`/`,e.scope]})]}),(0,N.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground`,children:[(0,N.jsx)(`span`,{className:`break-all`,children:e.observationId}),r?(0,N.jsxs)(`span`,{children:[`trust `,r]}):null,i?(0,N.jsxs)(`span`,{children:[`confirmed `,i]}):null,a?(0,N.jsxs)(`span`,{children:[`contradicted `,a]}):null]}),(0,N.jsx)(`p`,{className:`mt-2 line-clamp-2 break-words text-xs text-muted-foreground`,children:e.reasoning})]})]}),(0,N.jsxs)(u,{className:`mt-3 space-y-3`,children:[o.length>0?(0,N.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Changed fields: `,(0,N.jsx)(`span`,{className:`font-mono text-foreground`,children:o.join(`, `)})]}):(0,N.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Changed fields: None captured`}),e.error?(0,N.jsxs)(`div`,{className:`text-xs text-red-500`,children:[`Error: `,e.error]}):null,e.action===`add`?(0,N.jsx)(lt,{label:`After`,observation:e.after,tone:`after`}):e.action===`delete`?(0,N.jsx)(lt,{label:`Before`,observation:e.before,tone:`before`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(lt,{label:`Before`,observation:e.before,tone:`before`}),(0,N.jsx)(lt,{label:`After`,observation:e.after,tone:`after`})]})]})]})})}function dt({response:e}){let t=Q(e);if(e.missingSections.includes(`memory`)||!t)return(0,N.jsx)(`div`,{className:`rounded-[2px] border border-border px-4 py-4 text-sm text-muted-foreground`,children:`Memory was not captured for this run.`});let n=at(it(t)),r={add:$(t,`add`,n.add.length),confirm:$(t,`confirm`,n.confirm.length),deprecate:$(t,`deprecate`,n.deprecate.length),delete:$(t,`delete`,n.delete.length)},i=r.add+r.confirm+r.deprecate+r.delete;return(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsx)(ct,{log:t,counts:r}),i===0?(0,N.jsxs)(`div`,{className:`rounded-[2px] border border-border px-4 py-4`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No memory changes`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Memory completed without adding, updating, deprecating, or deleting observations.`})]}):null,q.map(e=>{let t=n[e.action];return(0,N.jsx)(I,{title:e.title,badges:[`${r[e.action]} changes`],className:`scroll-mt-4`,children:(0,N.jsx)(`div`,{"data-memory-group":e.title,className:`space-y-3`,children:t.length===0?(0,N.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`No `,e.title.toLowerCase(),` changes.`]}):t.map(t=>(0,N.jsx)(ut,{delta:t,groupClassName:e.className},`${t.action}-${t.observationId}`))})},e.action)}),Xe(J(t,`errors`))&&J(t,`errors`).length>0?(0,N.jsx)(I,{title:`Memory Errors`,badges:[`${J(t,`errors`).length} errors`],children:(0,N.jsx)(`div`,{className:`space-y-2`,children:J(t,`errors`).map((e,t)=>(0,N.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm text-red-500`,children:F(e)},t))})}):null]})}function ft(){return(0,N.jsxs)(`div`,{className:`space-y-4`,"aria-label":`Loading artifact data`,children:[(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading artifact data...`}),[0,1,2].map(e=>(0,N.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,N.jsx)(b,{className:`h-4 w-40`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,N.jsx)(b,{className:`h-3 w-full`}),(0,N.jsx)(b,{className:`h-3 w-5/6`}),(0,N.jsx)(b,{className:`h-3 w-3/5`})]})]},e))]})}function pt({error:e,onRetry:t}){return(0,N.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-4`,children:(0,N.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,N.jsx)(oe,{className:`mt-0.5 h-4 w-4 shrink-0 text-red-500`}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Could not load artifact data`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Retry the request. If it continues, verify the dashboard server can read run artifacts.`}),(0,N.jsx)(`p`,{className:`mt-2 break-words font-mono text-xs text-red-500`,children:e}),(0,N.jsx)(_,{className:`mt-3`,size:`sm`,variant:`outline`,onClick:t,children:`Retry`})]})]})})}function mt(){return(0,N.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Artifact data is not available for this run`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run does not have a persisted artifact record.`})]})}function ht(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=e[t];return n&&typeof n==`object`&&!Array.isArray(n)?n:null}function gt(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return Object.fromEntries(t)}function _t(e){let t=gt(e.run.attributes);if(Object.keys(t).length>0)return t;let n=e.artifact?.payload;return gt(ht(ht(n,`metadata`),`attributes`))}function vt(e){return Object.entries(e).sort(([e],[t])=>{let n=e.startsWith(`agent-qa.`);return n===t.startsWith(`agent-qa.`)?e.localeCompare(t):n?-1:1})}function yt(e){navigator.clipboard?.writeText(e)}function bt({response:e}){let t=vt(_t(e));return t.length===0?(0,N.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No run attributes`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run did not record any attributes.`})]}):(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsx)(`div`,{className:`flex justify-end`,children:(0,N.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>yt(JSON.stringify(Object.fromEntries(t),null,2)),children:[(0,N.jsx)(se,{className:`size-4`}),`Copy JSON`]})}),(0,N.jsx)(`div`,{className:`overflow-hidden rounded-[2px] border border-border`,children:(0,N.jsx)(`table`,{className:`w-full table-fixed text-sm`,children:(0,N.jsx)(`tbody`,{children:t.map(([e,t])=>(0,N.jsxs)(`tr`,{className:`border-b border-border/70 last:border-b-0`,children:[(0,N.jsx)(`th`,{className:`w-[240px] align-top px-3 py-2 text-left font-mono text-xs font-medium text-muted-foreground`,children:e}),(0,N.jsx)(`td`,{className:`align-top px-3 py-2`,children:(0,N.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,N.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono text-xs text-foreground`,children:t}),(0,N.jsx)(_,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy ${e} value`,title:`Copy value`,onClick:()=>yt(t),children:(0,N.jsx)(se,{className:`size-3.5`})})]})})]},e))})})})]})}function xt({tab:e,response:t}){return e===`attributes`?(0,N.jsx)(bt,{response:t}):e===`config`?(0,N.jsx)(nt,{response:t}):(0,N.jsx)(dt,{response:t})}function St({tab:e,response:t,loading:n,error:r,onRetry:i}){return n?(0,N.jsx)(ft,{}):r?(0,N.jsx)(pt,{error:r,onRetry:i}):!t||e!==`attributes`&&!t.artifact?(0,N.jsx)(mt,{}):(0,N.jsx)(xt,{tab:e,response:t})}function Ct({run:e,open:t,tab:n,response:r,loading:i,error:a,onOpenChange:o,onTabChange:s,onRetry:c}){let l=r?.artifact??null,u=e.name||`Run ${e.id}`;return(0,N.jsx)(be,{open:t,onOpenChange:o,children:(0,N.jsxs)(Ce,{side:`right`,className:`w-[min(820px,92vw)] sm:max-w-none gap-0 overflow-hidden p-0`,children:[(0,N.jsxs)(Oe,{className:`border-b px-4 py-3 pr-12`,children:[(0,N.jsx)(k,{className:`text-base leading-snug`,children:`Run details`}),(0,N.jsx)(we,{className:`truncate text-xs`,children:u}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 text-xs text-muted-foreground`,children:[(0,N.jsx)(`span`,{className:`break-all font-mono`,children:e.id}),l?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(A,{variant:`outline`,className:`text-[10px]`,children:l.kind}),(0,N.jsxs)(A,{variant:`outline`,className:`text-[10px]`,children:[`schema `,l.schemaVersion]}),(0,N.jsx)(A,{variant:`outline`,className:C(`text-[10px]`,l.finalizedAt?`border-emerald-500/20 text-emerald-500`:`border-amber-500/25 text-amber-500`),children:l.finalizedAt?`finalized`:`open`})]}):null]})]}),(0,N.jsxs)(ye,{value:n,onValueChange:e=>s(e),className:`min-h-0 flex-1 overflow-hidden`,children:[(0,N.jsx)(`div`,{className:`border-b px-3`,children:(0,N.jsxs)(ve,{variant:`line`,className:`h-9 w-full justify-start`,children:[(0,N.jsx)(ge,{value:`attributes`,className:`max-w-32 flex-none`,children:`Attributes`}),(0,N.jsx)(ge,{value:`config`,className:`max-w-32 flex-none`,children:`Config`}),(0,N.jsx)(ge,{value:`memory`,className:`max-w-32 flex-none`,children:`Memory`})]})}),(0,N.jsxs)(he,{className:`min-h-0 flex-1`,children:[(0,N.jsx)(_e,{value:`attributes`,className:`m-0 px-4 py-4`,children:(0,N.jsx)(St,{tab:`attributes`,response:r,loading:i,error:a,onRetry:c})}),(0,N.jsx)(_e,{value:`config`,className:`m-0 px-4 py-4`,children:(0,N.jsx)(St,{tab:`config`,response:r,loading:i,error:a,onRetry:c})}),(0,N.jsx)(_e,{value:`memory`,className:`m-0 px-4 py-4`,children:(0,N.jsx)(St,{tab:`memory`,response:r,loading:i,error:a,onRetry:c})})]})]})]})})}function wt({status:e}){let t=je(e);return(0,N.jsx)(A,{className:O(t.tone),children:t.label})}function Tt(e,t){let n=e.split(/\s+/);return n.length<=t?{truncated:e,isTruncated:!1}:{truncated:n.slice(0,t).join(` `)+`...`,isTruncated:!0}}function Et({summary:e}){let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(!1),{truncated:a,isTruncated:o}=Tt(e,20);return(0,N.jsx)(`div`,{className:`mx-2 mt-2 rounded-[2px] border border-red-500/20 bg-red-500/5 px-3 py-2 shrink-0`,children:(0,N.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,N.jsx)(oe,{className:`h-4 w-4 text-red-400 shrink-0 mt-0.5`}),(0,N.jsx)(`span`,{className:`flex-1 text-sm text-foreground/80 select-text`,children:t?e:a}),(0,N.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)},className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,title:`Copy failure summary`,children:r?(0,N.jsx)(m,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,N.jsx)(se,{className:`h-3.5 w-3.5 text-muted-foreground`})}),o&&(0,N.jsx)(`button`,{onClick:()=>n(e=>!e),className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,children:(0,N.jsx)(S,{className:C(`h-3.5 w-3.5 text-muted-foreground transition-transform`,t&&`rotate-90`)})})]})})}function Dt(e,t){let n=new Map(t.map((e,t)=>[e.id,t]));return[...e].sort((e,t)=>{let r=n.get(e.runId)??0,i=n.get(t.runId)??0;return r===i?e.stepOrder-t.stepOrder:r-i})}function Ot(e){return e?.suiteId!=null&&e.parentRunId==null}function kt(e,t,n,r){return He((r&&n===`all`&&t.length>0?Dt(e,t):[...e].sort((e,t)=>e.stepOrder-t.stepOrder)).map(Ue))}function At(e,t,n){let r=t.get(`step`),i=t.get(`run`),a=t.get(`sub`);if(r){let t=Number.parseInt(r,10),o=e.find(e=>e.rawStepOrder===t?n&&i?e.rawRunId===i:!0:!1);if(o)return a==null?{type:`step`,stepId:o.id}:{type:`subaction`,stepId:o.id,subIndex:Number.parseInt(a,10)}}return e.length>0?{type:`step`,stepId:e[0].id}:null}function jt(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top+12,a=n.bottom-12;if(r.top>=i&&r.bottom<=a)return;let o=r.top<i?e.scrollTop+(r.top-i):e.scrollTop+(r.bottom-a),s=Math.max(0,o);if(typeof e.scrollTo==`function`){e.scrollTo({top:s,behavior:`smooth`});return}e.scrollTop=s}function Mt(){let{id:e}=Ae(),i=Fe(),[d,ee]=Ne(),[m,oe]=(0,M.useState)(null);de(m?`Run - ${m.name}`:`Run`),a(l(m?.status));let[se,h]=(0,M.useState)([]),[le,ue]=(0,M.useState)([]),[fe,pe]=(0,M.useState)(null),[me,he]=(0,M.useState)(!0),[ge,_e]=(0,M.useState)(!1),[ve,ye]=(0,M.useState)(!1),[g,be]=(0,M.useState)(1),Ce=(0,M.useRef)(null),v=(0,M.useRef)(null),we=(0,M.useRef)(null),y=(0,M.useRef)(null),[b,Oe]=(0,M.useState)([]),[w,je]=(0,M.useState)(`all`),[Me,T]=(0,M.useState)([]),[D,O]=(0,M.useState)(null),[k,A]=(0,M.useState)([]),[He,Ue]=(0,M.useState)(!1),[We,Ge]=(0,M.useState)(null),[Ke,qe]=(0,M.useState)(!1),[Je,P]=(0,M.useState)(`attributes`),[Xe,F]=(0,M.useState)(null),[Ze,I]=(0,M.useState)(!1),[L,Qe]=(0,M.useState)(null),R=(0,M.useRef)(null),z=(0,M.useRef)(0),[B,V]=(0,M.useState)(()=>{let e=d.get(`tab`);return e===`screenshot`?`overview`:e??`overview`});(0,M.useEffect)(()=>{if(!e)return;y.current=null;let t=!1,n=0;async function r(){try{let{executions:n}=await Se();if(t)return;if(n.some(t=>t.runId===e)){i(x.runLive(e),{replace:!0});return}}catch{}try{let n=await ke(e);if(t)return;if(oe(n.run),Ot(n.run)&&n.tests&&n.tests.length>0){Oe(n.tests),je(`all`);let e=[];for(let r of n.tests)try{let n=await ke(r.id);if(t)return;e.push(...n.steps)}catch{}T(e),h(e),O(At(kt(e,n.tests,`all`,!0),d,!0))}else{h(n.steps);let e=n.attempts??[];if(ue(e),e.length>0){let n=e[e.length-1];pe(n.id);let r=await ke(n.id);t||(h(r.steps),O(At(kt(r.steps,[],``,!1),d,!1)))}else O(At(kt(n.steps,[],``,!1),d,!1))}}catch(e){if(t)return;if(e instanceof Error&&e.message.includes(`404`)){if(n<5){n++,setTimeout(()=>{t||r()},1e3);return}_e(!0)}else E.error(`Failed to load run`)}finally{t||he(!1)}}return r(),()=>{t=!0}},[e,i]),(0,M.useEffect)(()=>{if(!e||me)return;let t=!1;return xe(e).then(({logs:e})=>{t||A(e)}).catch(()=>{}),()=>{t=!0}},[e,me]),(0,M.useEffect)(()=>{R.current=null,z.current+=1,F(null),Qe(null),I(!1)},[m?.id]);let H=(0,M.useCallback)(async()=>{if(!m?.id)return;let e=z.current+1;z.current=e,I(!0),Qe(null);try{let t=await De(m.id);if(z.current!==e)return;R.current=m.id,F(t)}catch(t){if(z.current!==e)return;Qe(t instanceof Error?t.message:`Failed to load artifact data`)}finally{z.current===e&&I(!1)}},[m?.id]);(0,M.useEffect)(()=>{!Ke||!m?.id||Ze||L||R.current===m.id&&Xe||H()},[Ke,L,Ze,Xe,H,m?.id]);let U=(0,M.useCallback)(e=>{P(e),qe(!0)},[]),W=(0,M.useMemo)(()=>kt(se,b,w,Ot(m)),[se,b,w,m]),G=(0,M.useMemo)(()=>o(D)?W.find(e=>e.id===D.stepId)??null:null,[D,W]),$e=(0,M.useMemo)(()=>!c(D)||!G?null:G.subActionsData?.[D.subIndex]??null,[D,G]),K=(0,M.useMemo)(()=>{if(!G)return null;if($e){let e=$e.screenshotBeforePath??null,t=$e.screenshotAfterPath??null;return!e&&!t?null:{key:[G.id,`sub`,$e.index,e??``,t??``].join(`|`),beforePath:e,afterPath:t}}let e=G.screenshotBeforePath,t=G.screenshotPath;return!e&&!t?null:{key:[G.id,`step`,e??``,t??``].join(`|`),beforePath:e,afterPath:t}},[G,$e]),et=K&&We?.key===K.key?We.side:void 0,tt=o(D)?D.stepId:null,nt=(0,M.useMemo)(()=>k.filter(e=>e.stepId===null&&e.phase===`setup`),[k]),q=(0,M.useMemo)(()=>k.filter(e=>e.stepId===null&&e.phase===`teardown`),[k]),J=(0,M.useMemo)(()=>k.filter(e=>e.stepId!==null),[k]),Y=(0,M.useMemo)(()=>G?J.filter(e=>e.stepId===G.id?!0:!e.stepId||G.rawRunId&&e.runId&&G.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===G.rawStepOrder):[],[J,G]),X=(0,M.useMemo)(()=>D?.type===`hook`?k.find(e=>e.id===D.hookId)??null:null,[D,k]),rt=(0,M.useMemo)(()=>D?.type===`execution`?k.find(e=>e.id===D.logId)??null:null,[D,k]),Z=(0,M.useMemo)(()=>{let e=[],t=Ot(m)&&w===`all`&&b.length>0,n=t?new Set(b.map(e=>e.id)):null;for(let t of nt)(!n||!n.has(t.runId))&&e.push({type:`hook`,logId:t.id});if(t){let t=new Map;for(let e of W){let n=e.rawRunId??e.id,r=t.get(n)??[];r.push(e),t.set(n,r)}for(let[n,r]of t){for(let t of nt)t.runId===n&&e.push({type:`hook`,logId:t.id});for(let t of r)if(e.push({type:`step`,stepId:t.id}),t.id===tt){let n=J.filter(e=>e.stepId===t.id?!0:!e.stepId||t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder);for(let r of n)e.push({type:`exec`,stepId:t.id,logId:r.id});t.subActionsData&&t.subActionsData.forEach((n,r)=>{e.push({type:`sub`,stepId:t.id,subIndex:r})})}for(let t of q)t.runId===n&&e.push({type:`hook`,logId:t.id})}}else for(let t of W)if(e.push({type:`step`,stepId:t.id}),t.id===tt){let n=J.filter(e=>e.stepId===t.id?!0:!e.stepId||t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder);for(let r of n)e.push({type:`exec`,stepId:t.id,logId:r.id});t.subActionsData&&t.subActionsData.forEach((n,r)=>{e.push({type:`sub`,stepId:t.id,subIndex:r})})}for(let t of q)(!n||!n.has(t.runId))&&e.push({type:`hook`,logId:t.id});return e},[W,tt,J,nt,q,m,w,b]),Q=(0,M.useMemo)(()=>D?Z.findIndex(e=>D.type===`hook`&&e.type===`hook`?e.logId===D.hookId:D.type===`step`&&e.type===`step`?e.stepId===D.stepId:D.type===`subaction`&&e.type===`sub`?e.stepId===D.stepId&&e.subIndex===D.subIndex:D.type===`execution`&&e.type===`exec`?e.logId===D.logId:!1):-1,[Z,D]);function it(e){return e.type===`hook`?{type:`hook`,hookId:e.logId}:e.type===`step`?{type:`step`,stepId:e.stepId}:e.type===`exec`?{type:`execution`,stepId:e.stepId,logId:e.logId}:{type:`subaction`,stepId:e.stepId,subIndex:e.subIndex}}let at=[`overview`,`env`,`network`,`console`,`aria`,`a11y`],$=(0,M.useCallback)(e=>{B===`overview`&&K&&(e===`before`?K.beforePath:K.afterPath)&&Ge({key:K.key,side:e})},[B,K]);Ve((0,M.useMemo)(()=>{let e={arrowdown:()=>{Z.length!==0&&O(it(Q===-1?Z[0]:Z[Math.min(Q+1,Z.length-1)]))},arrowup:()=>{Z.length!==0&&O(it(Q===-1?Z[Z.length-1]:Z[Math.max(Q-1,0)]))},j:()=>{e.arrowdown({})},k:()=>{e.arrowup({})},"shift+arrowdown":()=>{if(Z.length===0)return;let e=Z.findIndex((e,t)=>t>Q&&e.type===`step`);e!==-1&&O(it(Z[e]))},"shift+arrowup":()=>{if(Z.length===0)return;let e=-1;for(let t=Q-1;t>=0;t--)if(Z[t].type===`step`){e=t;break}e!==-1&&O(it(Z[e]))},1:()=>V(at[0]),2:()=>V(at[1]),3:()=>V(at[2]),4:()=>V(at[3]),5:()=>V(at[4]),6:()=>V(at[5]),a:()=>$(`after`),b:()=>$(`before`),i:()=>U(`attributes`),c:()=>U(`config`),m:()=>U(`memory`),r:()=>{if(!m)return;let e=m.attributes[`agent-qa.runner`]===`local`;Ie({file:m.filePath??m.name,local:e}).then(e=>{E.success(`Re-run started`),i(x.runLive(e.runId))}).catch(()=>E.error(`Failed to start re-run`))},escape:()=>{Ke?qe(!1):ve?ye(!1):O(null)},v:()=>{m?.videoPath&&ye(!0)},"shift+?":()=>Ue(e=>!e),"shift+!":()=>v.current?.togglePhase(0),"shift+@":()=>v.current?.togglePhase(1),"shift+#":()=>v.current?.togglePhase(2),"shift+$":()=>v.current?.togglePhase(3)};return e},[Z,Q,D,m,i,Ke,ve,v,$,U])),(0,M.useEffect)(()=>{let e=o(D)?W.find(e=>e.id===D.stepId):null,t=e?.rawStepOrder,n=e?.rawRunId;ee(e=>{let r=new URLSearchParams(e);return t==null?r.delete(`step`):r.set(`step`,String(t)),Ot(m)&&w===`all`&&n?r.set(`run`,n):r.delete(`run`),c(D)?r.set(`sub`,String(D.subIndex)):r.delete(`sub`),B===`overview`?r.delete(`tab`):r.set(`tab`,B),r},{replace:!0})},[D,B,W,m,w,ee]),(0,M.useEffect)(()=>{if(!o(D))return;let e=we.current;if(!e)return;if(D.type===`step`&&!d.has(`step`)&&!d.has(`sub`)&&W[0]?.id===D.stepId){y.current=D.stepId;return}y.current=null;let t=D.type===`step`?`[data-step-id="${D.stepId}"]`:D.type===`execution`?`[data-execution-id="${D.logId}"]`:c(D)?`[data-sub-action-id="${D.stepId}-${D.subIndex}"]`:null;if(!t)return;let n=requestAnimationFrame(()=>{let n=e.querySelector(t);n&&jt(e,n)});return()=>cancelAnimationFrame(n)},[D,W,d]);let ot=(0,M.useCallback)(async e=>{pe(e);try{let t=await ke(e);h(t.steps),O(At(kt(t.steps,[],``,!1),d,!1))}catch{E.error(`Failed to load attempt`)}},[d]),st=(0,M.useCallback)(async t=>{if(je(t),t===`all`)h(Me),O(At(kt(Me,b,`all`,Ot(m)),d,!0)),e&&xe(e).then(({logs:e})=>A(e)).catch(()=>{});else try{let e=await ke(t);h(e.steps);let{logs:n}=await xe(t);A(n),O(At(kt(e.steps,[],t,!1),d,!1))}catch{E.error(`Failed to load test steps`)}},[Me,e,m,d,b]);if(me)return(0,N.jsx)(Pe,{});if(ge||!m)return(0,N.jsx)(Be,{icon:ce,title:`Run not found`,description:`This test run doesn't exist or has been deleted`,actionLabel:`View All Runs`,onAction:()=>i(x.runs)});let ct=r(m.id,m.videoPath);return(0,N.jsx)(Ee,{children:(0,N.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,N.jsx)(Ye,{run:m,steps:se,shortcutsOpen:He,onToggleShortcuts:()=>Ue(e=>!e),onOpenArtifacts:U}),(0,N.jsxs)(Re,{orientation:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,children:[(0,N.jsx)(Le,{defaultSize:35,minSize:20,children:(0,N.jsxs)(`div`,{ref:we,className:`flex h-full min-h-0 min-w-0 flex-col overflow-y-auto`,children:[Ot(m)&&b.length>0?(0,N.jsx)(`div`,{className:`border-b px-3 py-2 shrink-0`,children:(0,N.jsxs)(ae,{value:w,onValueChange:st,children:[(0,N.jsx)(re,{className:`w-full h-8 text-xs`,children:(0,N.jsx)(ie,{})}),(0,N.jsxs)(ne,{children:[(0,N.jsxs)(te,{value:`all`,children:[`All Tests (`,b.length,`)`]}),b.map(e=>(0,N.jsx)(te,{value:e.id,children:(0,N.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.name,(0,N.jsx)(wt,{status:e.status})]})},e.id))]})]})}):le.length>0?(0,N.jsx)(`div`,{className:`flex gap-1 border-b px-3 py-2 shrink-0`,children:le.map(e=>(0,N.jsxs)(`button`,{onClick:()=>ot(e.id),className:C(`px-3 py-1 text-xs rounded-sm border-b-2 transition-colors`,fe===e.id?`border-primary text-foreground font-medium`:`border-transparent text-muted-foreground hover:text-foreground`),children:[`Attempt `,e.attemptNumber,(0,N.jsx)(`span`,{className:`ml-1.5`,children:(0,N.jsx)(wt,{status:e.status})})]},e.id))}):null,m.status===`failed`&&m.failureSummary&&(0,N.jsx)(Et,{summary:m.failureSummary}),m.status===`failed`&&m.errorLog&&(0,N.jsxs)(p,{className:`mx-2 mt-1`,children:[(0,N.jsxs)(f,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,N.jsx)(S,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,N.jsx)(`span`,{children:`Error Details`})]}),(0,N.jsx)(u,{children:(0,N.jsx)(`pre`,{className:`mt-1 text-xs font-mono bg-muted/30 border border-border/50 rounded-[2px] px-3 py-2 overflow-x-auto whitespace-pre-wrap max-h-60 overflow-y-auto text-foreground/70 select-text`,children:m.errorLog})})]}),m.memoryLog&&(()=>{let e=JSON.parse(m.memoryLog);return(0,N.jsxs)(p,{className:`mx-2 mt-1`,children:[(0,N.jsxs)(f,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,N.jsx)(S,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,N.jsx)(`span`,{children:`Memory`}),(0,N.jsxs)(`span`,{className:`ml-1 text-[10px] opacity-60`,children:[e.added,`A `,e.confirmed,`C `,e.deprecated,`D`]})]}),(0,N.jsx)(u,{children:(0,N.jsxs)(`div`,{className:`mt-1 grid grid-cols-2 gap-x-6 gap-y-1 text-xs px-3 py-2 bg-muted/30 border border-border/50 rounded-[2px]`,children:[(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`Added`}),(0,N.jsx)(`span`,{className:`font-mono`,children:e.added})]}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`Confirmed`}),(0,N.jsx)(`span`,{className:`font-mono`,children:e.confirmed})]}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`Deprecated`}),(0,N.jsx)(`span`,{className:`font-mono`,children:e.deprecated})]}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`Errors`}),(0,N.jsx)(`span`,{className:`font-mono`,children:e.errors.length})]}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`Curator Duration`}),(0,N.jsxs)(`span`,{className:`font-mono`,children:[(e.curatorDuration/1e3).toFixed(1),`s`]})]}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`Tokens`}),(0,N.jsx)(`span`,{className:`font-mono`,children:e.tokenUsage?`${j(e.tokenUsage.promptTokens)} / ${j(e.tokenUsage.completionTokens)}`:`—`})]})]})})]})})(),(0,N.jsx)(t,{steps:W,selection:D,onSelect:O,suiteTests:Ot(m)?b:void 0,suiteSelectedView:w,setupHooks:nt,teardownHooks:q,inlineLogs:J})]})}),(0,N.jsx)(ze,{withHandle:!0}),(0,N.jsx)(Le,{defaultSize:65,minSize:30,children:(0,N.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:D?.type===`hook`&&X?(0,N.jsx)(n,{log:X}):D?.type===`execution`&&rt?(0,N.jsx)(n,{log:rt}):(0,N.jsx)(s,{activeTab:B,onTabChange:V,step:G,subAction:$e,runId:G?.rawRunId??m.id,allSteps:W,executionLogs:Y,platform:m.platform,screenshotSide:et,onScreenshotSideChange:$,pipelineRef:v})})})]}),(0,N.jsx)(Ct,{run:m,open:Ke,tab:Je,response:Xe,loading:Ze,error:L,onOpenChange:qe,onTabChange:P,onRetry:H}),ve&&ct&&(0,N.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center`,onClick:()=>ye(!1),children:[(0,N.jsx)(_,{variant:`secondary`,size:`icon-sm`,className:`absolute top-4 right-4 h-8 w-8 bg-background/80 backdrop-blur-sm z-10`,onClick:()=>ye(!1),children:(0,N.jsx)(Te,{className:`h-4 w-4`})}),(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,onClick:e=>e.stopPropagation(),children:[(0,N.jsx)(`video`,{ref:Ce,src:ct,controls:!0,autoPlay:!0,className:`rounded-lg`,style:{maxWidth:`90vw`,maxHeight:`calc(90vh - 3rem)`},onLoadedMetadata:()=>{Ce.current&&(Ce.current.playbackRate=g)}}),(0,N.jsx)(`div`,{className:`flex items-center gap-1 bg-background/80 backdrop-blur-sm rounded-full px-1 py-0.5`,children:[.5,1,1.5,2,3,4].map(e=>(0,N.jsxs)(`button`,{onClick:()=>{be(e),Ce.current&&(Ce.current.playbackRate=e)},className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors ${g===e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:[e,`x`]},e))})]})]})]})})}export{Mt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-DyIZvSrC.js";import{i as n,l as r,n as i,o as a,s as o,t as s}from"./select-B5gV6YUf.js";import{n as c}from"./split-button-C7J0EKrF.js";import{n as l,r as u}from"./shortcut-hints-CfVf0REF.js";import{t as d}from"./plus-C6Zz9JLt.js";import{t as f}from"./trash-2-CawFHfTJ.js";import{t as p}from"./use-page-title-CK82kWb2.js";import{n as m,t as h}from"./batch-action-bar-CZxUcNFZ.js";import{n as g,r as _,t as v}from"./popover-CvQRjfg5.js";import{n as y,t as b}from"./scroll-area-DfPMtFw0.js";import{i as x,r as ee,t as te}from"./tabs-CfNQIHt-.js";import{$ as ne,At as re,Fn as ie,Gt as ae,Ht as S,I as oe,Kt as se,Ln as ce,Mn as le,Mt as ue,Nt as de,Qn as fe,Un as pe,Ut as C,Vt as w,Wt as T,X as me,Zn as he,a as E,er as D,et as O,fr as k,ht as ge,j as _e,jt as ve,kt as A,lr as ye,qt as j,sr as be,tr as M,tt as N,xt as xe}from"./index-B3xPCIyH.js";import{t as P}from"./badge-BbhOGRC0.js";import{n as F,o as Se,r as Ce,t as I}from"./lib-BPEPp1D-.js";import{a as we,i as L,n as R,o as z,r as B,t as Te}from"./table-DL0PmHAE.js";import{t as Ee}from"./empty-state-Dluv5C1Q.js";import{t as De}from"./use-keyboard-shortcuts-BRF3cm7O.js";import{n as Oe,t as ke}from"./use-selection-queue-CZ4rXNAT.js";var V=e(k(),1),H=he();function Ae({startedAt:e}){let[t,n]=(0,V.useState)(()=>{let t=new Date(j(e)).getTime();return Math.max(0,Math.floor((Date.now()-t)/1e3))});return(0,V.useEffect)(()=>{let t=new Date(j(e)).getTime(),r=setInterval(()=>{n(Math.max(0,Math.floor((Date.now()-t)/1e3)))},1e3);return()=>clearInterval(r)},[e]),(0,H.jsxs)(`span`,{className:`text-blue-500 tabular-nums`,children:[Math.floor(t/60),`m `,t%60,`s`]})}var je={select:`44px`,status:`136px`,target:`180px`,attributes:`260px`,duration:`104px`,createdAt:`128px`},U=[`agent-qa.trigger`,`agent-qa.runner`];function W(e){return e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1)}function G(e){return`${e.targetName?.trim()||`No target`} (${W(e.platform)})`}function K(e){return e.suiteId!=null&&e.parentRunId==null}function q(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=new Map(U.map((e,t)=>[e,t]));return Object.entries(e??{}).filter(([,e])=>typeof e==`string`).sort(([e],[t])=>{let i=n.get(e),a=n.get(t);if(i!==void 0||a!==void 0)return(i??2**53-1)-(a??2**53-1);let o=r.get(e),s=r.get(t);return o!==void 0||s!==void 0?(o??2**53-1)-(s??2**53-1):e.localeCompare(t)})}function J({attributes:e,activeKeys:t}){let n=q(e,t);if(n.length===0)return(0,H.jsx)(`span`,{className:`text-[12px] text-muted-foreground`,children:`No attributes`});let r=n.length>2?1:2,i=n.slice(0,r),a=n.length-i.length;return(0,H.jsxs)(re,{children:[(0,H.jsx)(de,{asChild:!0,children:(0,H.jsxs)(`div`,{className:`max-h-[38px] overflow-hidden text-[12px] leading-[18px]`,"aria-label":n.map(([e,t])=>`${e}=${t}`).join(`, `),children:[i.map(([e,t])=>(0,H.jsxs)(`div`,{className:`min-w-0 truncate font-mono`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`=`]}),(0,H.jsx)(`span`,{className:`text-foreground`,children:t})]},e)),a>0?(0,H.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,a,` more`]}):null]})}),(0,H.jsx)(ve,{side:`top`,align:`start`,className:`max-w-[420px] p-2`,children:(0,H.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-[11px] leading-5`,children:n.map(([e,t])=>(0,H.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,H.jsx)(`span`,{className:`truncate text-foreground`,children:t})]},e))})})]})}function Y(e){return e.mode===`regex`?`${e.key} matches ${e.value}`:`${e.key} = ${e.value}`}function Me({predicates:e,onChange:t}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(`exact`),[u,p]=(0,V.useState)(null),[m,h]=(0,V.useState)([]),[y,b]=(0,V.useState)([]);(0,V.useEffect)(()=>{if(!n)return;let e=!1;return ne({q:i,limit:8}).then(t=>{e||h(t.keys)}).catch(()=>{e||h([])}),()=>{e=!0}},[i,n]),(0,V.useEffect)(()=>{if(!n||!i.trim()){b([]);return}let e=!1;return O(i.trim(),{q:o,limit:8}).then(t=>{e||b(t.values)}).catch(()=>{e||b([])}),()=>{e=!0}},[i,n,o]);function x(){let n=i.trim(),r=o.trim();if(!n||!r){p(`Enter an attribute key and value, or remove this filter.`);return}if(c===`regex`)try{new RegExp(r)}catch{p(`Enter a valid regular expression.`);return}p(null);let u=e.filter(e=>e.key!==n);t?.([...u,{key:n,value:r,mode:c}]),a(``),s(``),l(`exact`)}function ee(n){t?.(e.filter((e,t)=>t!==n))}return(0,H.jsxs)(v,{open:n,onOpenChange:r,children:[(0,H.jsx)(_,{asChild:!0,children:(0,H.jsxs)(S,{type:`button`,variant:e.length>0?`secondary`:`outline`,size:`sm`,"aria-label":`Filter by attributes`,className:`h-9 gap-2`,children:[(0,H.jsx)(ie,{className:`size-4`}),`Attributes`,e.length>0?` (${e.length})`:``]})}),(0,H.jsxs)(g,{align:`start`,className:`w-[380px] p-0`,children:[(0,H.jsx)(`div`,{className:`border-b px-3 py-2`,children:(0,H.jsx)(`h3`,{className:`text-sm font-medium`,children:`Filter by attributes`})}),(0,H.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-key`,children:`Key`}),(0,H.jsx)(w,{id:`run-attribute-key`,value:i,onChange:e=>{a(e.target.value),p(null)},placeholder:`git.branch`}),(0,H.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:m.length>0?m.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>a(e.key),children:[(0,H.jsx)(`span`,{className:`truncate font-mono`,children:e.key}),(0,H.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.key)):(0,H.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No attributes found`})})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-value`,children:`Value`}),(0,H.jsx)(w,{id:`run-attribute-value`,value:o,onChange:e=>{s(e.target.value),p(null)},placeholder:c===`regex`?`^(master|main)$`:`master`,"aria-describedby":u?`run-attribute-filter-error`:void 0}),(0,H.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:y.length>0?y.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>s(e.value),children:[(0,H.jsx)(`span`,{className:`truncate font-mono`,children:e.value}),(0,H.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.value)):(0,H.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No values found for this key`})})]})]}),(0,H.jsxs)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[(0,H.jsx)(`button`,{type:`button`,className:C(`rounded-[2px] px-2 py-1 text-xs`,c===`exact`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`exact`,onClick:()=>l(`exact`),children:`Exact match`}),(0,H.jsx)(`button`,{type:`button`,className:C(`rounded-[2px] px-2 py-1 text-xs`,c===`regex`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`regex`,onClick:()=>l(`regex`),children:`Regex`})]}),u?(0,H.jsx)(`p`,{id:`run-attribute-filter-error`,className:`text-xs text-destructive`,children:u}):null,(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(S,{type:`button`,size:`sm`,onClick:x,children:[(0,H.jsx)(d,{className:`size-4`}),`Apply filter`]}),(0,H.jsx)(S,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t?.([]),disabled:e.length===0,children:`Clear attributes`})]}),e.length>0?(0,H.jsx)(`div`,{className:`space-y-1 border-t pt-3`,children:e.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono`,children:Y(e)}),(0,H.jsx)(S,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e.key} filter`,onClick:()=>ee(t),children:(0,H.jsx)(f,{className:`size-3.5`})})]},`${e.key}-${e.mode}`))}):null]})]})]})}function X({status:e}){let t=D(e);return(0,H.jsx)(P,{className:M(t.tone),children:t.label})}function Ne({column:e,label:n}){return(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsxs)(S,{type:`button`,variant:`ghost`,size:`xs`,"data-runs-sort-button":`compact`,className:`h-7 max-w-full shrink justify-end px-1.5 text-[12px] leading-none text-foreground/90`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[(0,H.jsx)(`span`,{className:`truncate`,children:n}),(0,H.jsx)(t,{})]})})}var Pe=[{accessorKey:`status`,header:({column:e})=>(0,H.jsxs)(S,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Status`,(0,H.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{accessorKey:`name`,header:({column:e})=>(0,H.jsxs)(S,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,H.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`target`,accessorFn:e=>`${e.targetName??`No target`} ${e.platform}`,header:({column:e})=>(0,H.jsxs)(S,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,H.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`attributes`,accessorFn:e=>Object.entries(e.attributes??{}).map(([e,t])=>`${e}=${t}`).join(` `),header:`Attributes`},{accessorKey:`duration`,header:({column:e})=>(0,H.jsx)(Ne,{column:e,label:`Duration`})},{accessorKey:`createdAt`,header:({column:e})=>(0,H.jsx)(Ne,{column:e,label:`Started`})}];function Fe(e){e.stopPropagation()}function Ie(e,t){if(e.length===0)return!1;let n=e.filter(e=>t.has(e)).length;return n===0?!1:n===e.length?!0:`indeterminate`}function Le(e){let t=je[e];if(t)return{width:t,minWidth:t}}function Z(e){return C(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`&&`w-11 px-2 text-center`,e===`status`&&`w-[136px] px-3`,e===`name`&&`px-3`,e===`target`&&`w-[180px] px-3`,e===`attributes`&&`w-[260px] px-3`,e===`duration`&&`w-[104px] px-3 text-right`,e===`createdAt`&&`w-[128px] px-3 text-right`)}function Q(e,t){return C(`py-2 align-top`,e===`select`&&`w-11 px-2`,e===`status`&&`w-[136px] px-3`,e===`name`&&C(`max-w-0 px-3`,t&&`pl-8`),e===`target`&&`w-[180px] max-w-0 px-3 text-muted-foreground`,e===`attributes`&&`w-[260px] max-w-0 px-3`,e===`duration`&&`w-[104px] px-3 text-right tabular-nums`,e===`createdAt`&&`w-[128px] px-3 text-right tabular-nums`)}function $({isActive:e,isBatchSelected:t,isChild:n}){return C(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10`,n&&`bg-muted/[0.04]`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function Re(e,t){let n=[];for(let r of e)if(n.push({id:r.id,run:r,isChild:!1,parentId:null}),!(!K(r)||!t.has(r.id)))for(let e of r.tests??[])n.push({id:e.id,run:e,isChild:!0,parentId:r.id});return n}function ze({runs:e,total:t,isLoading:c,page:l,onPageChange:u,onSearchChange:d,searchValue:f,selectedRunId:p=null,onSelectedRunIdChange:h,expandedSuites:g=new Set,onToggleSuite:_,onOpenRun:v,onVisibleRunsChange:x,platformFilter:ee=``,onPlatformChange:te,targetFilter:ne=``,targetOptions:ie=[],onTargetChange:oe,attributePredicates:ce=[],onAttributePredicatesChange:le,sorting:fe,onSortingChange:C,headerActions:me,topSlot:he,enableSelection:E=!1,selectedRunIds:D=new Set,onToggleRunSelection:O,onToggleVisibleSelection:k}){let[ge,_e]=(0,V.useState)([]),A=fe??ge,ye=C??_e,j=F({data:e,columns:[...E?[{id:`select`,header:({table:e})=>(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(m,{checked:Ie(e.getRowModel().rows.map(e=>e.original.id),D),onCheckedChange:t=>k?.(e.getRowModel().rows.map(e=>e.original),t===!0),onClick:e=>e.stopPropagation(),"aria-label":`Select all`})}),enableSorting:!1}]:[],...Pe],getRowId:e=>e.id,getCoreRowModel:Ce(),getSortedRowModel:Se(),onSortingChange:ye,state:{sorting:A}}),be=j.getHeaderGroups(),M=j.getRowModel().rows,N=(0,V.useMemo)(()=>M.map(e=>e.original),[M]),xe=(0,V.useMemo)(()=>Re(N,g),[g,N]),P=Math.ceil(t/50),Ee=l*50+1,De=Math.min((l+1)*50,t),Oe=Array.from(new Set([ne,...ie].filter(e=>!!e))),ke=[...E?[`select`]:[],`status`,`name`,`target`,`attributes`,`duration`,`createdAt`],je=(0,V.useMemo)(()=>ce.map(e=>e.key),[ce]);(0,V.useEffect)(()=>{x?.(xe)},[x,xe]),(0,V.useEffect)(()=>{if(!p)return;let e=document.querySelector(`[data-runs-row-surface="${p}"]`);e&&document.activeElement!==e&&e.focus()},[p]);function U(e){return e.status===`running`&&e.startedAt?(0,H.jsx)(`span`,{className:`text-sm tabular-nums`,children:(0,H.jsx)(Ae,{startedAt:e.startedAt})}):e.status===`running`?(0,H.jsx)(`span`,{className:`text-sm text-blue-500`,children:`Starting...`}):(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:se(e.duration)})}function W(e,t){h?.(e.id),v?.(e,t)}function q(e,t){t.key===`Enter`&&(t.preventDefault(),W(e,t))}return(0,H.jsx)(ue,{children:(0,H.jsxs)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`shrink-0 space-y-4`,children:[he,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(w,{placeholder:`Search runs...`,value:f,onChange:e=>d(e.target.value),className:`max-w-[220px]`}),te&&(0,H.jsxs)(s,{value:ee||`all`,onValueChange:e=>te(e===`all`?``:e),children:[(0,H.jsx)(a,{className:`w-[140px]`,children:(0,H.jsx)(o,{placeholder:`All platforms`})}),(0,H.jsxs)(i,{children:[(0,H.jsx)(n,{value:`all`,children:`All platforms`}),(0,H.jsx)(n,{value:`web`,children:`Web`}),(0,H.jsx)(n,{value:`android`,children:`Android`}),(0,H.jsx)(n,{value:`ios`,children:`iOS`})]})]}),oe&&(0,H.jsxs)(s,{value:ne||`all`,onValueChange:e=>oe(e===`all`?``:e),children:[(0,H.jsx)(a,{className:`w-[180px]`,children:(0,H.jsx)(o,{placeholder:`All targets`})}),(0,H.jsxs)(i,{children:[(0,H.jsx)(n,{value:`all`,children:`All targets`}),Oe.map(e=>(0,H.jsx)(n,{value:e,children:e},e))]})]}),le&&(0,H.jsx)(Me,{predicates:ce,onChange:le}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}),me]})]})]}),(0,H.jsxs)(b,{className:`min-h-0 flex-1 rounded-md border`,children:[(0,H.jsxs)(Te,{className:`min-w-full table-fixed`,children:[(0,H.jsx)(`colgroup`,{children:ke.map(e=>(0,H.jsx)(`col`,{style:Le(e)},e))}),(0,H.jsx)(we,{children:be.map(e=>(0,H.jsx)(z,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,H.jsx)(L,{className:Z(e.column.id),children:e.isPlaceholder?null:I(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,H.jsx)(R,{children:M.length?M.map(e=>{let t=e.original,n=K(t),i=n&&g.has(t.id),a=t.tests??[],o=a.filter(e=>e.status===`passed`).length,s=p===t.id,c=D.has(t.id);return(0,H.jsxs)(V.Fragment,{children:[(0,H.jsxs)(z,{tabIndex:s?0:-1,"data-runs-row-surface":t.id,"data-active":String(s),"data-state":c?`selected`:void 0,"aria-selected":s,className:$({isActive:s,isBatchSelected:c,isChild:!1}),onClick:e=>W(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>q(t,e),children:[E&&(0,H.jsx)(B,{className:Q(`select`,!1),onClick:e=>e.stopPropagation(),children:(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(m,{checked:D.has(t.id),onCheckedChange:e=>O?.(t,e===!0),"aria-label":`Select row`})})}),(0,H.jsx)(B,{className:Q(`status`,!1),children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(X,{status:t.status}),n&&a.length>0&&(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/80 tabular-nums`,children:[o,`/`,a.length]})]})}),(0,H.jsx)(B,{className:Q(`name`,!1),children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[n&&(0,H.jsx)(`button`,{type:`button`,className:`rounded p-0.5 hover:bg-muted`,onClick:e=>{Fe(e),_?.(t.id)},children:i?(0,H.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}):(0,H.jsx)(pe,{className:`h-4 w-4 text-muted-foreground`})}),(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:t.name})]})}),(0,H.jsx)(B,{className:Q(`target`,!1),children:(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-[13px] leading-snug text-muted-foreground/90`,children:G(t)})}),(0,H.jsx)(B,{className:Q(`attributes`,!1),children:(0,H.jsx)(J,{attributes:t.attributes,activeKeys:je})}),(0,H.jsx)(B,{className:Q(`duration`,!1),children:U(t)}),(0,H.jsx)(B,{className:Q(`createdAt`,!1),children:(0,H.jsxs)(re,{children:[(0,H.jsx)(de,{asChild:!0,children:(0,H.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:T(t.createdAt)})}),(0,H.jsx)(ve,{children:ae(t.createdAt)})]})})]}),i&&a.map(t=>{let n=p===t.id;return(0,H.jsxs)(z,{tabIndex:n?0:-1,"data-runs-row-surface":t.id,"data-active":String(n),"aria-selected":n,className:$({isActive:n,isBatchSelected:!1,isChild:!0}),onClick:e=>W(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>q(t,e),children:[E&&(0,H.jsx)(B,{className:Q(`select`,!0)}),(0,H.jsx)(B,{className:Q(`status`,!0),children:(0,H.jsx)(X,{status:t.status})}),(0,H.jsx)(B,{className:Q(`name`,!0),children:(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-foreground/90`,children:t.name})}),(0,H.jsx)(B,{className:Q(`target`,!0),children:(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-[13px] leading-snug text-muted-foreground`,children:G(t)})}),(0,H.jsx)(B,{className:Q(`attributes`,!0),children:(0,H.jsx)(J,{attributes:t.attributes,activeKeys:je})}),(0,H.jsx)(B,{className:Q(`duration`,!0),children:U(t)}),(0,H.jsx)(B,{className:Q(`createdAt`,!0),children:(0,H.jsxs)(re,{children:[(0,H.jsx)(de,{asChild:!0,children:(0,H.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:T(t.createdAt)})}),(0,H.jsx)(ve,{children:ae(t.createdAt)})]})})]},`${e.id}-child-${t.id}`)})]},e.id)}):(0,H.jsx)(z,{children:(0,H.jsx)(B,{colSpan:ke.length,className:`h-24 text-center`,children:`No results.`})})})]}),(0,H.jsx)(y,{orientation:`horizontal`})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t>0?`Showing ${Ee}-${De} of ${t}`:`No runs found`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(S,{variant:`outline`,size:`sm`,onClick:()=>u(l-1),disabled:l===0,children:`Previous`}),(0,H.jsx)(S,{variant:`outline`,size:`sm`,onClick:()=>u(l+1),disabled:l>=P-1||P===0,children:`Next`})]})]})]})})}var Be=new Set([`all`,`running`,`queued`,`completed`,`failed`]),Ve=new Set([`asc`,`desc`]);function He(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function Ue(e){let t=new URLSearchParams;e.tab!==`all`&&t.set(`tab`,e.tab),e.search&&t.set(`search`,e.search),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target);for(let n of e.attributePredicates){if(!n.key||!n.value)continue;let e=n.mode===`regex`?`attributes[${n.key}][regex]`:`attributes[${n.key}]`;t.set(e,n.value)}return e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function We(e){let t=[];for(let[n,r]of e.entries()){let e=/^attributes\[([^\]]+)\](?:\[(regex)\])?$/.exec(n);!e||!r||t.push({key:e[1],value:r,mode:e[2]===`regex`?`regex`:`exact`})}return t}function Ge(){let[e,t]=ye(),n=e.get(`tab`),r=n&&Be.has(n)?n:`all`,i=e.get(`search`)??``,a=e.get(`platform`)??``,o=e.get(`target`)??``,s=(0,V.useMemo)(()=>We(e),[e]),c=e.get(`sort`)??``,l=e.get(`order`)??`desc`,u=Ve.has(l)?l:`desc`,d=He(e.get(`page`)),f=(0,V.useMemo)(()=>c?[{id:c,desc:u===`desc`}]:[],[c,u]),p=(0,V.useRef)(f);p.current=f;let m=(0,V.useMemo)(()=>({tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d}),[r,i,a,o,s,c,u,d]);(0,V.useEffect)(()=>{let n=Ue(m);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,m]);let h=(0,V.useCallback)((e,n)=>{let r={...m,...e};n?.resetPage&&(r.page=1),t(Ue(r),{replace:!0})},[t,m]);return{tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d,sorting:f,onSortingChange:(0,V.useCallback)(e=>{let t=typeof e==`function`?e(p.current):e;t.length>0?h({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):h({sort:``,order:`desc`})},[h]),setTab:(0,V.useCallback)(e=>h({tab:e},{resetPage:!0}),[h]),setSearch:(0,V.useCallback)(e=>h({search:e},{resetPage:!0}),[h]),setPlatform:(0,V.useCallback)(e=>h({platform:e},{resetPage:!0}),[h]),setTarget:(0,V.useCallback)(e=>h({target:e},{resetPage:!0}),[h]),setAttributePredicates:(0,V.useCallback)(e=>h({attributePredicates:e},{resetPage:!0}),[h]),setPage:(0,V.useCallback)(e=>h({page:e}),[h])}}var Ke={all:``,running:`running`,queued:`pending`,completed:`passed`,failed:`failed`};function qe(e,t){let n=e.trim().toLowerCase();if(!n)return!0;let r=t.runId.toLowerCase().includes(n),i=(t.testName??``).toLowerCase().includes(n);return r||i}function Je(){p(`Runs`);let e=be(),[t,n]=(0,V.useState)([]),[r,i]=(0,V.useState)(0),[a,o]=(0,V.useState)([]),[s,d]=(0,V.useState)(!0),{tab:f,search:m,platform:g,target:_,attributePredicates:v,page:y,sorting:b,onSortingChange:ne,setTab:ie,setSearch:ae,setPlatform:se,setTarget:pe,setAttributePredicates:C,setPage:w}=Ge(),[T,he]=(0,V.useState)(!1),[D,O]=(0,V.useState)(null),[k,ye]=(0,V.useState)([]),[j,M]=(0,V.useState)(()=>new Set),[F,Se]=(0,V.useState)(null),[Ce,I]=(0,V.useState)(!1),[we,L]=(0,V.useState)(!1),[R,z]=(0,V.useState)(!0),[B,Te]=(0,V.useState)(!0),{hasFarm:Ae,isLoading:je}=c(),U=(0,V.useCallback)(async(e,t,r,a)=>{try{if(r&&r!==`running`){n(e),i(t);return}let{executions:o}=await oe();if(o.length===0){n(e),i(t);return}let s=new Set(e.map(e=>e.id)),c=o.filter(e=>!s.has(e.runId)).filter(e=>qe(a,e)).map(e=>({id:e.runId,name:e.testName??`Running test...`,filePath:null,status:`running`,duration:e.duration,attributes:{},environment:null,metadata:null,startedAt:e.startedAt,endedAt:null,videoPath:null,failureSummary:null,errorLog:null,memoryLog:null,testId:null,suiteId:null,platform:`web`,testFileContent:null,modelName:null,llmProvider:null,parentRunId:null,attemptNumber:1,retryCount:0,maxRetries:0,createdAt:e.startedAt}));n([...c,...e]),i(t+c.length)}catch{n(e),i(t)}},[]),W=(0,V.useCallback)(e=>({limit:50,offset:(e.page-1)*50,name:e.name||void 0,status:e.status||void 0,platform:e.platform||void 0,target:e.target||void 0,attributes:e.attributes}),[]),G=Ke[f]??``,K=(0,V.useCallback)(async e=>{try{d(!0);let[t,n]=await Promise.all([N(W(e)),me()]);Se(n),o(t.targets??[]),await U(t.runs,t.total,e.status,e.name)}catch{A.error(`Failed to load runs`)}finally{d(!1),he(!0)}},[U,W]),q=(0,V.useCallback)(async e=>{try{let[t,n]=await Promise.all([N(W(e)),me()]);Se(n),o(t.targets??[]),await U(t.runs,t.total,e.status,e.name)}catch{}},[U,W]),J=(0,V.useMemo)(()=>({page:y,name:m,status:G,platform:g,target:_,attributes:v}),[y,m,G,g,_,v]);(0,V.useEffect)(()=>{K(J)},[K,J]),(0,V.useEffect)(()=>{if(!T)return;let e=setInterval(()=>{q(J)},5e3);return()=>clearInterval(e)},[T,q,J]),(0,V.useEffect)(()=>{O(null),M(new Set),ye([])},[f,m,g,_,v,y]),(0,V.useEffect)(()=>{D&&(k.some(e=>e.id===D)||O(t.find(e=>e.tests?.some(e=>e.id===D))?.id??null))},[t,D,k]);let Y=ke({items:t,getId:e=>e.id,visibleIds:t.map(e=>e.id)}),Me=Y.selectedIds,X=Y.selectedItems,Ne=(0,V.useCallback)(()=>{Y.clearSelection(),L(!1),z(!0),Te(!0)},[Y]),Pe=(0,V.useCallback)(async e=>{if(X.length===0)return;let t=X.flatMap(e=>e.filePath?[e.filePath]:[]);if(t.length===0){A.error(`No selected runs can be rerun`);return}I(!0);try{let n=await Promise.allSettled(t.map(t=>xe({file:t,local:e,noCache:!R,noMemory:!B}))),r=n.filter(e=>e.status===`fulfilled`).length,i=n.length-r;i>0?A.error(`${r} runs queued, ${i} failed`):A.success(`${r} runs queued`),L(!1)}finally{I(!1)}},[X,R,B]),Fe=(0,V.useCallback)(async()=>{if(X.length===0)return;let e=Array.from(new Set(X.flatMap(e=>e.filePath?[e.filePath]:[])));if(e.length===0){A.error(`No selected runs have file paths to purge`);return}I(!0);try{let t=await Promise.allSettled(e.map(e=>ge({file:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.filter(e=>e.status===`fulfilled`).reduce((e,t)=>e+t.value.purged,0),i=t.length-n;i>0?A.error(`Purged ${r} plans from ${n} tests, ${i} failed`):A.success(`Purged ${r} cached plan${r===1?``:`s`} from ${n} test${n===1?``:`s`}`)}finally{I(!1)}},[X]),Ie=(0,V.useCallback)(async()=>{if(X.length!==0){I(!0);try{let e=await Promise.allSettled(X.map(e=>_e(e.id))),t=X.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(e.flatMap(e=>e.status===`fulfilled`?e.value.deletedRunIds:[])),a=e.length-t.length;t.length>0&&(Y.setItemsSelected(t,!1),n(e=>e.filter(e=>!r.has(e.id))),i(e=>Math.max(0,e-t.length)),L(!1)),a>0?A.error(`Deleted ${t.length} run${t.length===1?``:`s`}, ${a} failed`):A.success(`Deleted ${t.length} run${t.length===1?``:`s`}`)}finally{I(!1)}}},[X,Y]),Le=(0,V.useCallback)(e=>{M(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Z=(0,V.useCallback)((t,n)=>{let r=fe.runDetailOrLive(t.id,t.status);if(n?.metaKey||n?.ctrlKey||n?.button===1){window.open(r,`_blank`,`noopener,noreferrer`);return}e(r)},[e]),Q=(0,V.useCallback)((e,t)=>{Z(e,t)},[Z]),$=(0,V.useMemo)(()=>k.findIndex(e=>e.id===D),[D,k]);De((0,V.useMemo)(()=>{let e=e=>{if(k.length!==0){if($===-1){O(e>0?k[0].id:k[k.length-1].id);return}O(k[Math.max(0,Math.min($+e,k.length-1))].id)}},t=()=>e(1),n=()=>e(-1);return{j:t,arrowdown:t,k:n,arrowup:n,enter:e=>{$<0||Z(k[$].run,e)}}},[Z,$,k]));let Re=F?.running.count??0,Be=F?.pending.count??0,Ve=Be>0||Re>0;if(!T)return(0,H.jsx)(E,{});let He=!!m||f!==`all`||!!g||!!_||v.length>0;if(t.length===0&&!He)return(0,H.jsx)(Ee,{icon:ce,title:`No test runs yet`,description:`Run your first test to see results here`,actionLabel:`View Tests`,onAction:()=>e(fe.tests)});let Ue=(0,H.jsx)(te,{value:f,onValueChange:ie,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(ee,{variant:`line`,children:[(0,H.jsx)(x,{value:`all`,children:`All`}),(0,H.jsxs)(x,{value:`running`,children:[`Running`,Re>0&&(0,H.jsx)(P,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Re})]}),(0,H.jsxs)(x,{value:`queued`,children:[`Queued`,Be>0&&(0,H.jsx)(P,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Be})]}),(0,H.jsx)(x,{value:`completed`,children:`Completed`}),(0,H.jsx)(x,{value:`failed`,children:`Failed`})]}),Ve&&F&&(0,H.jsxs)(P,{variant:`outline`,className:`text-xs`,children:[F.activeSlots,`/`,F.concurrency,` slots`]})]})});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4 overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3`,children:[(0,H.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Runs`}),(0,H.jsx)(ue,{children:(0,H.jsxs)(re,{children:[(0,H.jsx)(de,{asChild:!0,children:(0,H.jsx)(S,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,H.jsx)(u,{className:`h-4 w-4`})})}),(0,H.jsx)(ve,{side:`bottom`,className:`p-3`,children:(0,H.jsx)(l,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open run`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]})})]}),(0,H.jsx)(ze,{topSlot:Ue,runs:t,total:r,isLoading:s,page:y-1,onPageChange:e=>w(e+1),onSearchChange:ae,searchValue:m,selectedRunId:D,onSelectedRunIdChange:O,expandedSuites:j,onToggleSuite:Le,onOpenRun:Q,onVisibleRunsChange:ye,platformFilter:g,onPlatformChange:se,targetFilter:_,targetOptions:a,onTargetChange:pe,attributePredicates:v,onAttributePredicatesChange:C,sorting:b,onSortingChange:ne,enableSelection:!0,selectedRunIds:Y.selectedIdSet,onToggleRunSelection:Y.setItemSelected,onToggleVisibleSelection:Y.setItemsSelected}),(0,H.jsx)(h,{selectedCount:Me.length,summaryMeta:Y.hiddenCount>0?`${Y.hiddenCount} hidden by filters`:void 0,secondaryIcon:(0,H.jsx)(le,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:Ie,actionSlot:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Oe,{selectedCount:Y.selectedCount,hiddenCount:Y.hiddenCount,useCache:R,useMemory:B,browserStackAvailable:!je&&Ae,open:we,onOpenChange:L,onUseCacheChange:z,onUseMemoryChange:Te,onRunLocal:()=>Pe(!0),onRunBrowserStack:()=>Pe(!1),disabled:Ce}),(0,H.jsx)(S,{variant:`outline`,size:`sm`,onClick:Fe,disabled:Ce,children:`Purge cache`})]}),onCancel:Ne,isRunning:Ce})]})}export{Je as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./dist-o2A-YJGQ.js";import{n,r}from"./use-page-title-CK82kWb2.js";import{$t as i,Cn as a,On as o,Qt as s,Sn as c,Tn as l,Ut as u,Xt as d,Yt as f,Zn as p,Zt as m,_n as h,bn as g,dn as _,dr as v,fn as y,fr as b,gn as x,hn as S,jn as C,mn as w,pn as ee,qn as T,vn as E,wn as D,xn as O}from"./index-B3xPCIyH.js";var k=T(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),A=T(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),j=T(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=e(v(),1),N=e(b(),1);function P(e){let t=N.useRef({value:e,previous:e});return N.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var F=p(),I=[` `,`Enter`,`ArrowUp`,`ArrowDown`],L=[` `,`Enter`],R=`Select`,[z,B,V]=t(R),[H,U]=a(R,[V,i]),W=i(),[te,G]=H(R),[ne,re]=H(R),K=e=>{let{__scopeSelect:t,children:n,open:i,defaultOpen:a,onOpenChange:o,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:_}=e,v=W(t),[y,b]=N.useState(null),[x,S]=N.useState(null),[C,w]=N.useState(!1),ee=r(d),[T,D]=g({prop:i,defaultProp:a??!1,onChange:o,caller:R}),[O,k]=g({prop:c,defaultProp:l,onChange:u,caller:R}),A=N.useRef(null),j=y?_||!!y.closest(`form`):!0,[M,P]=N.useState(new Set),I=Array.from(M).map(e=>e.props.value).join(`;`);return(0,F.jsx)(s,{...v,children:(0,F.jsxs)(te,{required:h,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:E(),value:O,onValueChange:k,open:T,onOpenChange:D,dir:ee,triggerPointerDownPosRef:A,disabled:m,children:[(0,F.jsx)(z.Provider,{scope:t,children:(0,F.jsx)(ne,{scope:e.__scopeSelect,onNativeOptionAdd:N.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:N.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),j?(0,F.jsxs)(Ge,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:O,onChange:e=>k(e.target.value),disabled:m,form:_,children:[O===void 0?(0,F.jsx)(`option`,{value:``}):null,Array.from(M)]},I):null]})})};K.displayName=R;var ie=`SelectTrigger`,q=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=W(n),o=G(ie,n),s=o.disabled||r,u=C(t,o.onTriggerChange),d=B(n),p=N.useRef(`touch`),[m,h,g]=qe(e=>{let t=d().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=e=>{s||(o.onOpenChange(!0),g()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(f,{asChild:!0,...a,children:(0,F.jsx)(l.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ke(o.value)?``:void 0,...i,ref:u,onClick:c(i.onClick,e=>{e.currentTarget.focus(),p.current!==`mouse`&&_(e)}),onPointerDown:c(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:c(i.onKeyDown,e=>{let t=m.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&h(e.key),!(t&&e.key===` `)&&I.includes(e.key)&&(_(),e.preventDefault())})})})});q.displayName=ie;var ae=`SelectValue`,oe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=G(ae,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=C(t,c.onValueNodeChange);return O(()=>{u(d)},[u,d]),(0,F.jsx)(l.span,{...s,ref:f,style:{pointerEvents:`none`},children:Ke(c.value)?(0,F.jsx)(F.Fragment,{children:o}):a})});oe.displayName=ae;var se=`SelectIcon`,ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(l.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ce.displayName=se;var le=`SelectPortal`,ue=e=>(0,F.jsx)(w,{asChild:!0,...e});ue.displayName=le;var J=`SelectContent`,de=N.forwardRef((e,t)=>{let n=G(J,e.__scopeSelect),[r,i]=N.useState();if(O(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?M.createPortal((0,F.jsx)(fe,{scope:e.__scopeSelect,children:(0,F.jsx)(z.Slot,{scope:e.__scopeSelect,children:(0,F.jsx)(`div`,{children:e.children})})}),t):null}return(0,F.jsx)(he,{...e,ref:t})});de.displayName=J;var Y=10,[fe,X]=H(J),pe=`SelectContentImpl`,me=o(`SelectContent.RemoveScroll`),he=N.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:v,...b}=e,w=G(J,n),[T,E]=N.useState(null),[D,O]=N.useState(null),k=C(t,e=>E(e)),[A,j]=N.useState(null),[M,P]=N.useState(null),I=B(n),[L,R]=N.useState(!1),z=N.useRef(!1);N.useEffect(()=>{if(T)return _(T)},[T]),ee();let V=N.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[I,D]),H=N.useCallback(()=>V([A,T]),[V,A,T]);N.useEffect(()=>{L&&H()},[L,H]);let{onOpenChange:U,triggerPointerDownPosRef:W}=w;N.useEffect(()=>{if(T){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():T.contains(n.target)||U(!1),document.removeEventListener(`pointermove`,t),W.current=null};return W.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[T,U,W]),N.useEffect(()=>{let e=()=>U(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[U]);let[te,ne]=qe(e=>{let t=I().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),re=N.useCallback((e,t,n)=>{let r=!z.current&&!n;(w.value!==void 0&&w.value===t||r)&&(j(e),r&&(z.current=!0))},[w.value]),K=N.useCallback(()=>T?.focus(),[T]),ie=N.useCallback((e,t,n)=>{let r=!z.current&&!n;(w.value!==void 0&&w.value===t||r)&&P(e)},[w.value]),q=r===`popper`?ye:_e,ae=q===ye?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:v}:{};return(0,F.jsx)(fe,{scope:n,content:T,viewport:D,onViewportChange:O,itemRefCallback:re,selectedItem:A,onItemLeave:K,itemTextRefCallback:ie,focusSelectedItem:H,selectedItemText:M,position:r,isPositioned:L,searchRef:te,children:(0,F.jsx)(y,{as:me,allowPinchZoom:!0,children:(0,F.jsx)(S,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:c(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(x,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,F.jsx)(q,{role:`listbox`,id:w.contentId,"data-state":w.open?`open`:`closed`,dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...ae,onPlaced:()=>R(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:c(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});he.displayName=pe;var ge=`SelectItemAlignedPosition`,_e=N.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:i,...a}=e,o=G(J,r),s=X(J,r),[c,u]=N.useState(null),[d,f]=N.useState(null),p=C(t,e=>f(e)),m=B(r),h=N.useRef(!1),g=N.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=N.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&_&&v&&y){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),a=y.getBoundingClientRect();if(o.dir!==`rtl`){let i=a.left-t.left,o=r.left-i,s=e.left-o,l=e.width+s,u=Math.max(l,t.width),d=window.innerWidth-Y,f=n(o,[Y,Math.max(Y,d-u)]);c.style.minWidth=l+`px`,c.style.left=f+`px`}else{let i=t.right-a.right,o=window.innerWidth-r.right-i,s=window.innerWidth-e.right-o,l=e.width+s,u=Math.max(l,t.width),d=window.innerWidth-Y,f=n(o,[Y,Math.max(Y,d-u)]);c.style.minWidth=l+`px`,c.style.right=f+`px`}let s=m(),l=window.innerHeight-Y*2,u=_.scrollHeight,f=window.getComputedStyle(d),p=parseInt(f.borderTopWidth,10),g=parseInt(f.paddingTop,10),b=parseInt(f.borderBottomWidth,10),x=parseInt(f.paddingBottom,10),S=p+g+u+x+b,C=Math.min(v.offsetHeight*5,S),w=window.getComputedStyle(_),ee=parseInt(w.paddingTop,10),T=parseInt(w.paddingBottom,10),E=e.top+e.height/2-Y,D=l-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=p+g+k,j=S-A;if(A<=E){let e=s.length>0&&v===s[s.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+b);c.style.height=n+`px`}else{let e=s.length>0&&v===s[0].ref.current;c.style.top=`0px`;let t=Math.max(E,p+_.offsetTop+(e?ee:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=C+`px`,c.style.maxHeight=l+`px`,i?.(),requestAnimationFrame(()=>h.current=!0)}},[m,o.trigger,o.valueNode,c,d,_,v,y,o.dir,i]);O(()=>x(),[x]);let[S,w]=N.useState();return O(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,F.jsx)(be,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]),children:(0,F.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,F.jsx)(l.div,{...a,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});_e.displayName=ge;var ve=`SelectPopperPosition`,ye=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=W(n);return(0,F.jsx)(m,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ye.displayName=ve;var[be,xe]=H(J,{}),Se=`SelectViewport`,Ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Se,n),o=xe(Se,n),s=C(t,a.onViewportChange),u=N.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(l.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:c(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});Ce.displayName=Se;var we=`SelectGroup`,[Te,Ee]=H(we),De=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=E();return(0,F.jsx)(Te,{scope:n,id:i,children:(0,F.jsx)(l.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});De.displayName=we;var Oe=`SelectLabel`,ke=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ee(Oe,n);return(0,F.jsx)(l.div,{id:i.id,...r,ref:t})});ke.displayName=Oe;var Z=`SelectItem`,[Ae,je]=H(Z),Me=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=G(Z,n),u=X(Z,n),d=s.value===r,[f,p]=N.useState(a??``),[m,h]=N.useState(!1),g=C(t,e=>u.itemRefCallback?.(e,r,i)),_=E(),v=N.useRef(`touch`),y=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,F.jsx)(Ae,{scope:n,value:r,disabled:i,textId:_,isSelected:d,onItemTextChange:N.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(z.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,F.jsx)(l.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:c(o.onFocus,()=>h(!0)),onBlur:c(o.onBlur,()=>h(!1)),onClick:c(o.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:c(o.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:c(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:c(o.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:c(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:c(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(L.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})});Me.displayName=Z;var Q=`SelectItemText`,Ne=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=G(Q,n),s=X(Q,n),c=je(Q,n),u=re(Q,n),[d,f]=N.useState(null),p=C(t,e=>f(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=d?.textContent,h=N.useMemo(()=>(0,F.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=u;return O(()=>(g(h),()=>_(h)),[g,_,h]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(l.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?M.createPortal(a.children,o.valueNode):null]})});Ne.displayName=Q;var Pe=`SelectItemIndicator`,Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return je(Pe,n).isSelected?(0,F.jsx)(l.span,{"aria-hidden":!0,...r,ref:t}):null});Fe.displayName=Pe;var Ie=`SelectScrollUpButton`,Le=N.forwardRef((e,t)=>{let n=X(Ie,e.__scopeSelect),r=xe(Ie,e.__scopeSelect),[i,a]=N.useState(!1),o=C(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(Be,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Le.displayName=Ie;var Re=`SelectScrollDownButton`,ze=N.forwardRef((e,t)=>{let n=X(Re,e.__scopeSelect),r=xe(Re,e.__scopeSelect),[i,a]=N.useState(!1),o=C(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(Be,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ze.displayName=Re;var Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=N.useRef(null),s=B(n),u=N.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return N.useEffect(()=>()=>u(),[u]),O(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(l.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:c(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:c(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:c(i.onPointerLeave,()=>{u()})})}),Ve=`SelectSeparator`,He=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(l.div,{"aria-hidden":!0,...r,ref:t})});He.displayName=Ve;var $=`SelectArrow`,Ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n),a=G($,n),o=X($,n);return a.open&&o.position===`popper`?(0,F.jsx)(d,{...i,...r,ref:t}):null});Ue.displayName=$;var We=`SelectBubbleInput`,Ge=N.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=N.useRef(null),a=C(r,i),o=P(t);return N.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,F.jsx)(l.select,{...n,style:{...D,...n.style},ref:a,defaultValue:t})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=h(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=K,Ze=q,Qe=oe,$e=ce,et=ue,tt=de,nt=Ce,rt=De,it=ke,at=Me,ot=Ne,st=Fe,ct=Le,lt=ze;function ut({...e}){return(0,F.jsx)(Xe,{"data-slot":`select`,...e})}function dt({...e}){return(0,F.jsx)(rt,{"data-slot":`select-group`,...e})}function ft({...e}){return(0,F.jsx)(Qe,{"data-slot":`select-value`,...e})}function pt({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:u(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,F.jsx)($e,{asChild:!0,children:(0,F.jsx)(A,{className:`size-4 opacity-50`})})]})}function mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,F.jsx)(et,{children:(0,F.jsxs)(tt,{"data-slot":`select-content`,className:u(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,F.jsx)(_t,{}),(0,F.jsx)(nt,{className:u(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,F.jsx)(vt,{})]})})}function ht({className:e,...t}){return(0,F.jsx)(it,{"data-slot":`select-label`,className:u(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}function gt({className:e,children:t,...n}){return(0,F.jsxs)(at,{"data-slot":`select-item`,className:u(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,F.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(st,{children:(0,F.jsx)(k,{className:`size-4`})})}),(0,F.jsx)(ot,{children:t})]})}function _t({className:e,...t}){return(0,F.jsx)(ct,{"data-slot":`select-scroll-up-button`,className:u(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(j,{className:`size-4`})})}function vt({className:e,...t}){return(0,F.jsx)(lt,{"data-slot":`select-scroll-down-button`,className:u(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(A,{className:`size-4`})})}export{ht as a,P as c,gt as i,A as l,mt as n,pt as o,dt as r,ft as s,ut as t,k as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{l as t}from"./select-B5gV6YUf.js";import{t as n}from"./shortcut-hints-CfVf0REF.js";import{t as r}from"./dist-o2A-YJGQ.js";import{r as i}from"./use-page-title-CK82kWb2.js";import{n as a,r as o,t as s}from"./dist-DZYW0-Ta.js";import{$t as c,An as l,B as u,Cn as d,En as f,Ht as p,Ln as m,On as h,Qt as g,Sn as _,Tn as v,Ut as y,Xt as ee,Yt as te,Zn as b,Zt as ne,_n as x,bn as re,dn as S,fn as ie,fr as ae,gn as oe,hn as se,jn as C,mn as w,pn as ce,qn as T,vn as E,yn as D}from"./index-B3xPCIyH.js";var O=T(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),k=T(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),A=e(ae(),1),j=b(),M=[`Enter`,` `],le=[`ArrowDown`,`PageUp`,`Home`],ue=[`ArrowUp`,`PageDown`,`End`],de=[...le,...ue],fe={ltr:[...M,`ArrowRight`],rtl:[...M,`ArrowLeft`]},N={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},P=`Menu`,[F,pe,me]=r(P),[I,he]=d(P,[me,c,o]),L=c(),ge=o(),[_e,R]=I(P),[ve,z]=I(P),ye=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,c=L(t),[l,u]=A.useState(null),d=A.useRef(!1),f=x(o),p=i(a);return A.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,j.jsx)(g,{...c,children:(0,j.jsx)(_e,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,j.jsx)(ve,{scope:t,onClose:A.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};ye.displayName=P;var be=`MenuAnchor`,xe=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=L(n);return(0,j.jsx)(te,{...i,...r,ref:t})});xe.displayName=be;var Se=`MenuPortal`,[Ce,we]=I(Se,{forceMount:void 0}),Te=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=R(Se,t);return(0,j.jsx)(Ce,{scope:t,forceMount:n,children:(0,j.jsx)(D,{present:n||a.open,children:(0,j.jsx)(w,{asChild:!0,container:i,children:r})})})};Te.displayName=Se;var B=`MenuContent`,[Ee,V]=I(B),De=A.forwardRef((e,t)=>{let n=we(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=R(B,e.__scopeMenu),o=z(B,e.__scopeMenu);return(0,j.jsx)(F.Provider,{scope:e.__scopeMenu,children:(0,j.jsx)(D,{present:r||a.open,children:(0,j.jsx)(F.Slot,{scope:e.__scopeMenu,children:o.modal?(0,j.jsx)(Oe,{...i,ref:t}):(0,j.jsx)(ke,{...i,ref:t})})})})}),Oe=A.forwardRef((e,t)=>{let n=R(B,e.__scopeMenu),r=A.useRef(null),i=C(t,r);return A.useEffect(()=>{let e=r.current;if(e)return S(e)},[]),(0,j.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ke=A.forwardRef((e,t)=>{let n=R(B,e.__scopeMenu);return(0,j.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ae=h(`MenuContent.ScrollLock`),H=A.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,v=R(B,n),y=z(B,n),ee=L(n),te=ge(n),b=pe(n),[x,re]=A.useState(null),S=A.useRef(null),ae=C(t,S,v.onContentChange),w=A.useRef(0),T=A.useRef(``),E=A.useRef(0),D=A.useRef(null),O=A.useRef(`right`),k=A.useRef(0),M=h?ie:A.Fragment,le=h?{as:Ae,allowPinchZoom:!0}:void 0,fe=e=>{let t=T.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ct(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){T.current=t,window.clearTimeout(w.current),t!==``&&(w.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};A.useEffect(()=>()=>window.clearTimeout(w.current),[]),ce();let N=A.useCallback(e=>O.current===D.current?.side&&ut(e,D.current?.area),[]);return(0,j.jsx)(Ee,{scope:n,searchRef:T,onItemEnter:A.useCallback(e=>{N(e)&&e.preventDefault()},[N]),onItemLeave:A.useCallback(e=>{N(e)||(S.current?.focus(),re(null))},[N]),onTriggerLeave:A.useCallback(e=>{N(e)&&e.preventDefault()},[N]),pointerGraceTimerRef:E,onPointerGraceIntentChange:A.useCallback(e=>{D.current=e},[]),children:(0,j.jsx)(M,{...le,children:(0,j.jsx)(se,{asChild:!0,trapped:i,onMountAutoFocus:_(o,e=>{e.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,j.jsx)(oe,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:(0,j.jsx)(a,{asChild:!0,...te,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:re,onEntryFocus:_(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,j.jsx)(ne,{role:`menu`,"aria-orientation":`vertical`,"data-state":it(v.open),"data-radix-menu-content":``,dir:y.dir,...ee,...g,ref:ae,style:{outline:`none`,...g.style},onKeyDown:_(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&fe(e.key));let i=S.current;if(e.target!==i||!de.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);ue.includes(e.key)&&a.reverse(),ot(a)}),onBlur:_(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(w.current),T.current=``)}),onPointerMove:_(e.onPointerMove,Y(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(O.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});De.displayName=B;var je=`MenuGroup`,U=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(v.div,{role:`group`,...r,ref:t})});U.displayName=je;var Me=`MenuLabel`,Ne=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(v.div,{...r,ref:t})});Ne.displayName=Me;var W=`MenuItem`,Pe=`menu.itemSelect`,G=A.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=A.useRef(null),o=z(W,e.__scopeMenu),s=V(W,e.__scopeMenu),c=C(t,a),l=A.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Pe,{bubbles:!0,cancelable:!0});e.addEventListener(Pe,e=>r?.(e),{once:!0}),f(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,j.jsx)(Fe,{...i,ref:c,disabled:n,onClick:_(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:_(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:_(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||M.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});G.displayName=W;var Fe=A.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=V(W,n),c=ge(n),l=A.useRef(null),u=C(t,l),[d,f]=A.useState(!1),[p,m]=A.useState(``);return A.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),(0,j.jsx)(F.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,j.jsx)(s,{asChild:!0,...c,focusable:!r,children:(0,j.jsx)(v.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:_(e.onPointerMove,Y(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_(e.onPointerLeave,Y(e=>o.onItemLeave(e))),onFocus:_(e.onFocus,()=>f(!0)),onBlur:_(e.onBlur,()=>f(!1))})})})}),Ie=`MenuCheckboxItem`,Le=A.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,j.jsx)(We,{scope:e.__scopeMenu,checked:n,children:(0,j.jsx)(G,{role:`menuitemcheckbox`,"aria-checked":J(n)?`mixed`:n,...i,ref:t,"data-state":at(n),onSelect:_(i.onSelect,()=>r?.(J(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Le.displayName=Ie;var Re=`MenuRadioGroup`,[ze,Be]=I(Re,{value:void 0,onValueChange:()=>{}}),Ve=A.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=x(r);return(0,j.jsx)(ze,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,j.jsx)(U,{...i,ref:t})})});Ve.displayName=Re;var He=`MenuRadioItem`,Ue=A.forwardRef((e,t)=>{let{value:n,...r}=e,i=Be(He,e.__scopeMenu),a=n===i.value;return(0,j.jsx)(We,{scope:e.__scopeMenu,checked:a,children:(0,j.jsx)(G,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":at(a),onSelect:_(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ue.displayName=He;var K=`MenuItemIndicator`,[We,Ge]=I(K,{checked:!1}),Ke=A.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Ge(K,n);return(0,j.jsx)(D,{present:r||J(a.checked)||a.checked===!0,children:(0,j.jsx)(v.span,{...i,ref:t,"data-state":at(a.checked)})})});Ke.displayName=K;var qe=`MenuSeparator`,Je=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,j.jsx)(v.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Je.displayName=qe;var Ye=`MenuArrow`,Xe=A.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=L(n);return(0,j.jsx)(ee,{...i,...r,ref:t})});Xe.displayName=Ye;var Ze=`MenuSub`,[Qe,$e]=I(Ze),et=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=R(Ze,t),o=L(t),[s,c]=A.useState(null),[l,u]=A.useState(null),d=x(i);return A.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,j.jsx)(g,{...o,children:(0,j.jsx)(_e,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,j.jsx)(Qe,{scope:t,contentId:E(),triggerId:E(),trigger:s,onTriggerChange:c,children:n})})})};et.displayName=Ze;var q=`MenuSubTrigger`,tt=A.forwardRef((e,t)=>{let n=R(q,e.__scopeMenu),r=z(q,e.__scopeMenu),i=$e(q,e.__scopeMenu),a=V(q,e.__scopeMenu),o=A.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=A.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return A.useEffect(()=>d,[d]),A.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,j.jsx)(xe,{asChild:!0,...u,children:(0,j.jsx)(Fe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":it(n.open),...e,ref:l(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_(e.onPointerMove,Y(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:_(e.onPointerLeave,Y(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:_(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||fe[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});tt.displayName=q;var nt=`MenuSubContent`,rt=A.forwardRef((e,t)=>{let n=we(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=R(B,e.__scopeMenu),o=z(B,e.__scopeMenu),s=$e(nt,e.__scopeMenu),c=A.useRef(null),l=C(t,c);return(0,j.jsx)(F.Provider,{scope:e.__scopeMenu,children:(0,j.jsx)(D,{present:r||a.open,children:(0,j.jsx)(F.Slot,{scope:e.__scopeMenu,children:(0,j.jsx)(H,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:_(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:_(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:_(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=N[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});rt.displayName=nt;function it(e){return e?`open`:`closed`}function J(e){return e===`indeterminate`}function at(e){return J(e)?`indeterminate`:e?`checked`:`unchecked`}function ot(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function st(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ct(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=st(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ut(e,t){return t?lt({x:e.clientX,y:e.clientY},t):!1}function Y(e){return t=>t.pointerType===`mouse`?e(t):void 0}var dt=ye,ft=xe,pt=Te,mt=De,ht=U,gt=Ne,_t=G,vt=Le,yt=Ve,bt=Ue,xt=Ke,St=Je,Ct=Xe,wt=tt,Tt=rt,X=`DropdownMenu`,[Et,Dt]=d(X,[he]),Z=he(),[Ot,kt]=Et(X),At=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=A.useRef(null),[u,d]=re({prop:i,defaultProp:a??!1,onChange:o,caller:X});return(0,j.jsx)(Ot,{scope:t,triggerId:E(),triggerRef:l,contentId:E(),open:u,onOpenChange:d,onOpenToggle:A.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,j.jsx)(dt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};At.displayName=X;var jt=`DropdownMenuTrigger`,Mt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=kt(jt,n),o=Z(n);return(0,j.jsx)(ft,{asChild:!0,...o,children:(0,j.jsx)(v.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:l(t,a.triggerRef),onPointerDown:_(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:_(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Mt.displayName=jt;var Nt=`DropdownMenuPortal`,Pt=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,j.jsx)(pt,{...r,...n})};Pt.displayName=Nt;var Ft=`DropdownMenuContent`,It=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=kt(Ft,n),a=Z(n),o=A.useRef(!1);return(0,j.jsx)(mt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:_(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:_(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});It.displayName=Ft;var Lt=`DropdownMenuGroup`,Rt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(ht,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuLabel`,Bt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(gt,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuItem`,Ht=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(_t,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuCheckboxItem`,Wt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(vt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuRadioGroup`,Kt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(yt,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuRadioItem`,Jt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(bt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuItemIndicator`,Xt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(xt,{...i,...r,ref:t})});Xt.displayName=Yt;var Zt=`DropdownMenuSeparator`,Qt=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(St,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=`DropdownMenuArrow`,en=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(Ct,{...i,...r,ref:t})});en.displayName=$t;var tn=`DropdownMenuSubTrigger`,nn=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(wt,{...i,...r,ref:t})});nn.displayName=tn;var rn=`DropdownMenuSubContent`,an=A.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,j.jsx)(Tt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});an.displayName=rn;var on=At,sn=Mt,cn=Pt,ln=It,un=Ht,dn=Qt;function fn({...e}){return(0,j.jsx)(on,{"data-slot":`dropdown-menu`,...e})}function pn({...e}){return(0,j.jsx)(sn,{"data-slot":`dropdown-menu-trigger`,...e})}function mn({className:e,sideOffset:t=4,...n}){return(0,j.jsx)(cn,{children:(0,j.jsx)(ln,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:y(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Q({className:e,inset:t,variant:n=`default`,...r}){return(0,j.jsx)(un,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:y(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function hn({className:e,...t}){return(0,j.jsx)(dn,{"data-slot":`dropdown-menu-separator`,className:y(`-mx-1 my-1 h-px bg-border`,e),...t})}var $=null,gn=null;function _n(){let[e,t]=(0,A.useState)(()=>$?{...$,isLoading:!1}:{defaultRunMode:`local`,hasFarm:!1,isLoading:!0});return(0,A.useEffect)(()=>{if($){t({...$,isLoading:!1});return}gn||=u().then(e=>{let t=e.config,n=t.farm;$={defaultRunMode:t.defaultRunMode===`farm`?`farm`:`local`,hasFarm:!!n?.provider}}).catch(()=>{$={defaultRunMode:`local`,hasFarm:!1}}).finally(()=>{gn=null}),gn.then(()=>{t({...$,isLoading:!1})})},[]),e}function vn({onRun:e,onRunNoCache:r,onPurgeCache:i,disabled:a=!1,size:o=`default`,className:s,label:c,shortcutKey:l}){let{hasFarm:u}=_n(),d=u||!!r||!!i,f=c??`Run`,h=l?(0,j.jsx)(n,{shortcut:l,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`}):null;return d?(0,j.jsxs)(`div`,{className:y(`inline-flex items-center`,s),children:[(0,j.jsxs)(p,{size:o,disabled:a,onClick:()=>e(!0),className:`rounded-r-none`,children:[(0,j.jsx)(m,{className:`size-4`}),f,h]}),(0,j.jsxs)(fn,{children:[(0,j.jsx)(pn,{asChild:!0,children:(0,j.jsx)(p,{variant:`default`,size:o,disabled:a,className:`rounded-l-none border-l border-l-primary-foreground/20 px-2`,children:(0,j.jsx)(t,{className:`h-4 w-4`})})}),(0,j.jsxs)(mn,{align:`end`,children:[(0,j.jsxs)(Q,{onClick:()=>e(!0),children:[(0,j.jsx)(k,{className:`mr-2 h-4 w-4`}),`Run Local`]}),u&&(0,j.jsxs)(Q,{onClick:()=>e(!1),children:[(0,j.jsx)(O,{className:`mr-2 h-4 w-4`}),`Run on Farm`]}),(r||i)&&(0,j.jsx)(hn,{}),r&&(0,j.jsx)(Q,{onClick:()=>r(!0),children:`Run without cache`}),i&&(0,j.jsx)(Q,{onClick:i,children:`Purge cache`})]})]})]}):(0,j.jsxs)(p,{size:o,disabled:a,onClick:()=>e(!0),className:s,children:[(0,j.jsx)(m,{className:`size-4`}),f,h]})}export{Q as a,O as c,mn as i,_n as n,pn as o,fn as r,k as s,vn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{qn as e}from"./index-B3xPCIyH.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./id-badge-Dzm7eQ9l.js";import{t as n}from"./monaco-editor-CDJrOpKK.js";import{n as r}from"./split-button-C7J0EKrF.js";import{a as i,c as a,i as o,n as s,o as ee,r as te,s as c,t as l}from"./filename-validation-BOmZP9gf.js";import{t as ne}from"./use-page-title-CK82kWb2.js";import{a as re,n as ie}from"./dist-DFSjTjXY.js";import{i as ae,n as oe,r as se,t as ce}from"./tabs-CfNQIHt-.js";import{At as le,B as ue,Bn as de,D as fe,Dt as pe,E as me,Ft as he,It as ge,Jt as _e,Lt as ve,Nt as u,Qn as d,Rt as ye,S as be,Tt as xe,Vt as Se,Zn as Ce,at as we,cr as Te,fr as f,jt as Ee,kt as p,lr as De,r as Oe,sr as ke,xt as Ae,zn as je,zt as Me}from"./index-B3xPCIyH.js";import{n as m,r as Ne,t as Pe}from"./resizable-COfX_iMb.js";import{t as Fe}from"./empty-state-Dluv5C1Q.js";import{t as Ie}from"./use-keyboard-shortcuts-BRF3cm7O.js";import{i as Le,n as Re,r as ze,t as Be}from"./suite-navbar-CnJmeIp-.js";var h=e(f(),1);function Ve(e,t){return l(e,t,`suiteMatch`)}var g=Ce(),He=`name: My Suite
|
|
2
|
-
target: ""
|
|
3
|
-
tests: []
|
|
4
|
-
`;function Ue(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function We(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Ge({text:e}){return(0,g.jsxs)(le,{children:[(0,g.jsx)(u,{asChild:!0,children:(0,g.jsx)(je,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,g.jsx)(Ee,{className:`max-w-[250px] text-[13px]`,children:e})]})}function _(){let e=Te()[`suite-id`]??``,l=ke(),[le]=De(),u=_e(),{defaultRunMode:Ce}=r(),{targets:f,globalUse:Ee,isLoading:je}=t(),_=!e,Ke=le.get(`live`)===`1`,v=(0,h.useRef)(null),qe=(0,h.useRef)(null),Je=(0,h.useRef)(()=>{}),Ye=(0,h.useRef)(!1),y=(0,h.useRef)(null),b=(0,h.useRef)(null),[x,S]=(0,h.useState)(_?He:``),[Xe,Ze]=(0,h.useState)(``),[C,Qe]=(0,h.useState)(``),[w,$e]=(0,h.useState)(!_),[et,tt]=(0,h.useState)(!1),[nt,rt]=(0,h.useState)(!1),[it,at]=(0,h.useState)(!1),[ot,st]=(0,h.useState)(!1),[T,ct]=(0,h.useState)(null),[lt,ut]=(0,h.useState)(!1),[dt,ft]=(0,h.useState)(!1),[E,pt]=(0,h.useState)([]),[D,O]=(0,h.useState)(null),[k,A]=(0,h.useState)(null),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)(!1),[F,I]=(0,h.useState)(null),[mt,L]=(0,h.useState)(`reasoning`),[ht,R]=(0,h.useState)(null),[z,B]=(0,h.useState)({setup:[],teardown:[]}),[V,gt]=(0,h.useState)(``),_t=!_&&x!==Xe,vt=_&&C?Ve(C.trim(),E):null,H=_&&!!C&&!!vt,{suggestions:yt}=s(null),bt=(0,h.useMemo)(()=>yt.filter(e=>e.namespace!==`capture`),[yt]),U=(0,h.useMemo)(()=>ze(x),[x]),xt=U?.suiteId??``,W=U?.name||(_?`New Suite`:V),G=o(D,{tests:(0,h.useMemo)(()=>U?U.tests.map(e=>({draftId:e.id,testId:e.id,path:e.test,name:e.test.split(`/`).pop()??e.test,steps:[],setup:[],teardown:[]})):[],[U]),setupHooks:z.setup,teardownHooks:z.teardown,allowReconnect:!1}),K=G.terminateSession;qe.current=D,Je.current=K;let St=U?.target?.trim()??``,q=N?`connecting`:G.connectionState,J=D!==null,Y=J&&U!==null&&(!Ue(U.setup??[],z.setup)||!Ue(U.teardown??[],z.teardown)),Ct=J&&q===`connected`&&U!==null&&U.tests.length>0,wt=N||J,Tt=N||J||ot||T!==null||_||U===null||!U?.target.trim()||je;ne((0,h.useMemo)(()=>J&&k!==null?`Live #${k} — ${U?.name?.trim()||W||`Suite`}`:_?`New Suite`:`Edit Suite`,[J,k,U?.name,W,_]));let X=(0,h.useMemo)(()=>{if(U)return{suiteName:U.name,suiteContext:U.context||void 0}},[U]),Et=(0,h.useMemo)(()=>F===`ended`?{reason:`ended`,title:`Live session ended`,description:`The current draft is unchanged. Close live mode or start a fresh disposable session from this target.`}:F===`disconnected`?{reason:`disconnected`,title:`Live session disconnected`,description:`The connection dropped and the disposable session was terminated. Start a fresh session to reconnect.`}:null,[F]);(0,h.useEffect)(()=>{if(_)return;let t=!1;return we(e).then(e=>{t||(S(e.content),Ze(e.content),gt(e.path),$e(!1))}).catch(()=>{t||(tt(!0),$e(!1))}),()=>{t=!0}},[e,_]),(0,h.useEffect)(()=>{let e=!1;return ue().then(t=>{if(e)return;let n=t.config?.workspace?.suiteMatch;Array.isArray(n)&&pt(n)}).catch(()=>{}),()=>{e=!0}},[]),(0,h.useEffect)(()=>{_&&S(e=>Le(e,[`suite-id`],ie()))},[_]),(0,h.useEffect)(()=>{if(_||w)return;let e=ze(x);e&&!e.suiteId&&S(e=>Le(e,[`suite-id`],ie()))},[_,w,Xe]);let Z=(0,h.useCallback)(async()=>{rt(!0);try{if(_){let e=Ve(C.trim(),E);if(e){p.error(e);return}await fe(C.trim(),x),p.success(`Suite file created`);let t=U?.suiteId??``;if(!t){p.error(`Created suite is missing suite-id; please reload`);return}l(d.suiteEdit(t))}else await xe(e,x),Ze(x),p.success(`Saved`)}catch(e){e instanceof be&&e.missingTests&&e.missingTests.length>0?p.error(`Cannot save — referenced tests not found: ${e.missingTests.map(e=>e.test).join(`, `)}`):p.error(`Failed to save: ${e instanceof Error?e.message:String(e)}`)}finally{rt(!1)}},[_,C,E,x,e,U?.suiteId,l]),Dt=(0,h.useCallback)(async()=>{at(!0);try{let e=await pe(x);e.valid?p.success(`Valid suite`):p.error(e.errors.map(e=>e.message).join(`
|
|
5
|
-
`))}catch(e){p.error(`Validation failed: ${e instanceof Error?e.message:String(e)}`)}finally{at(!1)}},[x]),Ot=(0,h.useCallback)(async e=>{if(!_){st(!0);try{ct((await Ae({file:V,local:e})).runId),p.success(`Suite run started`)}catch(e){p.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{st(!1)}}},[_,V]),kt=(0,h.useCallback)(()=>ct(null),[]),At=(0,h.useCallback)(()=>{i(`page`,`closing live mode`,{liveSessionId:D??void 0,terminalReason:F??void 0}),v.current?.abort(),v.current=null,D&&K(),P(!1),O(null),A(null),I(null),R(null),y.current=null,b.current=null,B({setup:[],teardown:[]}),M(!1)},[D,F,K]),jt=(0,h.useCallback)(()=>{i(`page`,`ending live session from UI`,{liveSessionId:D??void 0}),v.current?.abort(),v.current=null,D&&K(),P(!1),O(null),A(null),I(`ended`),R(null),y.current=null,b.current=null,B({setup:[],teardown:[]}),M(!1)},[D,K]),Q=(0,h.useCallback)(async(e,t)=>{let n=e.target.trim();if(!n){p.error(`Select a target before starting live mode`);return}let r=new AbortController;v.current?.abort(),v.current=r,M(!0),I(null),L(`reasoning`),R(null),y.current=null,b.current=null,P(!0);try{t?.replaceCurrentSession&&qe.current&&(K(),O(null),A(null));let a=te({content:x,targetName:n,targets:f,globalUse:Ee});i(`page`,`requesting live session`,{targetName:n,platform:a.platform,headless:a.headless??void 0,replacingSession:t?.replaceCurrentSession??!1});let o=[...e.setup??[]],s=[...e.teardown??[]],ee=e.suiteId?{type:`suite`,id:e.suiteId}:void 0,{sessionId:c,sessionNumber:l}=await me({...a,setupHooks:o,teardownHooks:s,entity:ee},r.signal);if(r.signal.aborted)return;B({setup:o,teardown:s}),O(c),A(l),i(`page`,`live session created`,{sessionId:c,targetName:n})}catch(e){We(e)||(i(`page`,`failed to create live session`,{error:e instanceof Error?e.message:String(e),targetName:n}),p.error(e instanceof Error?e.message:`Failed to start live session`)),t?.replaceCurrentSession||M(!1)}finally{v.current===r&&(v.current=null),P(!1)}},[x,Ee,f,K]),$=(0,h.useCallback)(async()=>{if(!Tt){if(!U){p.error(`Fix YAML errors before starting live mode`);return}await Q(U)}},[U,Q,Tt]),Mt=(0,h.useCallback)(async()=>{if(J){if(!U){p.error(`Fix YAML errors before restarting live mode`);return}await Q(U,{replaceCurrentSession:!0})}},[U,J,Q]),Nt=(0,h.useCallback)(e=>{if(e){M(!0);return}At()},[At]),Pt=(0,h.useCallback)((e,t)=>{if(!J){p.error(`Start a live session first.`);return}let n=(e===`setup`?G.setupHooks:G.teardownHooks).find(e=>e.id===t);n&&R({type:`suite-hook`,phase:e,hookId:n.id}),L(`reasoning`),G.executeHookById(e,t)},[J,G]),Ft=(0,h.useCallback)(e=>{R({type:`test`,testIndex:e}),L(`reasoning`),G.executeTestByIndex(e,X)},[X,G]);if((0,h.useEffect)(()=>()=>{v.current?.abort(),qe.current&&Je.current()},[]),(0,h.useEffect)(()=>{D&&q===`disconnected`&&(i(`page`,`live session moved to terminal state`,{liveSessionId:D,liveConnectionState:q}),O(null),A(null),P(!1),I(`disconnected`),R(null),y.current=null,b.current=null,B({setup:[],teardown:[]}),M(!0))},[q,D]),(0,h.useEffect)(()=>{if(!j||G.runningTestIndex===null)return;let e=`${G.tests[G.runningTestIndex]?.testExecutionId??`pending`}:${G.runningTestIndex}`;y.current!==e&&(y.current=e,R({type:`test`,testIndex:G.runningTestIndex}),L(`reasoning`))},[G.runningTestIndex,G.tests,j]),(0,h.useEffect)(()=>{if(!j||G.runningTestIndex!==null)return;let e=G.tests.map((e,t)=>({index:t,test:e})).filter(({test:e})=>e.status===`failed`).sort((e,t)=>(t.test.lastRunAt??``).localeCompare(e.test.lastRunAt??``))[0];if(!e)return;let t=e.test.testExecutionId??e.test.lastRunAt??`failed:${e.index}`;b.current!==t&&(b.current=t,R({type:`test`,testIndex:e.index}),L(`reasoning`))},[G.runningTestIndex,G.tests,j]),(0,h.useEffect)(()=>{!Ke||Ye.current||_||w||et||N||j||J||!U||!U.target.trim()||(Ye.current=!0,l(d.suiteEdit(e),{replace:!0}),$())},[U,$,J,_,N,w,j,l,et,e,Ke]),Ie((0,h.useMemo)(()=>({r:()=>{_||Ot(Ce===`local`)},escape:()=>{T&&kt()}}),[_,T,Ot,kt,Ce])),(0,h.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),Z())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Z]),w)return(0,g.jsx)(Oe,{});if(et)return(0,g.jsx)(Fe,{icon:de,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>l(d.suites)});let It=(0,g.jsxs)(ce,{defaultValue:`builder`,className:`flex-1 flex min-h-0 flex-col`,children:[(0,g.jsxs)(se,{variant:`line`,className:`px-4`,children:[(0,g.jsx)(ae,{value:`builder`,children:`Builder`}),(0,g.jsx)(ae,{value:`yaml`,children:`YAML`})]}),(0,g.jsx)(oe,{value:`builder`,className:`mt-2 flex-1 overflow-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground/50 [&::-webkit-scrollbar-track]:bg-transparent [scrollbar-width:thin]`,children:(0,g.jsx)(Re,{content:x,onChange:S,suggestions:bt,isCreateMode:_,liveMode:j,liveTests:G.tests,liveSetupHooks:G.setupHooks,liveTeardownHooks:G.teardownHooks,runningTestIndex:G.runningTestIndex,canRunTest:J&&G.connectionState===`connected`,canRunAll:Ct,isRunningAll:G.isRunningAllTests,isStoppingRunAll:G.isStoppingRunAllTests,onRunTest:Ft,onCancelTest:e=>{G.runningTestIndex===e&&G.cancelStep()},onRunAll:()=>void G.runAllTests(X),onStopAll:G.cancelRunAllTests,setupHooksStale:Y,onRestartSession:Y?()=>void Mt():void 0,selection:ht,onSelect:R,onRunLiveHook:Pt})}),(0,g.jsx)(oe,{value:`yaml`,className:`flex-1 min-h-0 mt-2`,children:(0,g.jsx)(n,{value:x,onChange:S,onSave:Z,className:`h-full`,filePath:V||void 0})})]}),Lt=(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[_&&(0,g.jsx)(`div`,{className:`px-4 pt-3`,children:(0,g.jsxs)(`div`,{className:`rounded-md border bg-muted/15 px-3 py-2`,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,g.jsxs)(re,{className:`flex items-center gap-1 text-xs font-medium`,children:[`File Path `,(0,g.jsx)(Ge,{text:`Path is relative to your workspace root. Must match your workspace's suiteMatch pattern. Directories are created automatically on save.`})]}),(0,g.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Created only when you save`})]}),(0,g.jsx)(Se,{placeholder:`my-suite.suite.yaml`,value:C,onChange:e=>Qe(e.target.value),className:`mt-2 max-w-md h-8 text-sm font-mono ${H?`border-red-500 focus-visible:ring-red-500`:``}`}),H&&(0,g.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:vt})]})}),It]}),Rt=(0,g.jsx)(ee,{connectionState:G.connectionState,isLaunching:N,targetName:St||`Selected Target`,targetLabel:G.currentUrl||`Configured start URL`,liveSessionNumber:k,platform:G.platform,screenshot:G.screenshot,currentUrl:G.currentUrl,pendingNavigation:G.pendingNavigation,steps:G.steps,setupHooks:G.setupHooks,teardownHooks:G.teardownHooks,tests:G.tests,selection:ht,runningStepId:G.runningStepId,terminalState:Et,draftState:U===null?`invalid`:_t||_?`unsaved`:`saved`,ariaTree:G.ariaTree,errorMessage:G.error,devtoolsTab:mt,canRunAll:Ct,isRunningAll:G.isRunningAllTests,isStoppingRunAll:G.isStoppingRunAllTests,setupHooksStale:Y,executionUnit:`test`,runAllLabel:`Run All Tests`,stopAllLabel:`Stop Run All`,unitRowsSlot:null,onDevtoolsTabChange:L,onRunAll:()=>void G.runAllTests(X),onStopAll:G.cancelRunAllTests,onEndSession:jt,onRestartSession:Y?()=>void Mt():void 0,showEndSessionAction:u,onCloseLiveMode:At,onStartFreshSession:()=>void $(),onBack:G.goBack,onForward:G.goForward,onRefresh:G.refreshPage,onNavigate:G.navigate,onRequestAriaTree:G.requestAriaTree});return(0,g.jsxs)(`div`,{className:`flex h-screen flex-col`,children:[(0,g.jsx)(Be,{suiteName:W,suiteId:xt,unsaved:_t,isCreateMode:_,mode:`edit`,suiteHref:_?void 0:d.suiteView(e),isSaving:nt,isValidating:it,isRunning:ot,runDisabled:wt,hasInvalidFilename:H,shortcutsOpen:dt,hasLiveSession:J,liveConnectionState:q,isLiveActionDisabled:Tt,liveSessionNumber:k,onBack:()=>l(d.suites),onSave:Z,onValidate:Dt,onRun:Ot,onLiveConnect:j?void 0:$,onLiveEnd:J?jt:void 0,onSettingsOpen:()=>ut(!0),onToggleShortcuts:()=>ft(e=>!e)}),T?(0,g.jsxs)(Ne,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,g.jsx)(m,{defaultSize:60,minSize:30,children:(0,g.jsx)(n,{value:x,onChange:S,onSave:Z,className:`h-full`})}),(0,g.jsx)(Pe,{withHandle:!0}),(0,g.jsx)(m,{defaultSize:40,minSize:25,children:(0,g.jsx)(c,{runId:T,onClose:kt})})]}):j&&!u?(0,g.jsxs)(Ne,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,g.jsx)(m,{defaultSize:45,minSize:30,children:Lt}),(0,g.jsx)(Pe,{withHandle:!0}),(0,g.jsx)(m,{defaultSize:55,minSize:40,children:Rt})]}):Lt,(0,g.jsx)(he,{open:lt,onOpenChange:ut,children:(0,g.jsxs)(ge,{side:`right`,className:`sm:max-w-[400px] overflow-y-auto p-0`,children:[(0,g.jsxs)(ye,{className:`px-4 pt-4 pb-2`,children:[(0,g.jsx)(Me,{children:`Suite Settings`}),(0,g.jsx)(ve,{children:`Advanced configuration for this suite`})]}),(0,g.jsx)(`div`,{className:`px-4 pb-4`,children:(0,g.jsx)(a,{content:x,onChange:S,selectedTarget:U?.target,showMeta:!1})})]})}),u&&(0,g.jsx)(he,{open:j,onOpenChange:Nt,children:(0,g.jsxs)(ge,{side:`bottom`,showCloseButton:!1,className:`h-[100dvh] max-h-[100dvh] rounded-none p-0`,children:[(0,g.jsxs)(ye,{className:`sr-only`,children:[(0,g.jsx)(Me,{children:`Live Session`}),(0,g.jsx)(ve,{children:`Live execution workspace for the current suite draft.`})]}),Rt]})})]})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{i as t,n,o as r,s as i,t as a}from"./select-B5gV6YUf.js";import{t as o}from"./circle-alert-pBH5T6su.js";import{C as s,S as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as ee,y as te}from"./id-badge-Dzm7eQ9l.js";import{n as ne,r as O}from"./monaco-editor-CDJrOpKK.js";import{t as re}from"./circle-x-DLBotPS8.js";import{c as ie,t as k}from"./split-button-C7J0EKrF.js";import{t as ae}from"./grip-vertical-aDoBVncr.js";import{n as A,r as j,t as M}from"./shortcut-hints-CfVf0REF.js";import{t as oe}from"./plus-C6Zz9JLt.js";import{t as N}from"./refresh-cw-v_0wwa0P.js";import{n as P,t as F}from"./textarea-ByegDm2e.js";import{t as se}from"./square-CvSqzenY.js";import{a as I,n as L}from"./dist-DFSjTjXY.js";import{n as ce,r as R,t as z}from"./popover-CvQRjfg5.js";import{At as B,Hn as V,Ht as H,Ln as U,Mn as le,Nn as W,Nt as G,Pn as ue,Rn as de,Un as fe,Ut as K,Vt as pe,Zn as q,c as J,d as me,fr as he,jt as Y,l as ge,o as _e,or as X,s as ve,u as ye,ut as be,zn as xe}from"./index-B3xPCIyH.js";import{t as Se}from"./badge-BbhOGRC0.js";import{t as Ce}from"./display-step-CV3zilMS.js";var Z=e(he(),1),Q=q();function we({text:e}){return(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsx)(xe,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,Q.jsx)(Y,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Te({name:e,suiteId:o,target:c,context:l,isCreateMode:d,suggestions:p,hookLabels:m={},onChange:h,disabled:g=!1}){let{targets:v,isLoading:y}=_(),{targets:x}=f(),S=c?x[c]:void 0,w=(0,Z.useRef)(null),[T,E]=(0,Z.useState)(0),D=u({text:l,cursorPos:T,suggestions:p,anchorRef:w,onInsert:(e,t,n)=>{h(`context`,l.slice(0,t)+e+l.slice(n)),requestAnimationFrame(()=>w.current?.focus())}}),ee=!y&&v.length>0;return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-name`,className:`text-xs flex items-center gap-1`,children:[`Suite Name `,(0,Q.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,Q.jsx)(pe,{id:`suite-name`,value:e,onChange:e=>h(`name`,e.target.value),placeholder:`My Suite`,required:!0,disabled:g,className:`h-8 text-sm`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-id`,className:`text-xs flex items-center gap-1`,children:[`Suite ID `,(0,Q.jsx)(we,{text:`Unique identifier used for memory and analytics. Changing this breaks the association with past runs and observations.`})]}),d?(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(pe,{id:`suite-id`,value:o,readOnly:!0,disabled:!0,className:`h-8 text-sm font-mono pr-9`}),(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>h(`suite-id`,L()),"aria-label":`Generate new ID`,disabled:g,className:`absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6`,children:(0,Q.jsx)(N,{className:`size-3.5`})})]}):(0,Q.jsx)(`p`,{className:`text-[13px] font-mono text-muted-foreground`,children:o||`No ID assigned`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-target`,className:`text-xs flex items-center gap-1`,children:[`Target `,(0,Q.jsx)(`span`,{className:`text-destructive`,children:`*`}),` `,(0,Q.jsx)(we,{text:`A registered app target from your workspace config. Defines where the suite runs (web URL or mobile app).`})]}),ee?(0,Q.jsxs)(a,{value:c||void 0,onValueChange:e=>h(`target`,e),disabled:g,children:[(0,Q.jsx)(r,{id:`suite-target`,className:`w-full h-8 text-sm`,children:(0,Q.jsx)(i,{placeholder:`Select a target`})}),(0,Q.jsx)(n,{children:v.map(e=>(0,Q.jsx)(t,{value:e,children:e},e))})]}):y?null:(0,Q.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No targets configured.`,` `,(0,Q.jsx)(X,{to:`/config`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Add targets in Settings.`})]}),S&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted-foreground mt-1.5`,children:[S.platform===`web`?(0,Q.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0`}):(0,Q.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`text-muted-foreground/70 uppercase text-[11px] tracking-wider shrink-0`,children:S.platform}),(0,Q.jsxs)(`span`,{className:`font-mono truncate`,children:[S.product&&(0,Q.jsx)(`span`,{className:`mr-1.5`,children:S.product}),S.platform===`web`&&S.url,S.platform===`android`&&`${S.appPackage}${S.appActivity?` / ${S.appActivity}`:``}`,S.platform===`ios`&&S.bundleId]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(I,{htmlFor:`suite-context`,className:`text-xs flex items-center gap-1`,children:[`Context `,(0,Q.jsx)(we,{text:`Additional instructions passed to every test in this suite before its own context. Use this for suite-wide setup notes or shared preconditions.`})]}),(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(F,{ref:w,id:`suite-context`,value:l,onChange:e=>{h(`context`,e.target.value),E(e.target.selectionStart??0)},onKeyDown:e=>{D.handleKeyDown(e)},onBlur:()=>setTimeout(()=>D.setVisible(!1),150),placeholder:`Additional instructions applied to every test in this suite...`,disabled:g,className:`min-h-[60px] resize-none text-sm`,rows:2}),D.dropdown]}),C(l)&&(0,Q.jsx)(b,{text:l,hookLabels:m})]})]})}function Ee(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function De({status:e}){switch(e){case`running`:return(0,Q.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,Q.jsx)(V,{className:`size-3 text-emerald-500`});case`failed`:return(0,Q.jsx)(ue,{className:`size-3 text-destructive`});default:return(0,Q.jsx)(W,{className:`size-3 text-muted-foreground`})}}function Oe({status:e}){switch(e){case`running`:case`cancelling`:return(0,Q.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,Q.jsx)(V,{className:`size-3 text-emerald-500`});case`failed`:return(0,Q.jsx)(re,{className:`size-3 text-red-500`});case`cancelled`:return(0,Q.jsx)(se,{className:`size-3 text-amber-500`});default:return(0,Q.jsx)(D,{className:`size-3 text-muted-foreground/50`})}}function ke(e){return e.observation?e.observation:e.reasoning?e.reasoning:e.plannedAction==null?e.verifierReasoning?e.verifierReasoning:e.result:`Planned action captured`}function Ae({id:e,name:t,path:n,testId:r,isMissing:i,onRemove:a,disabled:o=!1,actionsLocked:s=!1,sortableDisabled:l=!1,liveMode:u=!1,liveStatus:d=`idle`,liveDuration:f,liveError:p=null,liveSteps:m=[],runningStepIndex:h=null,perTestSetupHooks:g=[],perTestTeardownHooks:_=[],canRunTest:y=!0,onRunTest:b,onCancelTest:x,testIndex:S,selection:C=null,onSelect:w}){let{attributes:T,listeners:E,setNodeRef:ee,transform:te,transition:ne,isDragging:O}=v({id:e,disabled:o||l}),ie={transform:c.Transform.toString(te),transition:ne,opacity:O?.55:1,zIndex:O?10:void 0},k=u&&d===`running`,A=u&&d===`passed`,j=u&&d===`failed`,M=u&&(A||j||u&&d===`cancelled`)&&f!=null,oe=u&&C?.type===`test`&&S!==void 0&&C.testIndex===S,N=u&&g.length+_.length>0,P=u?m.map(e=>({step:e,displayStep:Ce(e,e.stepIndex)})):[],F=C&&`stepId`in C?C.stepId:null,I=C?.type===`subaction`?C.subIndex:null;return(0,Q.jsxs)(`div`,{ref:ee,style:ie,className:K(`relative overflow-hidden flex flex-col gap-0.5 rounded-md border bg-card/60 px-3 py-2 hover:bg-card transition-colors`,i&&`border-amber-500/30`,i&&`bg-amber-500/[0.06]`,!i&&`border-border/70`,O&&`shadow-lg ring-2 ring-primary/20`,o&&`opacity-60`,k&&`live-running-surface border-border/60 bg-primary/5`,j&&!k&&`border-destructive/30`,j&&!k&&!oe&&`ring-1 ring-destructive/20`,oe&&!k&&`bg-primary/10 ring-1 ring-primary/30`),children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`mt-0.5 flex shrink-0 items-center p-0.5 text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing touch-none disabled:cursor-not-allowed`,...T,...E,"aria-label":`Reorder ${t}`,"aria-disabled":o||l,disabled:o||l,children:(0,Q.jsx)(ae,{className:`size-3.5`})}),k&&(0,Q.jsx)(D,{className:`size-4 shrink-0 mt-0.5 text-primary`}),A&&(0,Q.jsx)(V,{className:`size-3.5 text-emerald-500 shrink-0 mt-1`}),j&&(0,Q.jsx)(re,{className:`size-3.5 text-red-500 shrink-0 mt-1`}),(0,Q.jsxs)(`div`,{className:K(`flex-1 min-w-0 space-y-0.5`,u&&w&&`cursor-pointer`),onClick:u&&w&&S!==void 0?()=>w({type:`test`,testIndex:S}):void 0,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-foreground truncate`,children:t}),(0,Q.jsx)(`div`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:n}),(0,Q.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:r}),P.length>0&&(0,Q.jsx)(`div`,{className:`mt-1.5 space-y-1.5`,children:P.map(({step:e,displayStep:t},n)=>{let r=e.status===`running`||h===e.stepIndex,i=oe&&F===null&&(r||h===null&&n===P.length-1),a=F===e.id||i,o=t.subActionsData??[];return(0,Q.jsxs)(`div`,{className:K(`relative overflow-hidden rounded-sm border bg-background/60`,r?`live-running-surface border-border/60 bg-primary/5`:a?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60`),children:[(0,Q.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left`,onClick:t=>{t.stopPropagation(),w?.({type:`step`,stepId:e.id})},"aria-label":`Select step ${e.stepIndex+1} ${e.instruction}`,children:[(0,Q.jsx)(Oe,{status:e.status}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[`Step `,e.stepIndex+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:e.instruction})]}),(r||a)&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5 px-2 pb-1 text-[11px] text-muted-foreground`,children:[r&&(0,Q.jsx)(`span`,{children:`Current step`}),a&&(0,Q.jsx)(`span`,{children:`Inspecting below`})]}),o.length>0&&(0,Q.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-2 py-1.5`,children:o.map(t=>(0,Q.jsxs)(`button`,{type:`button`,className:K(`flex w-full min-w-0 items-center gap-2 rounded-sm px-1.5 py-1 text-left text-[11px] transition-colors`,a&&I===t.index?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-muted/40`),onClick:n=>{n.stopPropagation(),w?.({type:`subaction`,stepId:e.id,subIndex:t.index})},"aria-label":`Select sub-action ${t.index+1} for step ${e.stepIndex+1}`,children:[(0,Q.jsxs)(`span`,{className:`shrink-0 font-medium`,children:[`Sub `,t.index+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ke(t)})]},`${e.id}-sub-${t.index}`))})]},e.id)})}),i&&(0,Q.jsx)(`div`,{className:`text-[11px] text-amber-700 dark:text-amber-300`,children:`This test file no longer exists in your workspace.`})]}),(0,Q.jsxs)(`div`,{className:`mt-0.5 flex shrink-0 self-start items-center gap-1`,children:[M&&(0,Q.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground whitespace-nowrap shrink-0`,children:Ee(f)}),u&&!k&&(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:b,disabled:!y||!b||s,className:K(`text-muted-foreground hover:text-foreground`,(!y||!b||s)&&`text-muted-foreground/30`),"aria-label":d===`idle`?`Run test ${t}`:`Re-run test ${t}`,children:(0,Q.jsx)(U,{className:`size-3.5`})}),u&&k&&x&&(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:x,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Cancel test ${t}`,children:(0,Q.jsx)(se,{className:`size-3`})}),(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-destructive`,onClick:a,disabled:o||s,"aria-label":`Remove ${t}`,children:(0,Q.jsx)(le,{className:`size-3.5`})})]})]}),j&&p&&(0,Q.jsxs)(`p`,{className:`text-destructive text-xs mt-1 ml-7 line-clamp-2`,children:[p,` — see Reasoning tab for details`]}),N&&(0,Q.jsxs)(`ul`,{className:`mt-1.5 space-y-1 pl-5`,children:[g.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`setup`,hookId:e.id}),className:K(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,Q.jsx)(W,{className:`size-3 text-muted-foreground shrink-0`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`setup: `,e.name]}),(0,Q.jsx)(De,{status:e.status})]})},`setup-${e.id}`)}),_.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`teardown`,hookId:e.id}),className:K(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,Q.jsx)(W,{className:`size-3 text-muted-foreground shrink-0`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`teardown: `,e.name]}),(0,Q.jsx)(De,{status:e.status})]})},`teardown-${e.id}`)})]})]})}function je({availableTests:e,onAdd:t,disabled:n=!1}){return e.length===0?(0,Q.jsxs)(`div`,{className:`rounded-md border bg-card/20 p-3 text-sm text-muted-foreground`,children:[`No test files found.`,` `,(0,Q.jsx)(X,{to:`/tests/new`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Create a test first.`})]}):(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(_e,{className:`rounded-md border`,children:[(0,Q.jsx)(ge,{placeholder:`Search by test name, path, or ID...`,disabled:n}),(0,Q.jsxs)(me,{className:`max-h-64`,children:[(0,Q.jsx)(ve,{children:`No tests match your query.`}),(0,Q.jsx)(J,{children:e.map(e=>(0,Q.jsx)(ye,{value:`${e.name} ${e.path} ${e.testId??``}`,onSelect:()=>t({test:e.path,id:e.testId??``}),disabled:n,className:`px-2 py-1.5`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5 w-full min-w-0`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:e.path}),(0,Q.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:e.testId??``})]})},e.path))})]})]}),(0,Q.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60`,children:`Type to filter by name, path, or test ID. Click to add. Same test can be added multiple times.`})]})}var Me=[`name`,`suite-id`,`target`,`use`,`context`,`setup`,`tests`,`teardown`];function Ne(e){function t(e,n){if(S(e)){n?e.items.sort((e,t)=>{let n=Me.indexOf(String(e.key)),r=Me.indexOf(String(t.key));return(n===-1?Me.length:n)-(r===-1?Me.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 Pe(e){return Ne(e),e.toString()}function Fe(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Ie(e){return Array.isArray(e)?e.map(e=>{if(e&&typeof e==`object`&&`test`in e&&`id`in e){let t=e;if(typeof t.test==`string`&&typeof t.id==`string`)return{test:t.test,id:t.id}}return null}).filter(e=>e!==null):[]}function Le(e){try{let t=y(e);if(t.errors.length>0)return null;let n=t.toJSON();return!n||typeof n!=`object`?null:{name:n.name??``,suiteId:n[`suite-id`]??``,target:n.target??``,context:n.context??``,setup:Fe(n.setup),teardown:Fe(n.teardown),tests:Ie(n.tests)}}catch{return null}}function Re(e,t,n){try{let r=y(e);return n===void 0||Array.isArray(n)&&n.length===0||n===``?r.deleteIn(t):r.setIn(t,n),Pe(r)}catch{return e}}function ze(e,t,n){try{if(t===n||t<0||n<0)return e;let r=y(e),i=Ie(r.toJSON()?.tests);if(t>=i.length||n>=i.length)return e;let a=[...i],[o]=a.splice(t,1);return a.splice(n,0,o),r.setIn([`tests`],a),Pe(r)}catch{return e}}function Be(e,t){try{let n=y(e),r=Ie(n.toJSON()?.tests);return n.setIn([`tests`],[...r,t]),Pe(n)}catch{return e}}function Ve(e,t){try{let n=y(e),r=Ie(n.toJSON()?.tests);if(t<0||t>=r.length)return e;let i=r.filter((e,n)=>n!==t);return i.length===0?n.deleteIn([`tests`]):n.setIn([`tests`],i),Pe(n)}catch{return e}}function He({text:e}){return(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsx)(xe,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,Q.jsx)(Y,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Ue({status:e}){switch(e){case`running`:return(0,Q.jsx)(D,{className:`size-3.5 text-primary`});case`passed`:return(0,Q.jsx)(V,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,Q.jsx)(ue,{className:`size-3.5 text-destructive`});default:return(0,Q.jsx)(W,{className:`size-3.5 text-muted-foreground`})}}function We(e){return e===`running`||e===`cancelling`}function Ge(e){return e===`running`||e===`cancelling`}function Ke(e){return e===`running`}function $(e){return e.some(e=>Ke(e.status))}function qe(e){return We(e.status)||e.runningStepIndex!==null||e.liveSteps.some(e=>Ge(e.status))||$(e.perTestSetupHooks)||$(e.perTestTeardownHooks)}function Je({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted-foreground`,children:e}),(0,Q.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>{let t=n?.type===`suite-hook`&&n.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>r?.({type:`suite-hook`,phase:e.phase,hookId:e.id}),className:K(`relative flex w-full items-center gap-2 overflow-hidden rounded-md border px-3 py-1.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60 bg-card/40 hover:bg-card/60`),children:[(0,Q.jsx)(Ue,{status:e.status}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm`,children:e.name}),(0,Q.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id})]})]})},e.id)})})]})}function Ye({content:e,onChange:t,disabled:n=!1,suggestions:r,isCreateMode:i=!1,liveMode:a=!1,liveTests:s=[],liveSetupHooks:c=[],liveTeardownHooks:u=[],runningTestIndex:f=null,canRunTest:_=!0,canRunAll:v=!1,isRunningAll:y=!1,isStoppingRunAll:b=!1,onRunTest:S,onCancelTest:C,onRunAll:w,onStopAll:D,onRunLiveHook:ne,setupHooksStale:re=!1,onRestartSession:ie,selection:k=null,onSelect:ae}){let A=(0,Z.useRef)(null),{hooks:j,warningCopy:M}=T(),N=j??[],P=(0,Z.useMemo)(()=>Object.fromEntries(N.map(e=>[e.id,e.name])),[N]),[F,I]=(0,Z.useState)([]),[L,ce]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{be().then(e=>I(e.files)).catch(()=>{})},[]),(0,Z.useEffect)(()=>{if(!L)return;function e(e){e.key===`Escape`&&ce(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[L]);let R=Le(e),z=R===null,B=R??A.current;R&&(A.current=R);let V=ee(d(E,{activationConstraint:{distance:8}}),d(l,{coordinateGetter:x})),U=(0,Z.useCallback)((n,r)=>{t(Re(e,[n],r))},[e,t]),le=(0,Z.useCallback)(n=>{t(Be(e,n))},[e,t]),G=(0,Z.useCallback)(n=>{t(Ve(e,n))},[e,t]),fe=B?.tests.map((e,t)=>`test-${t}`)??[],K=a&&(y||b),pe=a&&(f!==null||s.some(e=>qe(e))||$(c)||$(u)),q=K||pe,J=K,me=n||z||q,he=(0,Z.useCallback)(r=>{if(n||z||q)return;let{active:i,over:a}=r;if(!a||i.id===a.id)return;let o=parseInt(String(i.id).replace(`test-`,``),10),s=parseInt(String(a.id).replace(`test-`,``),10);if(Number.isNaN(o)||Number.isNaN(s))return;let c=ze(e,o,s);c!==e&&t(c)},[e,n,t,q,z]);return(0,Q.jsx)(`div`,{className:`flex flex-col`,children:(0,Q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[z&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:[(0,Q.jsx)(o,{className:`size-4 shrink-0`}),(0,Q.jsx)(`span`,{children:`YAML has errors — builder shows last valid state`})]}),a&&re&&(0,Q.jsxs)(`div`,{className:`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)(ue,{className:`mt-0.5 size-4 shrink-0`}),(0,Q.jsx)(`span`,{children:`Setup hooks changed — restart session to re-apply the latest setup and teardown hooks.`})]}),ie&&(0,Q.jsx)(H,{type:`button`,size:`sm`,className:`shrink-0`,onClick:ie,children:`Restart Live Session`})]}),B?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Te,{name:B.name,suiteId:B.suiteId,target:B.target,context:B.context,isCreateMode:i,suggestions:r,hookLabels:P,onChange:U,disabled:n||z}),a&&(0,Q.jsx)(Je,{title:`Setup Hooks (Live)`,hooks:c,selection:k,onSelect:ae}),(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-card/20 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(W,{className:`size-4 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Hooks`})]}),(0,Q.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[B.setup.length+B.teardown.length,` `,B.setup.length+B.teardown.length===1?`hook`:`hooks`]})]}),M&&(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,Q.jsx)(o,{className:`mt-0.5 size-3.5 shrink-0`}),(0,Q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Q.jsx)(`p`,{className:`font-medium`,children:M.title}),(0,Q.jsx)(`p`,{children:M.body})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Search hook names or paste an h_ ID. Saved as stable ID in YAML. Inline runHook uses the stable hook ID.`}),(0,Q.jsx)(p,{phase:`setup`,label:`Setup`,values:B.setup,suggestions:N,disabled:me,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>U(`setup`,e)}),(0,Q.jsx)(p,{phase:`teardown`,label:`Teardown`,values:B.teardown,suggestions:N,disabled:me,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>U(`teardown`,e)})]})]}),a&&(0,Q.jsx)(Je,{title:`Teardown Hooks (Live)`,hooks:u,selection:k,onSelect:ae}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1`,children:[`Tests in Suite`,` `,(0,Q.jsx)(He,{text:`Tests run in the order shown. Drag to reorder. The suite fails fast if any referenced test is missing at save.`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[B.tests.length,` `,B.tests.length===1?`test`:`tests`]}),a&&(0,Q.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:y?D:w,disabled:b||!y&&!v,children:b?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(de,{className:`size-3.5 animate-spin`}),`Stopping...`]}):y?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(se,{className:`size-3.5`}),`Stop Run All`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(O,{className:`size-3.5`}),`Run All Tests`]})})]})]}),B.tests.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tests added yet. Use the picker below.`}):(0,Q.jsx)(h,{sensors:V,collisionDetection:te,onDragEnd:he,children:(0,Q.jsx)(m,{items:fe,strategy:g,children:(0,Q.jsx)(`div`,{className:`space-y-1.5`,children:B.tests.map((e,t)=>{let r=F.find(t=>t.path===e.test),i=r?.name??e.test.split(`/`).pop()??e.test,o=F.length>0&&!r,c=a?s[t]:void 0,l=a?_&&f===null&&!J:!0;return(0,Q.jsx)(Ae,{id:`test-${t}`,name:i,path:e.test,testId:e.id,isMissing:o,onRemove:()=>G(t),disabled:n||z,actionsLocked:J,sortableDisabled:q,liveMode:a,liveStatus:c?.status,liveDuration:c?.duration,liveError:c?.error??null,liveSteps:c?.liveSteps??[],runningStepIndex:c?.runningStepIndex??null,perTestSetupHooks:c?.perTestSetupHooks??[],perTestTeardownHooks:c?.perTestTeardownHooks??[],canRunTest:l,onRunTest:a&&S?()=>S(t):void 0,onCancelTest:a&&C?()=>C(t):void 0,testIndex:t,selection:k,onSelect:ae},`test-${t}`)})})})})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Available Tests`}),(0,Q.jsxs)(H,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>ce(e=>!e),disabled:n||z||J,"aria-expanded":L,"aria-controls":`suite-test-picker-region`,children:[(0,Q.jsx)(oe,{className:`size-3`}),L?`Hide picker`:`Add new test`]})]}),L&&(0,Q.jsx)(`div`,{id:`suite-test-picker-region`,children:(0,Q.jsx)(je,{availableTests:F,onAdd:le,disabled:n||z||J})})]})]}):(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Enter valid YAML to use the visual builder`})]})})}function Xe({suiteName:e,suiteId:t,unsaved:n,isCreateMode:r,mode:i=`view`,suiteHref:a,isSaving:o,isValidating:s,isRunning:c,runDisabled:l=!1,hasInvalidFilename:u,shortcutsOpen:d,showSuiteId:f=!0,hasLiveSession:p=!1,liveConnectionState:m=`idle`,isLiveActionDisabled:h=!1,liveSessionNumber:g=null,onSave:_,onValidate:v,onRun:y,onLiveConnect:b,onLiveEnd:x,onSettingsOpen:S,onToggleShortcuts:C}){let T=i===`view`&&!r,E=!!b||!!x||p||m===`connecting`,D=!r||E,ee=!r&&!T&&i===`edit`,te=`Start a disposable live session for this suite. Setup hooks run on connect, included tests run serially on a shared browser context, teardown hooks run when the session ends, and changes are not saved automatically.`;return(0,Q.jsxs)(`div`,{"data-testid":`suite-navbar-root`,className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(X,{to:`/suites`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Suites`}),(0,Q.jsx)(fe,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),r?(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`New Suite`}):a&&!T?(0,Q.jsx)(X,{to:a,className:`truncate text-sm font-medium hover:text-primary transition-colors`,children:e}):(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e}),ee&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(fe,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`Edit`})]}),n&&(0,Q.jsx)(Se,{variant:`outline`,className:`text-xs`,children:`Unsaved`}),!T&&!r&&t&&f&&(0,Q.jsx)(w,{label:`S`,value:t})]}),(0,Q.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:T?(0,Q.jsxs)(Q.Fragment,{children:[a?(0,Q.jsx)(H,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Q.jsxs)(X,{to:a,children:[`Edit`,(0,Q.jsx)(M,{shortcut:`E`})]})}):(0,Q.jsxs)(H,{variant:`outline`,size:`sm`,disabled:!0,children:[`Edit`,(0,Q.jsx)(M,{shortcut:`E`})]}),(0,Q.jsx)(k,{onRun:y,disabled:c||l,label:c?`Running...`:`Run`,shortcutKey:`R`,size:`sm`}),E&&(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsxs)(H,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,Q.jsx)(de,{className:`h-3.5 w-3.5 animate-spin`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`,(0,Q.jsx)(M,{shortcut:`L`,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`})]})}),(0,Q.jsx)(Y,{className:`max-w-sm text-[13px]`,children:te})]}),!r&&(0,Q.jsxs)(z,{open:d,onOpenChange:e=>{e||C()},children:[(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsx)(R,{asChild:!0,children:(0,Q.jsx)(H,{variant:`ghost`,size:`icon-sm`,onClick:C,"aria-label":`Shortcuts`,children:(0,Q.jsx)(j,{className:`h-3.5 w-3.5`})})})}),(0,Q.jsx)(Y,{children:`Shortcuts`})]}),(0,Q.jsx)(ce,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(A,{hints:[{key:`E`,label:`Edit`},{key:`R`,label:`Run`},{key:`L`,label:`Connect Live Session`}]})]})})})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(H,{variant:`ghost`,size:`sm`,onClick:v,disabled:s||u,children:[(0,Q.jsx)(V,{className:`h-3.5 w-3.5`}),s?`Validating...`:`Validate`]}),(0,Q.jsxs)(H,{variant:`ghost`,size:`sm`,onClick:_,disabled:o||u,children:[(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),o?`Saving...`:`Save`]}),(0,Q.jsxs)(H,{variant:`ghost`,size:`sm`,onClick:S,children:[(0,Q.jsx)(P,{className:`h-3.5 w-3.5`}),`Settings`]}),D&&(0,Q.jsx)(`div`,{className:`h-4 w-px bg-border`}),!r&&(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(k,{onRun:y,disabled:c||l||p,label:c?`Running...`:`Run Suite`,size:`sm`})})}),p&&(0,Q.jsx)(Y,{children:`End the live session to queue a new suite run.`})]}),E&&(p&&m!==`connecting`?(0,Q.jsxs)(H,{variant:`destructive`,size:`sm`,onClick:x,disabled:!x,children:[(0,Q.jsx)(se,{className:`h-3.5 w-3.5`}),`End Live Session`]}):(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsxs)(H,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,Q.jsx)(de,{className:`h-3.5 w-3.5 animate-spin`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`]})}),(0,Q.jsx)(Y,{className:`max-w-sm text-[13px]`,children:te})]})),!T&&p&&typeof g==`number`&&(m===`connected`||m===`executing`)&&(0,Q.jsxs)(Se,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,g]}),!r&&(0,Q.jsxs)(z,{open:d,onOpenChange:e=>{e||C()},children:[(0,Q.jsxs)(B,{children:[(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsx)(R,{asChild:!0,children:(0,Q.jsx)(H,{variant:`ghost`,size:`icon-sm`,onClick:C,children:(0,Q.jsx)(j,{className:`h-3.5 w-3.5`})})})}),(0,Q.jsx)(Y,{children:`Shortcuts`})]}),(0,Q.jsx)(ce,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(A,{hints:[{key:`R`,label:`Run suite`},{key:`Cmd+S`,label:`Save`},{key:`Esc`,label:`Close results panel`}]})]})})})]})]})})]})}export{Re as i,Ye as n,Le as r,Xe as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-CDJrOpKK.js";import{t as n}from"./file-code-GHpcb0ud.js";import{n as r}from"./split-button-C7J0EKrF.js";import{t as i}from"./zap-C7OZlYXQ.js";import{t as a}from"./use-page-title-CK82kWb2.js";import{a as o,n as s,o as ee,t as c}from"./insights-line-grid-G3ouKANt.js";import{i as l,n as u,r as d,t as f}from"./tabs-CfNQIHt-.js";import{At as p,Gt as m,Ht as h,Kt as g,Mt as te,Nt as ne,Qn as _,Wt as v,Zn as y,at as re,cr as ie,fr as b,it as ae,jt as x,kt as S,lr as oe,or as C,qt as w,r as se,sr as ce,xt as le}from"./index-B3xPCIyH.js";import{t as T}from"./badge-BbhOGRC0.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./table-DL0PmHAE.js";import{t as ue}from"./empty-state-Dluv5C1Q.js";import{t as de}from"./use-keyboard-shortcuts-BRF3cm7O.js";import{n as fe,t as pe}from"./suite-navbar-CnJmeIp-.js";import{n as M,r as me,t as he}from"./viewer-url-state-CZTYs75z.js";var N=e(b(),1),P=y(),ge=[`builder`,`yaml`,`memory`];function _e(e){let t=e.trim();return t.length>=2&&(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))?t.slice(1,-1).trim():t}function F(e){return{suiteId:e,total:0,flakyScore:0,isFlaky:!1,runs:[],trends:{daily:[],passRate:0,totalRuns:0,avgDuration:0}}}function I(e){if(!e)return``;let t=new Date(w(e)),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:v(e)}function L({status:e}){switch(e){case`passed`:return(0,P.jsx)(T,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,P.jsx)(T,{variant:`destructive`,children:`Failed`});case`healed`:return(0,P.jsx)(T,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,P.jsx)(T,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,P.jsx)(T,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,P.jsx)(T,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,P.jsx)(T,{variant:`outline`,children:e})}}function R({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,P.jsx)(h,{type:`button`,size:`xs`,variant:t===e?`default`:`ghost`,"aria-pressed":t===e,className:`h-7 rounded-[2px] px-2 text-xs`,onClick:()=>i(e),children:e===`scoped`?`Scoped`:`All runs`},e))}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}function z({runs:e,compactDate:t=!1}){return e.length===0?(0,P.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,P.jsxs)(j,{children:[(0,P.jsx)(E,{children:(0,P.jsxs)(k,{children:[(0,P.jsx)(D,{children:`Status`}),(0,P.jsx)(D,{children:`Duration`}),(0,P.jsx)(D,{children:`Date`})]})}),(0,P.jsx)(O,{children:e.map(e=>(0,P.jsxs)(k,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(C,{to:_.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,P.jsx)(L,{status:e.status})]}),(0,P.jsx)(A,{children:e.status===`running`?(0,P.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:g(e.duration)})}),(0,P.jsx)(A,{children:t?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:I(e.createdAt)}):(0,P.jsxs)(p,{children:[(0,P.jsx)(ne,{asChild:!0,children:(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:v(e.createdAt)})}),(0,P.jsx)(x,{children:m(e.createdAt)})]})})]},e.id))})]})}function B(){let e=ie(),p=ce(),[m,h]=oe(),{defaultRunMode:ne}=r(),v=e[`suite-id`]??``,y=(0,N.useMemo)(()=>he(m,ge),[m]),b=(0,N.useMemo)(()=>M(y,m),[m,y]),x=y.tab,C=y.view,[w,E]=(0,N.useState)(``),[D,O]=(0,N.useState)(``),[k,A]=(0,N.useState)(!0),[j,I]=(0,N.useState)(!1),[L,B]=(0,N.useState)(()=>F(v)),[V,H]=(0,N.useState)(`all`),[U,W]=(0,N.useState)(!1),[ve,ye]=(0,N.useState)(!1),G=(0,N.useMemo)(()=>{let e=w.match(/^name:\s*(.+)$/m);return e?_e(e[1]):null},[w]);a(G||`Suite`);let K=L.scope?.configured===!0,q=V===`scoped`&&K&&L.scopedTrends?L.scopedTrends:L.trends,J=V===`scoped`&&K&&L.scopedFlakyScore!==void 0?L.scopedFlakyScore:L.flakyScore,be=V===`scoped`&&K?L.scopedRuns??[]:L.runs,xe=(0,N.useMemo)(()=>q.daily.map(e=>({date:e.date,passRate:e.total>0?Math.round(e.passed/e.total*1e3)/10:0})),[q]),Se=(0,N.useMemo)(()=>L.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})),[L]),Y=be;(0,N.useEffect)(()=>{H(L.scope?.configured?`scoped`:`all`)},[L]),(0,N.useEffect)(()=>{b.toString()!==m.toString()&&h(b,{replace:!0})},[b,m,h]),(0,N.useEffect)(()=>{if(!v){I(!0),A(!1),B(F(``));return}let e=!1;return A(!0),I(!1),E(``),O(``),B(F(v)),re(v).then(t=>{e||(E(t.content),O(t.path))}).catch(()=>{e||(I(!0),S.error(`Failed to load suite file`))}).finally(()=>{e||A(!1)}),()=>{e=!0}},[v]),(0,N.useEffect)(()=>{if(!v)return;let e=!1;return ae(v,{limit:50}).then(t=>{e||B(t)}).catch(()=>{e||B(F(v))}),()=>{e=!0}},[v]);let X=async e=>{if(!(U||!D)){W(!0);try{let t=await le({file:D,local:e});S.success(`Run started`),p(_.runLive(t.runId))}catch(e){S.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{W(!1)}}},Z=_.suiteEdit(v),Q=`${Z}?live=1`;de({e:()=>p(Z),r:()=>{D&&X(ne===`local`)},l:()=>p(Q)});let $=e=>{h(M(e,m),{replace:!0})};if(k)return(0,P.jsx)(se,{});if(j)return(0,P.jsx)(ue,{icon:n,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>p(_.suites)});let Ce=(0,P.jsx)(fe,{content:w,onChange:()=>{},disabled:!0,suggestions:[]}),we=(0,P.jsx)(t,{value:w,onChange:()=>{},readOnly:!0,className:`h-full`}),Te=(0,P.jsxs)(`aside`,{"data-testid":`suite-detail-analytics-sidebar`,className:`flex flex-col gap-0 overflow-y-auto border-t border-border md:border-t-0 md:border-l md:border-border`,children:[(0,P.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})}),(0,P.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[Math.round(q.passRate*100),`%`]})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:g(L.trends.avgDuration)})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:L.total.toLocaleString()})]}),(0,P.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(J*100).toFixed(0),`%`]})]})]}),(0,P.jsx)(s,{className:`border-x-0 border-y-0`,children:(0,P.jsxs)(c,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,P.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y.slice(0,5),compactDate:!0})]})})]});return(0,P.jsx)(te,{children:(0,P.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,P.jsx)(pe,{suiteName:G||`Suite`,suiteId:v,unsaved:!1,isCreateMode:!1,mode:`view`,suiteHref:Z,isSaving:!1,isValidating:!1,isRunning:U,runDisabled:!D,hasInvalidFilename:!1,shortcutsOpen:ve,showSuiteId:!1,onBack:()=>p(_.suites),onSave:()=>{},onValidate:()=>{},onRun:e=>X(e),onLiveConnect:()=>p(Q),onSettingsOpen:()=>{},onToggleShortcuts:()=>ye(e=>!e)}),(0,P.jsxs)(f,{value:x,onValueChange:e=>$({tab:e,view:C}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,P.jsxs)(d,{variant:`line`,children:[(0,P.jsx)(l,{value:`overview`,children:`Overview`}),(0,P.jsx)(l,{value:`insights`,children:`Insights`})]})}),(0,P.jsxs)(u,{value:`overview`,className:`flex-1 min-h-0 mt-0 grid grid-cols-1 md:grid-cols-[minmax(480px,1fr)_minmax(260px,320px)]`,children:[(0,P.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,P.jsxs)(f,{value:C,onValueChange:e=>$({tab:x,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`border-b border-border`,children:(0,P.jsxs)(d,{variant:`line`,className:`w-full grid grid-cols-3 px-4 md:w-fit md:inline-flex`,children:[(0,P.jsx)(l,{value:`builder`,children:`Builder`}),(0,P.jsx)(l,{value:`yaml`,children:`YAML`}),(0,P.jsx)(l,{value:`memory`,children:`Memory`})]})}),(0,P.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,P.jsx)(u,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ce}),(0,P.jsx)(u,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:we}),(0,P.jsx)(u,{value:`memory`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:(0,P.jsx)(me,{scope:`suite`,scopeId:v,emptyTitle:`No suite memory yet`,emptyDescription:`This suite doesn't have cataloged observations in this workspace yet. Run the suite with memory enabled, then reopen this tab.`})})]})]})}),Te]}),(0,P.jsx)(u,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,P.jsxs)(`div`,{"data-testid":`suite-detail-insights`,className:`space-y-3 px-4 py-3`,children:[L.isFlaky&&(0,P.jsxs)(T,{variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-3`}),`Flaky (score: `,L.flakyScore.toFixed(2),`)`]}),(0,P.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,P.jsx)(c,{className:`border-b border-border md:border-b-0`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:L.total.toLocaleString()})]})}),(0,P.jsx)(c,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[Math.round(q.passRate*100),`%`]})]})}),(0,P.jsx)(c,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:g(L.trends.avgDuration)})]})}),(0,P.jsx)(c,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[(J*100).toFixed(0),`%`]})]})})]}),(0,P.jsx)(s,{children:(0,P.jsx)(c,{className:`px-4 py-3`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})})}),q.daily.length>0&&(0,P.jsxs)(s,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(ee,{data:xe})})]}),(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(o,{data:Se})})]})]}),(0,P.jsx)(s,{children:(0,P.jsxs)(c,{className:`px-4 py-3`,children:[(0,P.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y})]})})]})})]})]})})}export{B as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{i as t,l as n,n as r,o as i,s as a,t as o,u as s}from"./select-B5gV6YUf.js";import{t as c}from"./circle-x-DLBotPS8.js";import{t as l}from"./copy-Gj5_oF-8.js";import{t as u}from"./eye-CZ7GiZXJ.js";import{t as d}from"./refresh-cw-v_0wwa0P.js";import{t as f}from"./dist-o2A-YJGQ.js";import{r as p}from"./use-page-title-CK82kWb2.js";import{Cn as m,Hn as h,In as g,Kt as _,Ln as v,Mn as ee,Pt as y,Sn as te,Tn as b,Un as x,Ut as S,Zn as ne,bn as C,fr as re,jn as ie,qn as w,rt as ae,vn as oe,xn as se,yn as ce}from"./index-B3xPCIyH.js";import{t as T}from"./badge-BbhOGRC0.js";var E=w(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),le=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ue=w(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),D=e(re(),1),O=ne(),k=`Collapsible`,[de,fe]=m(k),[pe,A]=de(k),me=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=C({prop:r,defaultProp:i??!1,onChange:o,caller:k});return(0,O.jsx)(pe,{scope:n,disabled:a,contentId:oe(),open:c,onOpenToggle:D.useCallback(()=>l(e=>!e),[l]),children:(0,O.jsx)(b.div,{"data-state":P(c),"data-disabled":a?``:void 0,...s,ref:t})})});me.displayName=k;var he=`CollapsibleTrigger`,j=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=A(he,n);return(0,O.jsx)(b.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":P(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:te(e.onClick,i.onOpenToggle)})});j.displayName=he;var M=`CollapsibleContent`,N=D.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=A(M,e.__scopeCollapsible);return(0,O.jsx)(ce,{present:n||i.open,children:({present:e})=>(0,O.jsx)(ge,{...r,ref:t,present:e})})});N.displayName=M;var ge=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=A(M,n),[s,c]=D.useState(r),l=D.useRef(null),u=ie(t,l),d=D.useRef(0),f=d.current,p=D.useRef(0),m=p.current,h=o.open||s,g=D.useRef(h),_=D.useRef(void 0);return D.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),se(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,O.jsx)(b.div,{"data-state":P(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function P(e){return e?`open`:`closed`}var _e=me,ve=j,ye=N,F=`Accordion`,be=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[I,xe,Se]=f(F),[L,Ce]=m(F,[Se,fe]),R=fe(),we=D.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,O.jsx)(I.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,O.jsx)(ke,{...a,ref:t}):(0,O.jsx)(Oe,{...i,ref:t})})});we.displayName=F;var[z,Te]=L(F),[Ee,De]=L(F,{collapsible:!1}),Oe=D.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=C({prop:n,defaultProp:r??``,onChange:i,caller:F});return(0,O.jsx)(z,{scope:e.__scopeAccordion,value:D.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:D.useCallback(()=>a&&c(``),[a,c]),children:(0,O.jsx)(Ee,{scope:e.__scopeAccordion,collapsible:a,children:(0,O.jsx)(je,{...o,ref:t})})})}),ke=D.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=C({prop:n,defaultProp:r??[],onChange:i,caller:F}),c=D.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=D.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,O.jsx)(z,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,O.jsx)(Ee,{scope:e.__scopeAccordion,collapsible:!0,children:(0,O.jsx)(je,{...a,ref:t})})})}),[Ae,B]=L(F),je=D.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=ie(D.useRef(null),t),c=xe(n),l=p(i)===`ltr`,u=te(e.onKeyDown,e=>{if(!be.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,O.jsx)(Ae,{scope:n,disabled:r,direction:i,orientation:a,children:(0,O.jsx)(I.Slot,{scope:n,children:(0,O.jsx)(b.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),V=`AccordionItem`,[Me,H]=L(V),Ne=D.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=B(V,n),o=Te(V,n),s=R(n),c=oe(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,O.jsx)(Me,{scope:n,open:l,disabled:u,triggerId:c,children:(0,O.jsx)(_e,{"data-orientation":a.orientation,"data-state":ze(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});Ne.displayName=V;var Pe=`AccordionHeader`,Fe=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=B(F,n),a=H(Pe,n);return(0,O.jsx)(b.h3,{"data-orientation":i.orientation,"data-state":ze(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});Fe.displayName=Pe;var U=`AccordionTrigger`,Ie=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=B(F,n),a=H(U,n),o=De(U,n),s=R(n);return(0,O.jsx)(I.ItemSlot,{scope:n,children:(0,O.jsx)(ve,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});Ie.displayName=U;var Le=`AccordionContent`,Re=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=B(F,n),a=H(Le,n),o=R(n);return(0,O.jsx)(ye,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});Re.displayName=Le;function ze(e){return e?`open`:`closed`}var Be=we,Ve=Ne,He=Fe,Ue=Ie,We=Re;function W({...e}){return(0,O.jsx)(_e,{"data-slot":`collapsible`,...e})}function G({...e}){return(0,O.jsx)(j,{"data-slot":`collapsible-trigger`,...e})}function K({...e}){return(0,O.jsx)(N,{"data-slot":`collapsible-content`,...e})}function Ge({confidence:e}){let t=Math.round(e*100);return(0,O.jsxs)(T,{variant:`outline`,className:S(`text-xs font-mono`,t>80?`bg-emerald-500/10 text-emerald-500 border-emerald-500/20`:t>=50?`bg-amber-500/10 text-amber-500 border-amber-500/20`:`bg-red-500/10 text-red-500 border-red-500/20`),children:[t,`%`]})}function Ke({...e}){return(0,O.jsx)(Be,{"data-slot":`accordion`,...e})}function qe({className:e,...t}){return(0,O.jsx)(Ve,{"data-slot":`accordion-item`,className:S(`border-b last:border-b-0`,e),...t})}function Je({className:e,children:t,...r}){return(0,O.jsx)(He,{className:`flex`,children:(0,O.jsxs)(Ue,{"data-slot":`accordion-trigger`,className:S(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...r,children:[t,(0,O.jsx)(n,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function Ye({className:e,children:t,...n}){return(0,O.jsx)(We,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,O.jsx)(`div`,{className:S(`pt-0 pb-4`,e),children:t})})}function Xe({attempts:e}){return!e||e.length===0?null:(0,O.jsx)(Ke,{type:`single`,collapsible:!0,className:`w-full`,children:e.map((e,t)=>(0,O.jsxs)(qe,{value:`attempt-${t}`,children:[(0,O.jsx)(Je,{className:`py-2 text-sm`,children:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`font-medium`,children:[`Attempt `,e.attemptNumber??t+1]}),e.strategy&&(0,O.jsx)(T,{variant:`secondary`,className:`text-xs`,children:e.strategy}),e.success?(0,O.jsx)(h,{className:`h-3.5 w-3.5 text-emerald-500`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500`})]})}),(0,O.jsxs)(Ye,{className:`space-y-2`,children:[e.reasoning&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Reasoning`}),(0,O.jsx)(`p`,{className:`text-sm`,children:e.reasoning})]}),e.observationBefore&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Observation Before`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.observationBefore.length>200?`${e.observationBefore.slice(0,200)}…`:e.observationBefore})]}),e.observationAfter&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Observation After`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.observationAfter.length>200?`${e.observationAfter.slice(0,200)}…`:e.observationAfter})]}),e.action!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Action`}),(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto`,children:typeof e.action==`string`?e.action:JSON.stringify(e.action,null,2)})]})]})]},t))})}var q=[{key:`observe`,label:`Observe`,icon:u},{key:`plan`,label:`Plan`,icon:E},{key:`execute`,label:`Execute`,icon:v},{key:`verify`,label:`Verify`,icon:ue},{key:`heal`,label:`Heal`,icon:d}];function Ze(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e,null,2)}function J({config:e,content:t,duration:n,outcome:r,children:i,open:a,onOpenChange:o,sectionRef:s}){let[c,l]=(0,D.useState)(!1),u=a!==void 0,d=u?a:c,f=u?o:l,p=e.icon,m=t||i;return(0,O.jsxs)(W,{open:d,onOpenChange:f,children:[(0,O.jsxs)(G,{ref:s,className:`flex w-full items-center gap-2 py-1.5 text-left group sticky top-0 z-20 bg-background`,children:[(0,O.jsx)(`div`,{className:`flex items-center justify-center h-4 w-4 rounded-full bg-background border shrink-0`,children:(0,O.jsx)(p,{className:`h-2.5 w-2.5 text-muted-foreground`})}),(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),n!=null&&(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_(n)}),r,(0,O.jsx)(`span`,{className:`flex-1`}),m&&(0,O.jsx)(x,{className:S(`h-3 w-3 text-muted-foreground transition-transform duration-200`,d&&`rotate-90`)})]}),m&&(0,O.jsx)(K,{className:`overflow-hidden min-w-0 max-w-full`,children:(0,O.jsxs)(`div`,{className:`min-w-0 max-w-full pl-6 pb-2 space-y-2`,children:[t&&(0,O.jsx)(`div`,{"data-reasoning-content-shell":`true`,className:`min-w-0 max-w-full rounded-sm`,children:(0,O.jsx)(`div`,{"data-reasoning-prose":`true`,className:`m-0 whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]`,children:t})}),i&&(0,O.jsx)(`div`,{"data-reasoning-children":`true`,className:`min-w-0 max-w-full`,children:i})]})})]})}function Qe(e){let t=[];return e.observation&&t.push({key:`observation`,label:`Observe`,icon:q[0].icon,content:e.observation,duration:null}),e.reasoning&&t.push({key:`reasoning`,label:`Plan`,icon:q[1].icon,content:e.reasoning,duration:null}),e.plannedAction!=null&&t.push({key:`plannedAction`,label:`Execute`,icon:q[2].icon,content:null,duration:null,children:(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),t}var $e=(0,D.forwardRef)(function({step:e},t){let n=Qe(e);return n.length===0&&e.error?(0,O.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(et,{ref:t,sections:n}),e.error&&(0,O.jsx)(`div`,{className:`pl-6 pb-2`,children:(0,O.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error})})]})}),et=(0,D.forwardRef)(function({sections:e},t){let[n,r]=(0,D.useState)(()=>e.map(()=>!1)),i=(0,D.useRef)([]),a=(0,D.useCallback)(e=>{r(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{i.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);return(0,D.useImperativeHandle)(t,()=>({togglePhase:a}),[a]),(0,O.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,O.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),e.map((e,t)=>(0,O.jsx)(J,{config:{key:e.key,label:e.label,icon:e.icon},content:e.content,duration:e.duration,outcome:e.outcome,open:n[t],onOpenChange:e=>r(n=>{let r=[...n];return r[t]=e,r}),sectionRef:e=>{i.current[t]=e},children:e.children},e.key))]})}),tt=(0,D.forwardRef)(function({runId:e,stepOrder:t,stepData:n},r){let[i,a]=(0,D.useState)(null),[o,s]=(0,D.useState)(!0),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)([!1,!1,!1,!1]),f=(0,D.useRef)([null,null,null,null]),p=(0,D.useCallback)(e=>{d(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{f.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);if((0,D.useImperativeHandle)(r,()=>({togglePhase:p}),[p]),(0,D.useEffect)(()=>{let n=!1;return ae(e,t).then(e=>{n||(a(e.trace),s(!1))}).catch(e=>{n||(l(e instanceof Error?e.message:`Failed to load reasoning`),s(!1))}),()=>{n=!0}},[e,t]),o)return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(y,{className:`h-4 w-3/4`}),(0,O.jsx)(y,{className:`h-4 w-1/2`}),(0,O.jsx)(y,{className:`h-4 w-2/3`})]});if(!i&&c||!i)return(0,O.jsx)($e,{ref:r,step:n});let m=i.healAttempts&&i.healAttempts.length>0;return(0,O.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,O.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),(0,O.jsx)(J,{config:q[0],content:i.observeText,duration:i.observeDuration,open:u[0],onOpenChange:e=>d(t=>{let n=[...t];return n[0]=e,n}),sectionRef:e=>{f.current[0]=e}}),(0,O.jsx)(J,{config:q[1],content:i.planReasoning,duration:i.planDuration,outcome:i.planConfidence==null?void 0:(0,O.jsx)(Ge,{confidence:i.planConfidence}),open:u[1],onOpenChange:e=>d(t=>{let n=[...t];return n[1]=e,n}),sectionRef:e=>{f.current[1]=e},children:i.planAction!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Planned Action`}),(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:Ze(i.planAction)})]})}),(0,O.jsx)(J,{config:q[2],content:null,duration:i.executeDuration,open:u[2],onOpenChange:e=>d(t=>{let n=[...t];return n[2]=e,n}),sectionRef:e=>{f.current[2]=e},children:i.executeAction!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Executed Action`}),(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:Ze(i.executeAction)})]})}),(0,O.jsx)(J,{config:q[3],content:i.verifyReasoning,duration:i.verifyDuration,outcome:i.verifySuccess==null?void 0:(0,O.jsx)(`span`,{className:S(`text-xs font-medium`,i.verifySuccess?`text-emerald-500`:`text-red-500`),children:i.verifySuccess?`Passed`:`Failed`}),open:u[3],onOpenChange:e=>d(t=>{let n=[...t];return n[3]=e,n}),sectionRef:e=>{f.current[3]=e}}),m&&(0,O.jsx)(J,{config:q[4],content:null,duration:null,children:(0,O.jsx)(Xe,{attempts:i.healAttempts})})]})}),nt=(0,D.forwardRef)(function(e,t){return e.mode===`static`?(0,O.jsx)(et,{sections:e.sections,ref:t}):(0,O.jsx)(tt,{runId:e.runId,stepOrder:e.stepOrder,stepData:e.stepData,ref:t})});function rt(e){switch(e){case`env`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`capture`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;case`cli`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-amber-500/15 text-amber-400 border-amber-500/20`;case`suite`:return`bg-cyan-500/15 text-cyan-400 border-cyan-500/20`;case`test`:return`bg-pink-500/15 text-pink-400 border-pink-500/20`;case`hook`:return`bg-orange-500/15 text-orange-400 border-orange-500/20`;case`step`:return`bg-teal-500/15 text-teal-400 border-teal-500/20`;default:return`bg-muted text-muted-foreground`}}function Y({title:e,count:t,defaultOpen:n,children:r}){return(0,O.jsxs)(W,{defaultOpen:n,children:[(0,O.jsxs)(G,{className:`flex items-center gap-1.5 w-full px-3 py-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors`,children:[(0,O.jsx)(x,{className:`h-3 w-3 transition-transform duration-200 [[data-state=open]>&]:rotate-90`}),e,(0,O.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[`(`,t,`)`]})]}),(0,O.jsx)(K,{children:r})]})}function X({message:e}){return(0,O.jsx)(`div`,{className:`px-4 py-3 text-xs text-muted-foreground/60 italic`,children:e})}function it({step:e,executionLogs:t=[]}){let n=e.variableSnapshot,r=n?Object.entries(n):[],i=t.filter(e=>e.type===`runjs`),a=t.filter(e=>e.type===`hook`);return(0,O.jsxs)(`div`,{className:`py-1`,children:[(0,O.jsx)(Y,{title:`Env`,count:r.length,defaultOpen:r.length>0,children:r.length===0?(0,O.jsx)(X,{message:`No variables at this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2`,children:(0,O.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{className:`border-b`,children:[(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Variable`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Value`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Source`})]})}),(0,O.jsx)(`tbody`,{children:r.map(([e,t])=>(0,O.jsxs)(`tr`,{className:`border-b border-border/50`,children:[(0,O.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs text-muted-foreground`,children:e}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs break-all`,children:t.value}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(T,{className:S(`text-[10px] px-1.5 py-0 border`,rt(t.source)),children:t.source})})]},e))})]})})}),(0,O.jsx)(Y,{title:`runJS`,count:i.length,defaultOpen:i.length>0,children:i.length===0?(0,O.jsx)(X,{message:`No runJS executions for this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:i.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[e.status===`passed`?(0,O.jsx)(h,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,O.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,O.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:_(e.duration)})]}),e.stdout&&(0,O.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden`,children:e.stdout}),e.returnData!=null&&(0,O.jsxs)(`div`,{className:`mt-1 p-1.5 rounded bg-muted/50`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground`,children:`Return: `}),(0,O.jsx)(`span`,{className:`font-mono text-[11px]`,children:typeof e.returnData==`string`?e.returnData:JSON.stringify(e.returnData)})]})]},e.id))})}),(0,O.jsx)(Y,{title:`Hooks`,count:a.length,defaultOpen:a.length>0,children:a.length===0?(0,O.jsx)(X,{message:`No hooks ran for this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:a.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[e.status===`passed`?(0,O.jsx)(h,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,O.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,O.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:_(e.duration)})]}),e.variables&&Object.keys(e.variables).length>0&&(0,O.jsxs)(`div`,{className:`mt-1.5 space-y-0.5`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground text-[10px]`,children:`Emitted variables:`}),Object.entries(e.variables).map(([e,t])=>(0,O.jsxs)(`div`,{className:`flex gap-2 pl-2 font-mono text-[11px]`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,O.jsx)(`span`,{className:`break-all`,children:t})]},e))]}),e.stdout&&(0,O.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden max-h-24 overflow-y-auto`,children:e.stdout})]},e.id))})})]})}function at(e){return e>=1e3?`+${(e/1e3).toFixed(1)}s`:`+${Math.round(e)}ms`}function ot(e){return Object.entries(e).filter(([e,t])=>e!==`startTime`&&t>0)}function st(e){return e>=200&&e<300?`text-emerald-500`:e>=300&&e<400?`text-amber-500`:e>=400?`text-red-500`:`text-muted-foreground`}function ct({headers:e}){let t=Object.entries(e);return t.length===0?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`None`}):(0,O.jsx)(`div`,{className:`space-y-0.5`,children:t.map(([e,t])=>(0,O.jsxs)(`div`,{className:`flex gap-2 text-xs font-mono`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground shrink-0`,children:[e,`:`]}),(0,O.jsx)(`span`,{className:`break-all`,children:t})]},e))})}function Z({label:e,children:t}){return(0,O.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,O.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:e}),t]})}function lt({text:e}){let[t,n]=(0,D.useState)(!1);return(0,O.jsx)(`button`,{onClick:(0,D.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},[e]),className:`text-muted-foreground hover:text-foreground`,children:t?(0,O.jsx)(s,{className:`h-3 w-3`}):(0,O.jsx)(l,{className:`h-3 w-3`})})}function ut({body:e,contentType:t}){let n=t.toLowerCase();if(n.includes(`application/json`))try{return(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:JSON.stringify(JSON.parse(e),null,2)})}catch{return(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}return n.includes(`image/svg+xml`)?(0,O.jsx)(`img`,{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:`SVG response`,className:`max-h-48`}):e.startsWith(`data:image/`)?(0,O.jsx)(`img`,{src:e,alt:`Image response`,className:`max-h-48 rounded-sm`}):n.includes(`image/`)?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Image not previewable (re-run test to capture)`}):(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}function dt({entry:e}){let t=e.method===`POST`||e.method===`PUT`||e.method===`PATCH`;return(0,O.jsx)(`tr`,{children:(0,O.jsx)(`td`,{colSpan:6,className:`px-0 py-0`,children:(0,O.jsxs)(`div`,{className:`bg-muted/20 border-b border-border/50 px-4 py-3 space-y-4`,children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,O.jsx)(Z,{label:`Request Headers`,children:(0,O.jsx)(ct,{headers:e.requestHeaders??{}})}),(0,O.jsx)(Z,{label:`Response Headers`,children:(0,O.jsx)(ct,{headers:e.responseHeaders??{}})})]}),t&&(0,O.jsx)(Z,{label:`Request Body`,children:e.requestBody?(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e.requestBody}):(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`No request body`})}),(0,O.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,O.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:`Response Body`}),e.body&&(0,O.jsx)(lt,{text:e.body})]}),e.body?(0,O.jsx)(ut,{body:e.body,contentType:e.responseHeaders?.[`content-type`]??``}):(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Not captured`})]}),e.timing&&(()=>{let t=ot(e.timing);return t.length===0?null:(0,O.jsx)(Z,{label:`Timing`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:t.map(([e,t])=>(0,O.jsxs)(`div`,{className:`text-xs font-mono`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),` `,(0,O.jsxs)(`span`,{children:[Math.round(t),`ms`]})]},e))})})})()]})})})}function Q({text:e,query:t}){if(!t)return(0,O.jsx)(O.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsxs)(O.Fragment,{children:[e.slice(0,n),(0,O.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function ft({step:e,allSteps:t,platform:n}){let[r,i]=(0,D.useState)(new Set),a=(0,D.useMemo)(()=>{let n=e.displayStepOrder??e.stepOrder,r=[];for(let e of t){let t=e.displayStepOrder??e.stepOrder;if(t>n)continue;let i=t===n;for(let t of e.networkLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.startTime-t.startTime)},[e,t]),o=(0,D.useMemo)(()=>a.length===0?0:Math.min(...a.map(e=>e.startTime)),[a]),[s,c]=(0,D.useState)(``),l=(0,D.useDeferredValue)(s),u=(0,D.useMemo)(()=>{if(!l)return a;let e=l.toLowerCase();return a.filter(t=>t.url.toLowerCase().includes(e)||t.method.toLowerCase().includes(e)||String(t.status).includes(e))},[a,l]);(0,D.useEffect)(()=>{i(new Set)},[l]);let d=(0,D.useCallback)(e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return a.length===0?(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm py-12`,children:n===`android`||n===`ios`?`Network capture is not available for mobile tests`:`No network requests captured for this step`}):(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,O.jsx)(g,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,O.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),s&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[u.length,` of `,a.length]}),(0,O.jsx)(`button`,{onClick:()=>c(``),className:`text-muted-foreground hover:text-foreground`,children:(0,O.jsx)(ee,{className:`h-3.5 w-3.5`})})]})]}),(0,O.jsx)(`div`,{className:`p-3`,children:(0,O.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{className:`border-b`,children:[(0,O.jsx)(`th`,{className:`w-6`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Method`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`URL`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Status`}),(0,O.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Time`}),(0,O.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Duration`})]})}),(0,O.jsx)(`tbody`,{children:u.map((e,t)=>{let n=e.endTime-e.startTime,i=r.has(t);return(0,O.jsxs)(D.Fragment,{children:[(0,O.jsxs)(`tr`,{onClick:()=>d(t),className:S(`border-b border-border/50 cursor-pointer hover:bg-muted/30 transition-colors`,i&&`bg-muted/20`,!e.isCurrent&&`opacity-40`),children:[(0,O.jsx)(`td`,{className:`py-1.5 pl-2 pr-0 w-6`,children:(0,O.jsx)(x,{className:S(`h-3 w-3 text-muted-foreground transition-transform`,i&&`rotate-90`)})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(T,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:(0,O.jsx)(Q,{text:e.method,query:l})})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono truncate max-w-0 min-w-0`,children:(0,O.jsx)(Q,{text:e.url,query:l})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(`span`,{className:S(`text-xs font-mono`,st(e.status)),children:(0,O.jsx)(Q,{text:String(e.status),query:l})})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono text-muted-foreground text-right`,children:at(e.startTime-o)}),(0,O.jsxs)(`td`,{className:`py-1.5 px-2 text-xs text-muted-foreground text-right`,children:[n<1?`<1`:Math.round(n),`ms`]})]}),i&&(0,O.jsx)(dt,{entry:e})]},t)})})]})})]})}function pt(e){switch(e.toLowerCase()){case`error`:return`text-red-400`;case`warn`:case`warning`:return`text-amber-400`;case`info`:return`text-blue-400`;case`debug`:return`text-cyan-400`;default:return`text-muted-foreground`}}function mt(e){switch(e){case`setup`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`teardown`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;default:return`bg-muted text-muted-foreground`}}var $=[`error`,`warn`,`info`,`log`,`debug`];function ht({text:e,query:t}){if(!t)return(0,O.jsx)(O.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsxs)(O.Fragment,{children:[e.slice(0,n),(0,O.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function gt({step:e,allSteps:n,executionLogs:s,isHookStep:c}){let l=(0,D.useMemo)(()=>{let t=e.displayStepOrder??e.stepOrder,r=[];for(let e of n){let n=e.displayStepOrder??e.stepOrder;if(n>t)continue;let i=n===t;for(let t of e.consoleLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.timestamp-t.timestamp)},[e,n]),[u,d]=(0,D.useState)(``),f=(0,D.useDeferredValue)(u),[p,m]=(0,D.useState)(`all`),h=(0,D.useMemo)(()=>{let e=l;if(p!==`all`&&(e=e.filter(e=>{let t=e.level.toLowerCase(),n=$.indexOf(p);if(n===-1)return!0;let r=$.indexOf(t);return r!==-1&&r>=n})),f){let t=f.toLowerCase();e=e.filter(e=>e.text.toLowerCase().includes(t)||e.level.toLowerCase().includes(t))}return e},[l,f,p]),_=c&&s&&s.length>0,v=l.length>0;return!_&&!v?(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm py-12`,children:`No console output captured for this step`}):(0,O.jsxs)(`div`,{className:`w-full overflow-hidden`,children:[v&&(0,O.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,O.jsx)(g,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,O.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),u&&(0,O.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[h.length,` of `,l.length]}),(0,O.jsx)(`div`,{className:`h-3 w-px bg-border/50 shrink-0`}),(0,O.jsxs)(o,{value:p,onValueChange:m,children:[(0,O.jsx)(i,{size:`sm`,className:`h-6 rounded-sm text-xs px-2 gap-1 border-border/50 min-w-0 w-auto`,children:(0,O.jsx)(a,{})}),(0,O.jsxs)(r,{className:`rounded-sm`,children:[(0,O.jsx)(t,{value:`all`,className:`text-xs`,children:`All levels`}),(0,O.jsx)(t,{value:`error`,className:`text-xs`,children:`Errors`}),(0,O.jsx)(t,{value:`warn`,className:`text-xs`,children:`Warnings`}),(0,O.jsx)(t,{value:`info`,className:`text-xs`,children:`Info`}),(0,O.jsx)(t,{value:`log`,className:`text-xs`,children:`Log`}),(0,O.jsx)(t,{value:`debug`,className:`text-xs`,children:`Debug`})]})]}),u&&(0,O.jsx)(`button`,{onClick:()=>d(``),className:`text-muted-foreground hover:text-foreground shrink-0`,children:(0,O.jsx)(ee,{className:`h-3.5 w-3.5`})})]}),(0,O.jsxs)(`div`,{className:`p-3 space-y-0.5 overflow-x-hidden w-full max-w-full`,children:[_&&(0,O.jsx)(`div`,{className:`space-y-2 mb-3`,children:s.map(e=>(0,O.jsxs)(`div`,{className:`border border-border/50 rounded-sm overflow-hidden`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 bg-muted/20 border-b border-border/30`,children:[(0,O.jsx)(T,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:e.name}),(0,O.jsx)(T,{className:S(`text-[10px] px-1.5 py-0`,mt(e.phase)),children:e.phase}),(0,O.jsx)(`span`,{className:S(`text-[10px] font-mono`,e.status===`passed`?`text-emerald-500`:`text-red-500`),children:e.status}),(0,O.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:[e.duration,`ms`]})]}),e.stdout&&(0,O.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-foreground/90`,children:e.stdout}),e.stderr&&(0,O.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-red-400/80 border-t border-border/30`,children:e.stderr})]},e.id))}),_&&v&&(0,O.jsx)(`div`,{className:`border-t border-border/30 pt-2 mb-1`,children:(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider`,children:`Browser Console`})}),v&&h.map((e,t)=>(0,O.jsxs)(`div`,{className:S(`flex items-start gap-1.5 py-0.5 px-2 hover:bg-muted/30 font-mono text-xs overflow-hidden max-w-full`,!e.isCurrent&&`opacity-40`),children:[(0,O.jsx)(`span`,{className:S(`shrink-0 text-[10px]`,pt(e.level)),children:e.level}),(0,O.jsx)(`span`,{className:`text-muted-foreground/60 shrink-0 text-[10px] tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString()}),(0,O.jsx)(`span`,{className:`flex-1 min-w-0 break-all whitespace-pre-wrap overflow-hidden`,children:(0,O.jsx)(ht,{text:e.text,query:f})})]},t))]})]})}export{Xe as a,K as c,le as d,E as f,nt as i,G as l,ft as n,Ge as o,it as r,W as s,gt as t,ue as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-CilyBKbf.js";import{Ut as e,Zn as t,fr as n}from"./index-B3xPCIyH.js";n();var r=t();function i({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:e(`w-full caption-bottom text-sm`,t),...n})})}function a({className:t,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:e(`[&_tr]:border-b`,t),...n})}function o({className:t,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:e(`[&_tr:last-child]:border-0`,t),...n})}function s({className:t,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:e(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,t),...n})}function c({className:t,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:e(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,t),...n})}function l({className:t,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:e(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,t),...n})}export{a,c as i,o as n,s as o,l as r,i as t};
|