@straiffi/archon 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/ActivityView-CdDT5tgr.js +1 -0
- package/dist/client/assets/{GitHubActionsDialog-GWVxWGPK.js → GitHubActionsDialog-NdYtgMhg.js} +1 -1
- package/dist/client/assets/{VerificationDialog-C4RMuI4y.js → VerificationDialog-BfIKtVjt.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-CeM6gbLN.js → architectureDiagram-3BPJPVTR-C4zoWnXM.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-BP4hta96.js → blockDiagram-GPEHLZMM-ZhRwV8ma.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-5aJScvhn.js → c4Diagram-AAUBKEIU-CA2USxCJ.js} +1 -1
- package/dist/client/assets/channel-C4I-VlJu.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-BKc2IelV.js → chunk-2J33WTMH-CY32Brnt.js} +1 -1
- package/dist/client/assets/{chunk-3OPIFGDE-DCc15la5.js → chunk-3OPIFGDE-H70UH7rH.js} +1 -1
- package/dist/client/assets/{chunk-5ZQYHXKU-DSD9HbTp.js → chunk-5ZQYHXKU-DC1dllSt.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-DrAjnKiA.js → chunk-727SXJPM-DVIgI7hM.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-DxKnpHfQ.js → chunk-AQP2D5EJ-gwSYEPou.js} +1 -1
- package/dist/client/assets/{chunk-CSCIHK7Q-DLejrAB_.js → chunk-CSCIHK7Q-Z1cfABPc.js} +1 -1
- package/dist/client/assets/{chunk-KSCS5N6A-BWRNmF8S.js → chunk-KSCS5N6A-DFoW6dtq.js} +1 -1
- package/dist/client/assets/{chunk-L5ZTLDWV-D48i966f.js → chunk-L5ZTLDWV-CmQbbP8b.js} +1 -1
- package/dist/client/assets/{chunk-LZXEDZCA-DLhg6Bok.js → chunk-LZXEDZCA-Ba16nX-R.js} +2 -2
- package/dist/client/assets/{chunk-ND2GUHAM-B4-7cOEq.js → chunk-ND2GUHAM-Bc7u1Zqm.js} +1 -1
- package/dist/client/assets/{chunk-NZK2D7GU-D2ttXA_d.js → chunk-NZK2D7GU-DNXYx7JX.js} +1 -1
- package/dist/client/assets/{chunk-O5CBEL6O-BrWrOVCq.js → chunk-O5CBEL6O-Ba00cuZ5.js} +1 -1
- package/dist/client/assets/{chunk-WU5MYG2G-CLcPwxPe.js → chunk-WU5MYG2G-SJ_ny5dU.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-Ca3KxBnW.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CSpMessw.js +1 -0
- package/dist/client/assets/{dagre-BM42HDAG-DIXN8_VX.js → dagre-BM42HDAG-CL2dKbj9.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-D2wjdCij.js → diagram-2AECGRRQ-DQq1qZ0l.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-E1Og_PHE.js → diagram-5GNKFQAL-Zf0YQuRe.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-B6P1Ud8a.js → diagram-KO2AKTUF-DcUxL9SG.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-C3Jxq56v.js → diagram-LMA3HP47-BAIixEu7.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-Do9LVhdL.js → diagram-OG6HWLK6-Dhhjm84p.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-DLb5E4-f.js → erDiagram-TEJ5UH35-BcQOacBP.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-CcTs_wU9.js → flowDiagram-I6XJVG4X-BZIJqLp3.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-q9ez5fri.js → ganttDiagram-6RSMTGT7-DFC6qgrY.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-BcaKiz4c.js → gitGraphDiagram-PVQCEYII-Ds0nwSU0.js} +1 -1
- package/dist/client/assets/index-Bg3l17L3.css +2 -0
- package/dist/client/assets/index-D_KmViSu.js +276 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-Cu0w4frE.js → infoDiagram-5YYISTIA-DfDrR5Mz.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-CJ47Z-ak.js → ishikawaDiagram-YF4QCWOH-B2v4Byji.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-fAL_Zcvs.js → journeyDiagram-JHISSGLW-CO6laklO.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-BTNIybMC.js → kanban-definition-UN3LZRKU-BziFO199.js} +1 -1
- package/dist/client/assets/{line-BvsadeZR.js → line-Vb0A8-Oe.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-C0EkH2y_.js → mermaid-parser.core-Bm3Xv0Zt.js} +1 -1
- package/dist/client/assets/{mermaid.core-BU5QIIbY.js → mermaid.core-DXBRp0XG.js} +3 -3
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-CWbSYK8f.js → mindmap-definition-RKZ34NQL-4GueJvPT.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-t4w2cB-y.js → pieDiagram-4H26LBE5-Djy0sVJR.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-Cqasvrpa.js → quadrantDiagram-W4KKPZXB-3rWAi4K5.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-_l-mY-tb.js → requirementDiagram-4Y6WPE33-D7-WCnjH.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-Cr9YrZ-Y.js → sankeyDiagram-5OEKKPKP-B4-3BUQ2.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-DvzZhQpb.js → sequenceDiagram-3UESZ5HK-DCWomuSc.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-cFjPpAO3.js → stateDiagram-AJRCARHV-DpsWWFaO.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BE_IAuYt.js +1 -0
- package/dist/client/assets/{timeline-definition-PNZ67QCA-BjRNrEJY.js → timeline-definition-PNZ67QCA-B0Mh4MHF.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-xs9afjrw.js → vennDiagram-CIIHVFJN-Dpxr8LTG.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-DH68ZYti.js → wardleyDiagram-YWT4CUSO-BdAz5ERd.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-DLW5ktTU.js → xychartDiagram-2RQKCTM6-BV9Ah-jk.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/db.js +640 -0
- package/dist/server/db.js.map +1 -1
- package/dist/server/index.js +795 -125
- package/dist/server/index.js.map +1 -1
- package/dist/server/lib/agentCatalog.js +35 -0
- package/dist/server/lib/agentCatalog.js.map +1 -0
- package/dist/server/lib/agentModelConfig.js +151 -0
- package/dist/server/lib/agentModelConfig.js.map +1 -0
- package/dist/server/lib/agentRuns.js +1 -0
- package/dist/server/lib/agentRuns.js.map +1 -1
- package/dist/server/lib/automationCheckGate.js +98 -9
- package/dist/server/lib/automationCheckGate.js.map +1 -1
- package/dist/server/lib/automationLoopAgentEvidence.js +42 -0
- package/dist/server/lib/automationLoopAgentEvidence.js.map +1 -0
- package/dist/server/lib/automationLoopProjection.js +339 -0
- package/dist/server/lib/automationLoopProjection.js.map +1 -0
- package/dist/server/lib/automationProgression.js +115 -6
- package/dist/server/lib/automationProgression.js.map +1 -1
- package/dist/server/lib/automationReconciliation.js +27 -11
- package/dist/server/lib/automationReconciliation.js.map +1 -1
- package/dist/server/lib/automationResumeDecision.js +55 -15
- package/dist/server/lib/automationResumeDecision.js.map +1 -1
- package/dist/server/lib/automationReviewGate.js +352 -26
- package/dist/server/lib/automationReviewGate.js.map +1 -1
- package/dist/server/lib/buildExecutionEnvironment.js +7 -4
- package/dist/server/lib/buildExecutionEnvironment.js.map +1 -1
- package/dist/server/lib/buildFlow.js +12 -0
- package/dist/server/lib/buildFlow.js.map +1 -1
- package/dist/server/lib/bundleReviewOperations.js +40 -23
- package/dist/server/lib/bundleReviewOperations.js.map +1 -1
- package/dist/server/lib/chatOperations.js +26 -4
- package/dist/server/lib/chatOperations.js.map +1 -1
- package/dist/server/lib/checkAutoFix.js +5 -4
- package/dist/server/lib/checkAutoFix.js.map +1 -1
- package/dist/server/lib/checkAutoFixDetails.js +54 -9
- package/dist/server/lib/checkAutoFixDetails.js.map +1 -1
- package/dist/server/lib/checkGateEvaluations.js +6 -1
- package/dist/server/lib/checkGateEvaluations.js.map +1 -1
- package/dist/server/lib/checkRepair.js +30 -0
- package/dist/server/lib/checkRepair.js.map +1 -1
- package/dist/server/lib/claudeAgentProvider.js +19 -0
- package/dist/server/lib/claudeAgentProvider.js.map +1 -1
- package/dist/server/lib/claudeValidationOutput.js +4 -4
- package/dist/server/lib/claudeValidationOutput.js.map +1 -1
- package/dist/server/lib/dockerSandboxExecutionEnvironment.js +48 -7
- package/dist/server/lib/dockerSandboxExecutionEnvironment.js.map +1 -1
- package/dist/server/lib/executionEnvironmentValidation.js +19 -10
- package/dist/server/lib/executionEnvironmentValidation.js.map +1 -1
- package/dist/server/lib/executionRunAuthority.js +30 -0
- package/dist/server/lib/executionRunAuthority.js.map +1 -1
- package/dist/server/lib/executionRuns.js +17 -3
- package/dist/server/lib/executionRuns.js.map +1 -1
- package/dist/server/lib/executionTimeline.js +3 -0
- package/dist/server/lib/executionTimeline.js.map +1 -1
- package/dist/server/lib/lightweightPrompt.js +13 -40
- package/dist/server/lib/lightweightPrompt.js.map +1 -1
- package/dist/server/lib/mobileAccess.js +47 -3
- package/dist/server/lib/mobileAccess.js.map +1 -1
- package/dist/server/lib/modelResolutionErrors.js +24 -0
- package/dist/server/lib/modelResolutionErrors.js.map +1 -0
- package/dist/server/lib/models.js +9 -9
- package/dist/server/lib/models.js.map +1 -1
- package/dist/server/lib/postBuildCheckRuns.js +79 -2
- package/dist/server/lib/postBuildCheckRuns.js.map +1 -1
- package/dist/server/lib/projectAutoConfig.js +15 -52
- package/dist/server/lib/projectAutoConfig.js.map +1 -1
- package/dist/server/lib/projectMemoryScan.js +15 -9
- package/dist/server/lib/projectMemoryScan.js.map +1 -1
- package/dist/server/lib/projects.js +59 -4
- package/dist/server/lib/projects.js.map +1 -1
- package/dist/server/lib/reviewRepairCompletion.js +126 -0
- package/dist/server/lib/reviewRepairCompletion.js.map +1 -0
- package/dist/server/lib/reviewRepairIterationRecords.js +149 -0
- package/dist/server/lib/reviewRepairIterationRecords.js.map +1 -0
- package/dist/server/lib/reviewRepairIterations.js +590 -0
- package/dist/server/lib/reviewRepairIterations.js.map +1 -0
- package/dist/server/lib/reviewRepairReconciliation.js +588 -0
- package/dist/server/lib/reviewRepairReconciliation.js.map +1 -0
- package/dist/server/lib/reviewerConfig.js +18 -7
- package/dist/server/lib/reviewerConfig.js.map +1 -1
- package/dist/server/lib/run.js +7 -2
- package/dist/server/lib/run.js.map +1 -1
- package/dist/server/lib/specArtifact.js +1 -1
- package/dist/server/lib/specArtifact.js.map +1 -1
- package/dist/server/lib/specGraphFeature.js +2 -2
- package/dist/server/lib/specGraphFeature.js.map +1 -1
- package/dist/server/lib/specOperations.js +26 -4
- package/dist/server/lib/specOperations.js.map +1 -1
- package/dist/server/lib/specRepositoryEvidenceFormatting.js +2 -2
- package/dist/server/lib/specRepositoryEvidenceFormatting.js.map +1 -1
- package/dist/server/lib/specRepositoryImpact.js +3 -3
- package/dist/server/lib/specRepositoryImpact.js.map +1 -1
- package/dist/server/lib/specReviewContext.js +7 -1
- package/dist/server/lib/specReviewContext.js.map +1 -1
- package/dist/server/lib/specReviewOperations.js +20 -7
- package/dist/server/lib/specReviewOperations.js.map +1 -1
- package/dist/server/lib/specSnapshotEvidence.js +3 -3
- package/dist/server/lib/specSnapshotEvidence.js.map +1 -1
- package/dist/server/lib/ticketAutomation.js +9 -11
- package/dist/server/lib/ticketAutomation.js.map +1 -1
- package/dist/server/lib/ticketAutomationCommit.js +21 -11
- package/dist/server/lib/ticketAutomationCommit.js.map +1 -1
- package/dist/server/lib/ticketFollowUpOperations.js +25 -7
- package/dist/server/lib/ticketFollowUpOperations.js.map +1 -1
- package/dist/server/lib/ticketSettingsOperations.js +9 -0
- package/dist/server/lib/ticketSettingsOperations.js.map +1 -1
- package/dist/server/lib/ticketWorkflowOperations.js +2 -6
- package/dist/server/lib/ticketWorkflowOperations.js.map +1 -1
- package/dist/server/lib/tickets.js +16 -6
- package/dist/server/lib/tickets.js.map +1 -1
- package/dist/server/lib/types.js +45 -0
- package/dist/server/lib/types.js.map +1 -1
- package/dist/server/workers/build.js +111 -1
- package/dist/server/workers/build.js.map +1 -1
- package/dist/server/workers/followUp.js +109 -22
- package/dist/server/workers/followUp.js.map +1 -1
- package/dist/server/workers/review.js +292 -60
- package/dist/server/workers/review.js.map +1 -1
- package/dist/server/workers/specReview.js +17 -8
- package/dist/server/workers/specReview.js.map +1 -1
- package/dist/server/workers/specSession.js +33 -23
- package/dist/server/workers/specSession.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ActivityView-Y5IaJiim.js +0 -1
- package/dist/client/assets/channel-B3DjZXbm.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-DproSkn2.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-JVMMzJxJ.js +0 -1
- package/dist/client/assets/index-1CokwSFm.css +0 -2
- package/dist/client/assets/index-CSOKbu3w.js +0 -276
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-btHMH5Cg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ht as e,r as t}from"./index-D_KmViSu.js";var n=e(),r=({projectId:e,onClose:r,onDetailsClose:i,onNavigateToLifecycleSource:a,initialRunId:o,initialEventId:s,onRunSelectionChange:c,onRelatedReferenceSelection:l,onUnavailable:u})=>e?(0,n.jsx)(t,{projectId:e,scope:{type:`project`},initialRunId:o,initialEventId:s,onRunSelectionChange:c,onRelatedReferenceSelection:l,onUnavailable:u,onClose:r,onDetailsClose:i,onNavigateToLifecycleSource:a}):null;export{r as ActivityView};
|
package/dist/client/assets/{GitHubActionsDialog-GWVxWGPK.js → GitHubActionsDialog-NdYtgMhg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,A as n,D as r,E as i,G as a,I as o,J as s,K as c,O as l,Q as u,R as d,St as f,T as p,U as m,W as h,Z as g,dt as _,ft as v,gt as y,ht as b,k as x,m as S,mt as C,pt as w,q as ee,vt as te,w as T,z as E}from"./index-CSOKbu3w.js";var D=e(f(),1),O=b(),ne=`https://docs.github.com/en/actions`,re=5e3,k=(e,t)=>x.t(`common:githubActions.${e}`,t),A=e=>k(`status.${e}`),j=e=>e?k(`conclusion.${e}`):null,M=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,N=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,P=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},F=e=>e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status),I=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},ie=({workflow:e,inputsState:n,isSelected:r,onSelect:i})=>{let a=e.state===`active`,o=n?.dispatchable??!0,s=a&&o&&!n?.isLoading,c=e.path.split(`/`).pop();return(0,O.jsxs)(`div`,{className:t(`flex flex-col gap-3 rounded-2xl border px-4 py-3 transition-colors`,r?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,O.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,O.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:c}),(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,a?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:k(a?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,O.jsxs)(u,{type:`button`,variant:r?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!s,"aria-label":k(`workflows.runAriaLabel`,{name:e.name}),title:!o&&n?k(`inputs.notDispatchable`):void 0,onClick:i,children:[n?.isLoading?(0,O.jsx)(E,{className:`h-3.5 w-3.5 animate-spin`}):(0,O.jsx)(d,{className:`h-3.5 w-3.5`}),(0,O.jsx)(`span`,{children:k(`actions.run`)})]})]})]})},ae=({workflow:e,inputsState:t,refValue:n,onRefChange:r,values:i,onValueChange:a,isDispatching:o,onDispatch:s,onCancel:c})=>{let f=t.inputs.filter(e=>e.required&&!L(i[e.name],e)),p=t.dispatchable&&!t.isLoading&&!t.error&&n.trim()!==``&&f.length===0&&!o;return(0,O.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`inputs.title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,O.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":k(`actions.cancel`),onClick:c,children:(0,O.jsx)(l,{className:`h-4 w-4`})})]}),(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(m,{htmlFor:`github-actions-ref`,children:k(`inputs.refLabel`)}),(0,O.jsx)(h,{id:`github-actions-ref`,type:`text`,value:n,onChange:e=>{r(e.target.value)},placeholder:k(`inputs.refPlaceholder`),"aria-label":k(`inputs.refAriaLabel`)})]}),t.isLoading&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(E,{className:`h-3.5 w-3.5 animate-spin`}),(0,O.jsx)(`span`,{children:k(`inputs.loading`)})]}),t.error&&(0,O.jsx)(`p`,{className:`text-xs text-rose-200`,children:t.error}),!t.dispatchable&&!t.isLoading&&!t.error&&(0,O.jsx)(`p`,{className:`text-xs text-amber-200`,children:k(`inputs.notDispatchable`)}),t.inputs.map(e=>(0,O.jsx)(R,{input:e,value:i[e.name],onChange:t=>{a(e.name,t)}},e.name)),f.length>0&&(0,O.jsx)(`p`,{className:`text-xs text-rose-200`,children:k(`inputs.requiredValidationError`)}),(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,O.jsx)(u,{type:`button`,variant:`ghost`,onClick:c,disabled:o,children:k(`actions.cancel`)}),(0,O.jsxs)(u,{type:`button`,variant:`success`,onClick:s,disabled:!p,children:[o?(0,O.jsx)(E,{className:`h-4 w-4 animate-spin`}):(0,O.jsx)(d,{className:`h-4 w-4`}),(0,O.jsx)(`span`,{children:k(`actions.dispatch`)})]})]})]})},L=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,R=({input:e,value:t,onChange:n})=>{let r=`github-actions-input-${e.name}`;return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsxs)(m,{htmlFor:r,className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{children:e.name}),e.required&&(0,O.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:k(`inputs.requiredLabel`)})]}),e.description&&(0,O.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),z(e,r,t,n)]})},z=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(S,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:k(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,O.jsxs)(`select`,{id:t,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{r(e.target.value)},children:[a===``&&(0,O.jsx)(`option`,{value:``,children:k(`inputs.selectPlaceholder`)}),i.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))]})}return(0,O.jsx)(h,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},B=({job:e})=>e.steps.length===0?null:(0,O.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(n=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,N(n)),children:n.status===`completed`?j(n.conclusion)??k(`status.completed`):A(n.status)}),(0,O.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:n.name})]},`${e.id}-${n.number}`))}),V=({run:e})=>{let n=P(e),r=F(e);return(0,O.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,M(e)),children:r})]}),(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n&&(0,O.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:n}),e.html_url&&(0,O.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[k(`actions.openOnGithub`),(0,O.jsx)(p,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,O.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,M(e)),children:e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status)}),(0,O.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,O.jsx)(B,{job:e})]},e.id))]})},H=({tracked:e})=>{let n=e.state===`resolving`,r=e.failure?.message??k(`runs.trackingState.${e.state}`);return(0,O.jsxs)(`div`,{className:t(`flex items-start gap-2 rounded-2xl border px-4 py-3`,n?`border-border/60 bg-background/20`:`border-red-400/25 bg-red-500/8`),children:[n&&(0,O.jsx)(E,{className:`mt-0.5 h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`span`,{className:t(`block break-words text-xs`,n?`text-muted-foreground`:`text-red-200`),children:r}),(0,O.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:e.ref??k(`runs.unknownRef`)})]})]})},U=(e,t)=>{let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||(e.updated_at??``)>=(t.updated_at??``))&&n.set(e.id,e)}return[...n.values()]},W=(e,t)=>{let n=new Map(e.map(e=>[e.execution_run_id,e]));for(let e of t){let t=n.get(e.execution_run_id),r=t&&![`queued`,`waiting`,`running`].includes(t.execution_status),i=[`queued`,`waiting`,`running`].includes(e.execution_status);(!r||!i)&&n.set(e.execution_run_id,e)}return[...n.values()]},oe=(e,t,n)=>{let r=t.filter(e=>e.run===null),i=new Set(r.map(e=>e.tracking_key));return W(e.filter(e=>i.has(e.tracking_key)||n.get(e.tracking_key)?.run===null),r.filter(e=>!n.has(e.tracking_key)))},se=e=>({ref:e??`main`}),G=({projectId:e,defaultBranch:t,onClose:d})=>{let[f,m]=(0,D.useState)([]),[h,b]=(0,D.useState)(!0),[x,S]=(0,D.useState)(null),[T,A]=(0,D.useState)([]),[j,M]=(0,D.useState)([]),[N,P]=(0,D.useState)({}),[F,L]=(0,D.useState)(null),[R,z]=(0,D.useState)(!1),[B]=(0,D.useState)(()=>se(t)),W=(0,D.useRef)({}),G=(0,D.useRef)({}),K=(0,D.useRef)(null),q=(0,D.useRef)(!1),J=(0,D.useRef)(0),Y=(0,D.useRef)(new Map),X=(0,D.useCallback)(async t=>{P(e=>{let n=e[t.id];return n?.isLoading?e:{...e,[t.id]:{inputs:n?.inputs??[],dispatchable:n?.dispatchable??!0,isLoading:!0,error:null}}});try{let n=await v(e,t.id,t.path);return P(e=>({...e,[t.id]:{inputs:n.inputs,dispatchable:n.dispatchable,isLoading:!1,error:null}})),n}catch(e){return P(n=>({...n,[t.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof y?e.message:k(`workflows.loadError`)}})),null}},[e]),Z=(0,D.useCallback)(async()=>{b(!0),S(null);try{let t=await C(e);m(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){S(e instanceof y?e.message:k(`workflows.loadError`))}finally{b(!1)}},[X,e]),Q=(0,D.useCallback)(async t=>{if(q.current)return;q.current=!0;let n=J.current;try{let r=await w(e,t);A(e=>U(e,r.runs)),M(e=>{let t=new Map([...Y.current.entries()].filter(([,e])=>e.revision>n).map(([e,t])=>[e,t.event]));return oe(e,r.tracked_runs??[],t)})}catch(e){te(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{q.current=!1}},[e]);(0,D.useEffect)(()=>{Z()},[Z]),(0,D.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,re),i=r(t);return()=>{e.abort(),window.clearInterval(n),i()}},[Q]);let ce=(0,D.useCallback)(async e=>{if(F?.workflow.id===e.id)return;K.current=e.id,L({workflow:e,ref:B.ref,values:{}});let t=N[e.id];if(t&&!t.isLoading&&!t.error){L(n=>!n||n.workflow.id!==e.id?n:{...n,values:I(t.inputs)});return}let n=await X(e);n&&L(t=>!t||t.workflow.id!==e.id?t:{...t,values:I(n.inputs)})},[B.ref,N,X,F]),le=(0,D.useCallback)(async()=>{if(!F)return;let t=N[F.workflow.id];if(!t||!t.dispatchable)return;z(!0);let n={};for(let e of t.inputs){let t=F.values[e.name];e.type===`boolean`?n[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?n[e.name]=t:typeof e.default==`string`&&e.default!==``&&(n[e.name]=e.default)}try{await _(e,F.workflow.id,{ref:F.ref,workflowName:F.workflow.name,workflowUrl:F.workflow.url,inputs:n}),o.success(k(`messages.dispatched`)),L(null),Q()}catch(e){o.error(e instanceof y?e.message:k(`messages.dispatchError`))}finally{z(!1)}},[N,Q,e,F]);(0,D.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(J.current+=1,Y.current.set(t.tracking_key,{revision:J.current,event:t}),M(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&A(e=>U(e,[t.run])))};return i.on(`github-actions:updated`,t),()=>{i.off(`github-actions:updated`,t)}},[e]),(0,D.useEffect)(()=>{let e=F?.workflow.id;!e||K.current!==e||(W.current[e]?.scrollIntoView({block:`nearest`}),G.current[e]?.scrollIntoView({block:`nearest`}),K.current=null)},[F?.workflow.id]);let $=(0,D.useMemo)(()=>[...T].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[T]);return(0,O.jsx)(a,{open:!0,onOpenChange:e=>{e||d()},children:(0,O.jsxs)(ee,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,O.jsx)(g,{className:`sr-only`,children:k(`dialog.srTitle`)}),(0,O.jsx)(s,{className:`sr-only`,children:k(`dialog.srDescription`)}),(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,O.jsx)(n,{className:`h-5 w-5`})}),(0,O.jsx)(`div`,{children:(0,O.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:k(`dialog.title`)})})]}),(0,O.jsx)(c,{asChild:!0,children:(0,O.jsx)(u,{type:`button`,"aria-label":k(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,O.jsx)(l,{className:`h-4 w-4`})})})]}),(0,O.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,O.jsxs)(`aside`,{"aria-label":k(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`workflows.title`)}),(0,O.jsx)(u,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{Z(),Q()},children:k(`actions.refresh`)})]}),h&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(E,{className:`h-3.5 w-3.5 animate-spin`}),(0,O.jsx)(`span`,{children:k(`workflows.loading`)})]}),x&&(0,O.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:x}),!h&&f.length===0&&!x&&(0,O.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,O.jsx)(`p`,{children:k(`workflows.empty`)}),(0,O.jsx)(`p`,{className:`mt-1`,children:k(`workflows.emptyHint`)}),(0,O.jsxs)(`a`,{href:ne,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[k(`workflows.docsLink`),(0,O.jsx)(p,{className:`h-3 w-3`})]})]}),(0,O.jsx)(`div`,{className:`space-y-2`,children:f.map(e=>{let t=F?.workflow.id===e.id;return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(`div`,{ref:t=>{W.current[e.id]=t},children:(0,O.jsx)(ie,{workflow:e,inputsState:N[e.id]??null,isSelected:t,onSelect:()=>{ce(e)}})}),t&&F&&(0,O.jsx)(`div`,{ref:t=>{G.current[e.id]=t},children:(0,O.jsx)(ae,{workflow:e,inputsState:N[e.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:F.ref,onRefChange:e=>{L(t=>t&&{...t,ref:e})},values:F.values,onValueChange:(e,t)=>{L(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:R,onDispatch:()=>{le()},onCancel:()=>{L(null)}})})]},e.id)})})]}),(0,O.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`runs.title`)}),j.map(e=>(0,O.jsx)(H,{tracked:e},e.tracking_key)),$.map(e=>(0,O.jsx)(V,{run:e},e.id)),$.length===0&&j.length===0&&(0,O.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:k(`runs.empty`)})]})]})]})})};export{G as GitHubActionsDialog};
|
|
1
|
+
import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,A as n,D as r,E as i,G as a,I as o,J as s,K as c,O as l,Q as u,R as d,St as f,T as p,U as m,W as h,Z as g,dt as _,ft as v,gt as y,ht as b,k as x,m as S,mt as C,pt as w,q as ee,vt as te,w as T,z as E}from"./index-D_KmViSu.js";var D=e(f(),1),O=b(),ne=`https://docs.github.com/en/actions`,re=5e3,k=(e,t)=>x.t(`common:githubActions.${e}`,t),A=e=>k(`status.${e}`),j=e=>e?k(`conclusion.${e}`):null,M=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,N=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,P=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},F=e=>e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status),I=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},ie=({workflow:e,inputsState:n,isSelected:r,onSelect:i})=>{let a=e.state===`active`,o=n?.dispatchable??!0,s=a&&o&&!n?.isLoading,c=e.path.split(`/`).pop();return(0,O.jsxs)(`div`,{className:t(`flex flex-col gap-3 rounded-2xl border px-4 py-3 transition-colors`,r?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,O.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,O.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:c}),(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,a?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:k(a?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,O.jsxs)(u,{type:`button`,variant:r?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!s,"aria-label":k(`workflows.runAriaLabel`,{name:e.name}),title:!o&&n?k(`inputs.notDispatchable`):void 0,onClick:i,children:[n?.isLoading?(0,O.jsx)(E,{className:`h-3.5 w-3.5 animate-spin`}):(0,O.jsx)(d,{className:`h-3.5 w-3.5`}),(0,O.jsx)(`span`,{children:k(`actions.run`)})]})]})]})},ae=({workflow:e,inputsState:t,refValue:n,onRefChange:r,values:i,onValueChange:a,isDispatching:o,onDispatch:s,onCancel:c})=>{let f=t.inputs.filter(e=>e.required&&!L(i[e.name],e)),p=t.dispatchable&&!t.isLoading&&!t.error&&n.trim()!==``&&f.length===0&&!o;return(0,O.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`inputs.title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,O.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":k(`actions.cancel`),onClick:c,children:(0,O.jsx)(l,{className:`h-4 w-4`})})]}),(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(m,{htmlFor:`github-actions-ref`,children:k(`inputs.refLabel`)}),(0,O.jsx)(h,{id:`github-actions-ref`,type:`text`,value:n,onChange:e=>{r(e.target.value)},placeholder:k(`inputs.refPlaceholder`),"aria-label":k(`inputs.refAriaLabel`)})]}),t.isLoading&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(E,{className:`h-3.5 w-3.5 animate-spin`}),(0,O.jsx)(`span`,{children:k(`inputs.loading`)})]}),t.error&&(0,O.jsx)(`p`,{className:`text-xs text-rose-200`,children:t.error}),!t.dispatchable&&!t.isLoading&&!t.error&&(0,O.jsx)(`p`,{className:`text-xs text-amber-200`,children:k(`inputs.notDispatchable`)}),t.inputs.map(e=>(0,O.jsx)(R,{input:e,value:i[e.name],onChange:t=>{a(e.name,t)}},e.name)),f.length>0&&(0,O.jsx)(`p`,{className:`text-xs text-rose-200`,children:k(`inputs.requiredValidationError`)}),(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,O.jsx)(u,{type:`button`,variant:`ghost`,onClick:c,disabled:o,children:k(`actions.cancel`)}),(0,O.jsxs)(u,{type:`button`,variant:`success`,onClick:s,disabled:!p,children:[o?(0,O.jsx)(E,{className:`h-4 w-4 animate-spin`}):(0,O.jsx)(d,{className:`h-4 w-4`}),(0,O.jsx)(`span`,{children:k(`actions.dispatch`)})]})]})]})},L=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,R=({input:e,value:t,onChange:n})=>{let r=`github-actions-input-${e.name}`;return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsxs)(m,{htmlFor:r,className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{children:e.name}),e.required&&(0,O.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:k(`inputs.requiredLabel`)})]}),e.description&&(0,O.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),z(e,r,t,n)]})},z=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(S,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:k(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,O.jsxs)(`select`,{id:t,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{r(e.target.value)},children:[a===``&&(0,O.jsx)(`option`,{value:``,children:k(`inputs.selectPlaceholder`)}),i.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))]})}return(0,O.jsx)(h,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},B=({job:e})=>e.steps.length===0?null:(0,O.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(n=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,N(n)),children:n.status===`completed`?j(n.conclusion)??k(`status.completed`):A(n.status)}),(0,O.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:n.name})]},`${e.id}-${n.number}`))}),V=({run:e})=>{let n=P(e),r=F(e);return(0,O.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,M(e)),children:r})]}),(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n&&(0,O.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:n}),e.html_url&&(0,O.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[k(`actions.openOnGithub`),(0,O.jsx)(p,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,O.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(T,{variant:`outline`,className:t(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,M(e)),children:e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status)}),(0,O.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,O.jsx)(B,{job:e})]},e.id))]})},H=({tracked:e})=>{let n=e.state===`resolving`,r=e.failure?.message??k(`runs.trackingState.${e.state}`);return(0,O.jsxs)(`div`,{className:t(`flex items-start gap-2 rounded-2xl border px-4 py-3`,n?`border-border/60 bg-background/20`:`border-red-400/25 bg-red-500/8`),children:[n&&(0,O.jsx)(E,{className:`mt-0.5 h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`span`,{className:t(`block break-words text-xs`,n?`text-muted-foreground`:`text-red-200`),children:r}),(0,O.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:e.ref??k(`runs.unknownRef`)})]})]})},U=(e,t)=>{let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||(e.updated_at??``)>=(t.updated_at??``))&&n.set(e.id,e)}return[...n.values()]},W=(e,t)=>{let n=new Map(e.map(e=>[e.execution_run_id,e]));for(let e of t){let t=n.get(e.execution_run_id),r=t&&![`queued`,`waiting`,`running`].includes(t.execution_status),i=[`queued`,`waiting`,`running`].includes(e.execution_status);(!r||!i)&&n.set(e.execution_run_id,e)}return[...n.values()]},oe=(e,t,n)=>{let r=t.filter(e=>e.run===null),i=new Set(r.map(e=>e.tracking_key));return W(e.filter(e=>i.has(e.tracking_key)||n.get(e.tracking_key)?.run===null),r.filter(e=>!n.has(e.tracking_key)))},se=e=>({ref:e??`main`}),G=({projectId:e,defaultBranch:t,onClose:d})=>{let[f,m]=(0,D.useState)([]),[h,b]=(0,D.useState)(!0),[x,S]=(0,D.useState)(null),[T,A]=(0,D.useState)([]),[j,M]=(0,D.useState)([]),[N,P]=(0,D.useState)({}),[F,L]=(0,D.useState)(null),[R,z]=(0,D.useState)(!1),[B]=(0,D.useState)(()=>se(t)),W=(0,D.useRef)({}),G=(0,D.useRef)({}),K=(0,D.useRef)(null),q=(0,D.useRef)(!1),J=(0,D.useRef)(0),Y=(0,D.useRef)(new Map),X=(0,D.useCallback)(async t=>{P(e=>{let n=e[t.id];return n?.isLoading?e:{...e,[t.id]:{inputs:n?.inputs??[],dispatchable:n?.dispatchable??!0,isLoading:!0,error:null}}});try{let n=await v(e,t.id,t.path);return P(e=>({...e,[t.id]:{inputs:n.inputs,dispatchable:n.dispatchable,isLoading:!1,error:null}})),n}catch(e){return P(n=>({...n,[t.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof y?e.message:k(`workflows.loadError`)}})),null}},[e]),Z=(0,D.useCallback)(async()=>{b(!0),S(null);try{let t=await C(e);m(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){S(e instanceof y?e.message:k(`workflows.loadError`))}finally{b(!1)}},[X,e]),Q=(0,D.useCallback)(async t=>{if(q.current)return;q.current=!0;let n=J.current;try{let r=await w(e,t);A(e=>U(e,r.runs)),M(e=>{let t=new Map([...Y.current.entries()].filter(([,e])=>e.revision>n).map(([e,t])=>[e,t.event]));return oe(e,r.tracked_runs??[],t)})}catch(e){te(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{q.current=!1}},[e]);(0,D.useEffect)(()=>{Z()},[Z]),(0,D.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,re),i=r(t);return()=>{e.abort(),window.clearInterval(n),i()}},[Q]);let ce=(0,D.useCallback)(async e=>{if(F?.workflow.id===e.id)return;K.current=e.id,L({workflow:e,ref:B.ref,values:{}});let t=N[e.id];if(t&&!t.isLoading&&!t.error){L(n=>!n||n.workflow.id!==e.id?n:{...n,values:I(t.inputs)});return}let n=await X(e);n&&L(t=>!t||t.workflow.id!==e.id?t:{...t,values:I(n.inputs)})},[B.ref,N,X,F]),le=(0,D.useCallback)(async()=>{if(!F)return;let t=N[F.workflow.id];if(!t||!t.dispatchable)return;z(!0);let n={};for(let e of t.inputs){let t=F.values[e.name];e.type===`boolean`?n[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?n[e.name]=t:typeof e.default==`string`&&e.default!==``&&(n[e.name]=e.default)}try{await _(e,F.workflow.id,{ref:F.ref,workflowName:F.workflow.name,workflowUrl:F.workflow.url,inputs:n}),o.success(k(`messages.dispatched`)),L(null),Q()}catch(e){o.error(e instanceof y?e.message:k(`messages.dispatchError`))}finally{z(!1)}},[N,Q,e,F]);(0,D.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(J.current+=1,Y.current.set(t.tracking_key,{revision:J.current,event:t}),M(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&A(e=>U(e,[t.run])))};return i.on(`github-actions:updated`,t),()=>{i.off(`github-actions:updated`,t)}},[e]),(0,D.useEffect)(()=>{let e=F?.workflow.id;!e||K.current!==e||(W.current[e]?.scrollIntoView({block:`nearest`}),G.current[e]?.scrollIntoView({block:`nearest`}),K.current=null)},[F?.workflow.id]);let $=(0,D.useMemo)(()=>[...T].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[T]);return(0,O.jsx)(a,{open:!0,onOpenChange:e=>{e||d()},children:(0,O.jsxs)(ee,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,O.jsx)(g,{className:`sr-only`,children:k(`dialog.srTitle`)}),(0,O.jsx)(s,{className:`sr-only`,children:k(`dialog.srDescription`)}),(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,O.jsx)(n,{className:`h-5 w-5`})}),(0,O.jsx)(`div`,{children:(0,O.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:k(`dialog.title`)})})]}),(0,O.jsx)(c,{asChild:!0,children:(0,O.jsx)(u,{type:`button`,"aria-label":k(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,O.jsx)(l,{className:`h-4 w-4`})})})]}),(0,O.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,O.jsxs)(`aside`,{"aria-label":k(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`workflows.title`)}),(0,O.jsx)(u,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{Z(),Q()},children:k(`actions.refresh`)})]}),h&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(E,{className:`h-3.5 w-3.5 animate-spin`}),(0,O.jsx)(`span`,{children:k(`workflows.loading`)})]}),x&&(0,O.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:x}),!h&&f.length===0&&!x&&(0,O.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,O.jsx)(`p`,{children:k(`workflows.empty`)}),(0,O.jsx)(`p`,{className:`mt-1`,children:k(`workflows.emptyHint`)}),(0,O.jsxs)(`a`,{href:ne,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[k(`workflows.docsLink`),(0,O.jsx)(p,{className:`h-3 w-3`})]})]}),(0,O.jsx)(`div`,{className:`space-y-2`,children:f.map(e=>{let t=F?.workflow.id===e.id;return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(`div`,{ref:t=>{W.current[e.id]=t},children:(0,O.jsx)(ie,{workflow:e,inputsState:N[e.id]??null,isSelected:t,onSelect:()=>{ce(e)}})}),t&&F&&(0,O.jsx)(`div`,{ref:t=>{G.current[e.id]=t},children:(0,O.jsx)(ae,{workflow:e,inputsState:N[e.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:F.ref,onRefChange:e=>{L(t=>t&&{...t,ref:e})},values:F.values,onValueChange:(e,t)=>{L(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:R,onDispatch:()=>{le()},onCancel:()=>{L(null)}})})]},e.id)})})]}),(0,O.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`runs.title`)}),j.map(e=>(0,O.jsx)(H,{tracked:e},e.tracking_key)),$.map(e=>(0,O.jsx)(V,{run:e},e.id)),$.length===0&&j.length===0&&(0,O.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:k(`runs.empty`)})]})]})]})})};export{G as GitHubActionsDialog};
|
package/dist/client/assets/{VerificationDialog-C4RMuI4y.js → VerificationDialog-BfIKtVjt.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,B as n,C as r,E as i,F as a,G as o,H as s,J as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,St as _,V as v,W as y,X as b,Y as x,Z as ee,_ as S,_t as C,a as te,at as w,b as T,bt as E,c as D,ct as ne,d as O,et as k,f as re,g as ie,gt as A,h as ae,ht as j,i as oe,it as se,j as M,k as ce,l as le,lt as ue,n as de,nt as fe,o as pe,ot as me,p as he,q as ge,rt as _e,s as N,st as ve,t as ye,tt as be,ut as xe,v as P,vt as F,w as I,x as Se,xt as L,y as Ce,yt as we,z as R}from"./index-CSOKbu3w.js";var z=e(_(),1),B=j(),V=e=>{if(!e.file_path)return null;if(!e.start_line)return e.file_path;let t=`${e.start_line}${e.start_column?`:${e.start_column}`:``}`,n=e.end_line?`-${e.end_line}${e.end_column?`:${e.end_column}`:``}`:``;return`${e.file_path}:${t}${n}`},H=[`error`,`warning`,`info`,`unknown`],U=e=>{let t={error:0,warning:0,info:0,unknown:0};return e.forEach(e=>{t[e.severity]+=1}),t},W=({counts:e,totalCount:t})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),r=H.filter(t=>e[t]>0);return(0,B.jsxs)(`div`,{"aria-label":n(`severitySummaryLabel`),className:`mt-3 flex flex-wrap items-center gap-2`,children:[r.map(t=>(0,B.jsx)(`span`,{className:`rounded-full border border-border/70 bg-background/45 px-2 py-1 text-[11px] text-muted-foreground`,children:n(`severityCount`,{count:e[t],severity:n(`severity.${t}`)})},t)),t>0&&t!==r.reduce((t,n)=>t+e[n],0)&&(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`totalAvailable`,{count:t})})]})},G=({attempt:e,parser:t,repair:n,ticketRequired:i,selectedTicketId:a,onSelectedTicketChange:o})=>{let{t:c}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),l=e.currency??`unavailable`;return(0,B.jsxs)(Se,{className:`mt-4 rounded-xl border border-border/60 bg-background/25`,children:[(0,B.jsx)(r,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-label":c(`technicalDetails`),className:`group flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left outline-none transition-colors hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring/60`,children:[(0,B.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:c(`technicalDetails`)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:c(`technicalDetailsHint`)}),(0,B.jsx)(s,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})}),(0,B.jsxs)(g,{className:`border-t border-border/60 px-3 py-3`,children:[(0,B.jsxs)(`dl`,{className:`grid gap-3 text-xs sm:grid-cols-2`,children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`parserLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`parser.${t.parser_kind}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`parserStateLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`state.${t.status}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`parserRetentionLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`retentionState.${t.retention_state}`)})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`outputRetentionLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`retentionState.${e.output_retention_state}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`applicabilityLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`applicability`,{state:c(`applicabilityState.${l}`)})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`sourceLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 break-words text-foreground`,children:e.command_snapshot.name})]}),n&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`destinationTitle`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`destination.${n.destination}`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-muted-foreground`,children:c(`destinationHint`)})]})]}),i&&n&&(0,B.jsxs)(`label`,{className:`mt-3 block text-xs text-muted-foreground`,children:[c(`ticketLabel`),(0,B.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`mt-1 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,B.jsx)(`option`,{value:``,children:c(`ticketPlaceholder`)}),n.candidate_tickets.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]})]})]})},Te=({attempt:e,diagnostics:t,repair:n,selectedDiagnosticIds:r,selectedRawOutputAttemptRunIds:i,selectedAttemptRunIds:a,selectedTicketId:o,pending:s,activeRepair:c,autoFix:l,onSelectedTicketChange:u,onToggleDiagnostic:d,onToggleRawOutput:f,onStartRepair:p,onStopRepair:h})=>{let{t:g}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),{t:_}=L(`common`,{keyPrefix:`checksDialog`});if(e.execution_status!==`failed`)return null;let v=t?.parser??null,y=t?.diagnostics??[],b=U(y),x=!!(l&&!l.terminal_reason),ee=l?.attempts[l.attempts.length-1]??null,S=c?.terminal_result===null||x,C=!!(n?.eligibility.eligible&&n.eligible_attempt_run_ids.includes(e.execution_run_id)&&v?.status===`complete`&&v.retention_state===`retained`),te=!!(n?.eligibility.eligible&&n.eligible_raw_output_attempt_run_ids.includes(e.execution_run_id)&&e.output_retention_state===`retained`&&e.retained_output),w=i.has(e.execution_run_id),T=r.size,E=T>=32,D=a.size>=8&&!a.has(e.execution_run_id),ne=E?g(`diagnosticLimit`,{count:32}):D?g(`attemptLimit`,{count:8}):null,O=!!(n?.accepts_ticket_id&&n.candidate_tickets.length>1),k=T+i.size,re=k>0&&(!O||o!==``),ie=n&&!n.eligibility.eligible?g(`disabled.${n.eligibility.reason}`):null,A=v&&t&&(v.status===`interrupted`||y.length===0&&[`unsupported`,`malformed`].includes(v.status))?v.status:null,ae=!!(v&&t&&y.length===0&&v.status===`complete`&&v.retention_state===`retained`&&v.diagnostic_count===0),j=!!(v&&t&&y.length===0&&v.status===`complete`&&v.retention_state===`retained`&&v.diagnostic_count>0),oe=v?.diagnostic_count??y.length;return(0,B.jsxs)(`section`,{"aria-labelledby":`diagnostics-${e.execution_run_id}`,className:`mt-5 rounded-2xl border border-border/70 bg-background/25 p-4`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{id:`diagnostics-${e.execution_run_id}`,className:`text-sm font-semibold text-foreground`,children:g(`title`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:v&&v.status===`pending`?g(`loading`):v&&oe>0?j||v.retention_state===`expired`?g(`totalAvailable`,{count:oe}):g(`availableCount`,{count:oe}):g(t?`noneAvailable`:`loading`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:g(`failureOutcome`,{outcome:e.outcome?_(`outcomeValue.${e.outcome}`):_(`status.${e.execution_status}`)})}),t&&y.length>0&&(0,B.jsx)(W,{counts:b,totalCount:oe})]})}),v?.retention_state===`expired`&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:g(`expired`)}),v?.truncated&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:g(`truncated`)}),A&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:g(`fallback.${A}`)}),ae&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:g(`noStructuredDiagnostics`)}),j&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:g(`structuredDetailsUnavailable`)}),te&&(0,B.jsxs)(`label`,{className:`mt-4 flex items-start gap-3 rounded-xl border border-amber-400/25 bg-amber-500/5 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,"aria-label":g(`rawOutputSelect`),checked:w,disabled:S||!w&&D,onChange:e=>f(e.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:g(`rawOutputSelect`)}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:g(`rawOutputHint`)}),e.retained_start_offset>0&&(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-amber-200`,children:g(`rawOutputTruncated`)})]})]}),t&&y.length>0&&(0,B.jsxs)(`fieldset`,{className:`mt-4`,children:[(0,B.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:g(`selectLegend`)}),(0,B.jsx)(`ul`,{className:`mt-2 space-y-2`,children:y.map(e=>{let t=V(e),n=r.has(e.id);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-border/60 bg-background/35 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:n,disabled:!C||S||!n&&ne!==null,onChange:t=>d(e.id,t.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:`font-semibold uppercase text-foreground`,children:g(`severity.${e.severity}`)}),e.code&&(0,B.jsx)(`code`,{children:e.code})]}),(0,B.jsx)(`span`,{className:`mt-1 block break-words text-sm text-foreground`,children:e.message}),t&&(0,B.jsx)(`span`,{className:`mt-1 block break-all font-mono text-xs text-muted-foreground`,children:t})]})]})},e.id)})})]}),ie&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:ie}),ne&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:ne}),c&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:g(c.terminal_result?`repairResult.${c.terminal_result}`:`repairRunning`)}),c.terminal_message&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:c.terminal_message})]}),l&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,role:`status`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:l.terminal_reason?g(`autoFix.terminal.${l.terminal_reason}`):ee?.fallback_used?g(`autoFix.phase.fallback`):g(`autoFix.phase.${l.phase}`)}),!l.terminal_reason&&l.attempt_count>0&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:g(`autoFix.attempt`,{current:l.attempt_count,total:l.max_attempts})})]}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:g(`selectedEvidence`,{count:k})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(m,{type:`button`,size:`sm`,disabled:n?.eligibility.eligible!==!0||!re||s||S,title:ie??void 0,onClick:p,children:s?g(`starting`):g(`repairSelectedEvidence`,{count:k})}),S&&(0,B.jsx)(m,{type:`button`,variant:`destructive`,size:`sm`,disabled:s||l?.phase===`stopping`,onClick:h,children:g(x?`autoFix.stop`:`stopRepair`)})]})]}),(0,B.jsx)(G,{attempt:e,parser:v,repair:n,ticketRequired:O,selectedTicketId:o,onSelectedTicketChange:u})]})},K=({attempt:e})=>{let{t}=L(`common`,{keyPrefix:`checksDialog`}),n=e.retained_output?oe(e.retained_output):``;return(0,B.jsxs)(he,{title:t(`rawOutput`),defaultOpen:!0,children:[e.output_retention_state===`expired`&&(0,B.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputExpired`)}),e.output_retention_state===`retained`&&!n&&(0,B.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputEmpty`)}),e.output_retention_state===`retained`&&n&&(0,B.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border bg-[#090b12] p-4 font-mono text-xs text-slate-200`,children:n}),e.retained_start_offset>0&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:t(`outputTruncated`)})]})},q=({definition:e,policy:t})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog`});return(0,B.jsxs)(`article`,{"aria-labelledby":`configured-check-${e.id}`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`configured-check-${e.id}`,className:`text-lg font-semibold text-foreground`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`status.notRun`)})]})}),(0,B.jsx)(`p`,{className:`mt-4 rounded-xl border border-dashed border-border px-3 py-2 text-sm text-muted-foreground`,children:n(`notRunDescription`)}),(0,B.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.cwd??n(`targetRoot`)})]}),t&&(0,B.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`policyLabel`)}),(0,B.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[n(t.required?`required`:`optional`),` · `,n(t.preReview?`preReview`:`finalOnly`)]})]})]})]})},Ee=({attempt:e,batch:t,definition:n,diagnostics:r,repair:i,selectedDiagnosticIds:a,selectedRawOutputAttemptRunIds:o,selectedAttemptRunIds:s,selectedTicketId:c,pending:l,activeRepair:u,autoFix:d,onSelectedTicketChange:f,onToggleDiagnostic:p,onToggleRawOutput:m,onStartRepair:h,onStopRepair:g,policy:_,projectId:v})=>{let{t:y}=L(`common`,{keyPrefix:`checksDialog`}),{t:b}=L(`common`,{keyPrefix:`activityView`}),x=t?O(t,e):null;return e?(0,B.jsxs)(`article`,{"aria-labelledby":`selected-check-${e.execution_run_id}`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`selected-check-${e.execution_run_id}`,className:`text-lg font-semibold text-foreground`,children:e.command_snapshot.name}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:y(`status.${e.execution_status}`)})]}),e.outcome&&(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:y(`outcomeValue.${e.outcome}`)})]}),(0,B.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command_snapshot.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.command_snapshot.cwd??y(`targetRoot`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`outcome`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.outcome?y(`outcomeValue.${e.outcome}`):y(`status.${e.execution_status}`)})]}),e.currency&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`currencyLabel`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:b(`currency.${e.currency}`)})]}),_&&(0,B.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`policyLabel`)}),(0,B.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[y(_.required?`required`:`optional`),` · `,y(_.preReview?`preReview`:`finalOnly`)]})]})]}),x&&(0,B.jsxs)(`div`,{className:`mt-4 space-y-2 rounded-xl border border-border/60 bg-background/30 p-3`,children:[(0,B.jsx)(re,{evidence:x}),(0,B.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:e.placement?y(`environment.attemptPlacementRecorded`,{target:e.placement.targetKey}):y(`environment.attemptPlacementPending`)})]}),(0,B.jsx)(N,{projectId:v,executionRunId:e.execution_run_id}),e.execution_status===`failed`&&(0,B.jsx)(Te,{attempt:e,diagnostics:r,repair:i,selectedDiagnosticIds:a,selectedRawOutputAttemptRunIds:o,selectedAttemptRunIds:s,selectedTicketId:c,pending:l,activeRepair:u,autoFix:d,onSelectedTicketChange:f,onToggleDiagnostic:p,onToggleRawOutput:m,onStartRepair:h,onStopRepair:g}),(0,B.jsx)(K,{attempt:e},e.execution_run_id)]}):n?(0,B.jsx)(q,{definition:n,policy:_}):(0,B.jsxs)(`section`,{"aria-labelledby":`selected-check-heading`,className:`rounded-2xl border border-dashed border-border p-6`,children:[(0,B.jsx)(`h2`,{id:`selected-check-heading`,className:`font-medium text-foreground`,children:y(`selectAttemptTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:y(`selectAttemptDescription`)})]})},J={current:`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`,stale:`border-amber-400/30 bg-amber-500/10 text-amber-200`,failed:`border-red-400/30 bg-red-500/10 text-red-200`,missing:`border-border bg-muted/40 text-muted-foreground`,interrupted:`border-orange-400/30 bg-orange-500/10 text-orange-200`,blocked:`border-amber-400/30 bg-amber-500/10 text-amber-200`},De=(e,t)=>e.presentApplicability.appliesToCurrentState===!1?`stale`:t?t.execution_status===`interrupted`||t.execution_status===`cancelled`?`interrupted`:t.execution_status===`failed`?`failed`:t.currency===`stale`?`stale`:t.outcome&&t.outcome!==`passed`?`failed`:t.outcome===`passed`&&t.currency===`current`?`current`:e.decision===`blocked`?`blocked`:`current`:`missing`,Oe=e=>e===!0?`gateApplicability.overallCurrent`:e===!1?`gateApplicability.overallStale`:`gateApplicability.overallUnverifiable`,ke=({evaluation:e})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog`}),r=e.presentApplicability.appliesToCurrentState===!1?`gateStale`:e.presentApplicability.appliesToCurrentState===null?`gateUnverifiable`:e.decision===`passed`?`gatePassed`:`gateBlocked`,i=e.reasonCodes[0],a=i?n(`gateReasonSummary`,{reason:n(`reason.${i}`)}):e.decision===`passed`?n(`gatePassedSummary`):n(`gateBlockedSummary`);return(0,B.jsxs)(`section`,{"aria-labelledby":`automated-delivery-gate-heading`,className:`mb-5 rounded-2xl border border-border/70 bg-background/30 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`automated-delivery-gate-heading`,className:`font-semibold text-foreground`,children:n(`gateTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:a})]}),(0,B.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-2.5 py-1 text-xs font-medium`,e.decision===`passed`&&e.presentApplicability.appliesToCurrentState===!0?J.current:J.blocked),children:n(r)})]}),(0,B.jsx)(he,{title:n(`gateDetails`),children:(0,B.jsxs)(`div`,{className:`space-y-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{children:n(`gateScope`)}),(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,B.jsx)(`p`,{children:n(`gateBoundary.label`,{boundary:n(`gateBoundary.${e.boundaryKind}`)})}),(0,B.jsx)(`p`,{className:`break-all`,children:n(`gatePolicy`,{fingerprint:e.policy.fingerprint.slice(0,12)})}),(0,B.jsx)(`p`,{children:n(`gatePolicyStatus`,{status:n(e.policy.status===`valid`?`gatePolicyValid`:`gatePolicyInvalid`)})}),(0,B.jsx)(`p`,{className:`break-all`,children:e.sourceBatchRunId?n(`gateSourceBatch`,{batchId:e.sourceBatchRunId}):n(`gateNoBatch`)}),(0,B.jsx)(`p`,{className:`break-words`,children:n(`gateApplicability.label`,{workspace:n(`gateApplicability.${e.presentApplicability.workspace}`),policy:n(`gateApplicability.${e.presentApplicability.policy}`),overall:n(Oe(e.presentApplicability.appliesToCurrentState))})})]}),e.reasonCodes.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-medium text-foreground`,children:n(`gateReasonsTitle`)}),(0,B.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.reasonCodes.map(e=>(0,B.jsx)(`li`,{children:n(`reason.${e}`)},e))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-medium text-foreground`,children:n(`gateEvidenceTitle`)}),(0,B.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.policy.definitions.map(r=>{let i=De(e,e.evaluatedAttempts.find(e=>e.definition_id===r.id));return(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-xl border border-border/60 p-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:r.name}),(0,B.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:r.command})]}),(0,B.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-2 py-1 text-xs`,J[i]),children:n(`evidence.${i}`)})]},r.id)})})]}),e.policy.status===`invalid`&&(0,B.jsx)(`p`,{className:`break-words text-amber-200`,children:e.policy.error})]})})]})},Ae=e=>e.execution_status===`completed`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.execution_status===`failed`||e.execution_status===`interrupted`?`border-red-400/30 bg-red-500/10 text-red-200`:e.execution_status===`running`||e.execution_status===`queued`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border bg-muted/40 text-muted-foreground`,je=e=>e.execution_status===`completed`&&e.outcome&&e.outcome!==`passed`?`outcomeValue.${e.outcome}`:`status.${e.execution_status}`,Me=(e,t,n,r)=>((t?.attempts.find(t=>t.attempt_run_id===e.execution_run_id))?.diagnostics.filter(e=>n.has(e.id)).length??0)+ +!!r.has(e.execution_run_id),Ne=({definitions:e,attempts:n,requiredDefinitionIds:r,preReviewDefinitionIds:i,selectedDefinitionIds:a,selectedCheckId:o,diagnostics:s,selectedDiagnosticIds:c,selectedRawOutputAttemptRunIds:l,onToggleDefinition:u,onSelectCheck:d})=>{let{t:f}=L(`common`,{keyPrefix:`checksDialog`}),p=new Set(r),m=new Set(i),h=new Set(e.map(e=>e.id)),g=[...e.map(e=>({definition:e,attempt:n.find(t=>t.definition_id===e.id),historical:!1})),...n.filter(e=>!h.has(e.definition_id)).map(e=>({definition:e.command_snapshot,attempt:e,historical:!0}))];return(0,B.jsxs)(`section`,{"aria-labelledby":`configured-checks-heading`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`header`,{className:`shrink-0 border-b border-border/60 px-4 py-4 sm:px-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-1`,children:[(0,B.jsx)(`h2`,{id:`configured-checks-heading`,className:`text-sm font-semibold text-foreground`,children:f(`configured`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f(`selectionHint`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border/70 bg-background/35 p-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`font-medium text-foreground`,children:f(`policySummary.title`)}),(0,B.jsx)(`p`,{className:`mt-1`,children:f(`policySummary.counts`,{requiredCount:r.length,preReviewCount:i.length})})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 md:max-h-none md:py-5 max-md:max-h-[min(35vh,18rem)]`,children:(0,B.jsx)(`ul`,{"aria-label":f(`configured`),className:`space-y-2`,children:g.map(({definition:e,attempt:n,historical:r})=>{let i=o===e.id,h=n?Me(n,s,c,l):0,g=p.has(e.id),_=m.has(e.id),v=`${f(`category.${e.category}`)} · ${f(g?`required`:`optional`)} · ${f(_?`preReview`:`finalOnly`)}`;return(0,B.jsx)(`li`,{className:`rounded-xl border border-border/60 bg-background/30 p-2.5`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[!r&&(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 shrink-0 accent-primary`,checked:a.has(e.id),"aria-label":f(`selectForRun`,{name:e.name}),onChange:t=>u(e.id,t.target.checked)}),n?(0,B.jsxs)(`button`,{type:`button`,className:t(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,i&&`bg-accent/60`),"aria-label":f(`inspectAttempt`,{name:e.name,status:f(je(n))}),"aria-pressed":i,"aria-current":i?`true`:void 0,onClick:()=>d(e.id),children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium`,Ae(n)),children:f(je(n))})]}),(0,B.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:v}),h>0&&(0,B.jsx)(`span`,{"data-evidence-selected":`true`,className:`mt-1.5 inline-flex rounded-full border border-amber-400/30 bg-amber-500/10 px-2 py-0.5 text-[11px] text-amber-200`,children:f(`evidenceSelected`,{count:h})})]}):(0,B.jsxs)(`button`,{type:`button`,className:t(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,i&&`bg-accent/60`),"aria-label":f(`inspectAttempt`,{name:e.name,status:f(`status.notRun`)}),"aria-pressed":i,"aria-current":i?`true`:void 0,onClick:()=>d(e.id),children:[(0,B.jsx)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name})}),(0,B.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:v})]})]})},n?.execution_run_id??e.id)})})})]})},Pe=(e,t)=>{let n=new Set(t?.attempts.filter(e=>e.parser.status===`complete`&&e.parser.retention_state===`retained`&&e.diagnostics.length>0).map(e=>e.attempt_run_id)??[]);return e.find(e=>e.execution_status===`failed`&&n.has(e.execution_run_id))??e.find(e=>e.execution_status===`failed`)??e.find(e=>e.execution_status===`running`)??e[0]??null},Fe=new Set([`queued`,`running`,`waiting`]),Ie=75,Le=32,Re=64,ze=3,Be=32,Ve=8,Y=(e,t)=>e instanceof A?e.message:t,He=e=>{let t=new Set(e.repair.eligibility.eligible?e.repair.eligible_attempt_run_ids:[]);return new Set(e.attempts.filter(e=>t.has(e.attempt_run_id)).flatMap(e=>e.diagnostics.map(e=>e.id)))},Ue=e=>new Set(e.repair.eligibility.eligible?e.repair.eligible_raw_output_attempt_run_ids:[]),We=({projectId:e,targetKind:t,targetBundleId:n,definitions:r,requiredDefinitionIds:i=[],preReviewDefinitionIds:a=[],gateEvaluationId:o=null,directBatchRunId:s=null,directAttemptRunId:c=null,onSelectionChange:l,onUnavailable:u,onStatusChange:d})=>{let{t:f}=L(`common`,{keyPrefix:`checksDialog`}),p=le(),[h,g]=(0,z.useState)(()=>new Set(r.map(e=>e.id))),[_,v]=(0,z.useState)(null),[y,b]=(0,z.useState)(null),[x,ee]=(0,z.useState)(null),[S,C]=(0,z.useState)(null),[T,E]=(0,z.useState)(!0),[k,ie]=(0,z.useState)(null),[ae,j]=(0,z.useState)(null),[oe,M]=(0,z.useState)(new Set),[ce,de]=(0,z.useState)(new Set),[he,ge]=(0,z.useState)(``),[N,ye]=(0,z.useState)(null),[P,I]=(0,z.useState)(!1),[Se,Ce]=(0,z.useState)(0),[we,R]=(0,z.useState)(null),V=(0,z.useRef)(_),H=(0,z.useRef)(null),U=(0,z.useRef)(new Set),W=(0,z.useRef)(new Map),G=(0,z.useRef)(0),Te=(0,z.useRef)(0),K=(0,z.useRef)(null),q=(0,z.useRef)(!1),J=(0,z.useRef)(!0),De=(0,z.useRef)(null),Oe=(0,z.useRef)(`automatic`),Ae=(0,z.useRef)(null),je=(0,z.useRef)(async()=>void 0),Me=(0,z.useRef)(async()=>void 0),We=(0,z.useRef)(()=>void 0),Ge=(0,z.useRef)(0),Ke=(0,z.useRef)(ae);V.current=_,Ke.current=ae,J.current=T||k!==null;let X=(0,z.useCallback)((e,t)=>{De.current=e,Oe.current=t,ee(e)},[]),qe=(0,z.useCallback)(e=>{j(e),ye(e.latest_repair?.source_batch_run_id===e.batch_run_id?e.latest_repair:null),M(t=>{let n=He(e);return new Set([...t].filter(e=>n.has(e)))}),de(t=>{let n=Ue(e);return new Set([...t].filter(e=>n.has(e)))}),ge(t=>e.repair.candidate_tickets.some(e=>e.id===t)?t:e.repair.candidate_tickets.length===1&&e.repair.accepts_ticket_id?e.repair.candidate_tickets[0].id:``);let t=V.current;Oe.current===`automatic`&&t?.batch.execution_run_id===e.batch_run_id&&X(Pe(t.attempts,e)?.execution_run_id??null,`automatic`)},[X]),Je=(0,z.useCallback)(e=>{let t=W.current;if(!t.has(e.attempt_run_id)&&t.size>=Le){let e=t.keys().next().value;e&&(t.delete(e),U.current.delete(e))}let n=t.get(e.attempt_run_id)??[];t.set(e.attempt_run_id,[...n.slice(-(Re-1)),e])},[]),Ye=(0,z.useCallback)((e,t,n=`route`)=>{let r=V.current?.batch.execution_run_id===e.batch.execution_run_id?V.current:null,i=!1,a=new Set(e.attempts.map(e=>e.execution_run_id));for(let e of W.current.keys())a.has(e)||(W.current.delete(e),U.current.delete(e));let o=e.attempts.map(e=>{let t=!1,n=r?.attempts.find(t=>t.execution_run_id===e.execution_run_id),a=n&&n.output_revision>e.output_revision?n:e,o=W.current.get(e.execution_run_id)??[];for(let e of[...o].sort((e,t)=>e.revision-t.revision)){let n=pe(te(a),e);if(n.status===`refetch`){t=!0,i=!0;continue}n.status===`applied`&&(a={...a,output_revision:n.snapshot.revision,retained_start_offset:n.snapshot.retainedStartOffset,retained_end_offset:n.snapshot.totalByteCount,total_persisted_bytes:n.snapshot.totalByteCount,retained_output:n.snapshot.retainedText})}return t?U.current.add(e.execution_run_id):(U.current.delete(e.execution_run_id),W.current.delete(e.execution_run_id)),a}),s={...e,attempts:o};K.current=e.batch.execution_run_id,V.current=s,v(s);let c=t?s.attempts.find(e=>e.execution_run_id===t):null,d=De.current,p=Oe.current,m=!!(d&&s.attempts.some(e=>e.execution_run_id===d)),h=Pe(s.attempts,Ke.current?.batch_run_id===s.batch.execution_run_id?Ke.current:null),g=Ae.current,_=!!(g&&g.batchRunId===s.batch.execution_run_id&&g.attemptRunId===t),y=!!(g&&g.previousBatchRunId===s.batch.execution_run_id&&g.previousAttemptRunId===t);if(n===`reset`)X(h?.execution_run_id??null,`automatic`);else if(t)if(c)if(_)X(c.execution_run_id,`manual`);else if(y&&p===`manual`)X(m?d:h?.execution_run_id??null,m?`manual`:`automatic`);else{let e=p!==`external`||d!==c.execution_run_id;X(c.execution_run_id,`external`),e&&l?.(s.batch.execution_run_id,c.execution_run_id)}else _||y?p===`manual`&&m?X(d,`manual`):X(h?.execution_run_id??null,`automatic`):(X(t,`external`),u?.());else n===`preserve`?p===`external`&&d?m?X(d,`external`):(X(d,`external`),u?.()):p===`manual`&&m?X(d,`manual`):X(p===`automatic`&&m?d:h?.execution_run_id??null,`automatic`):p===`manual`&&m?X(d,`manual`):X(h?.execution_run_id??null,`automatic`);i?We.current(e.batch.execution_run_id):Ge.current=0,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie))},[l,u,f,X]),Z=(0,z.useCallback)(async(t,n)=>{let r=++G.current,i=await be(e,t,n);if(r!==G.current||i.batch.execution_run_id!==t||K.current!==null&&K.current!==t){i.batch.execution_run_id!==t&&u?.();return}Ye(i,t===s?c:null)},[c,s,Ye,u,e]);je.current=Z,We.current=(0,z.useCallback)(e=>{if(H.current)return;if(Ge.current>=ze){Ge.current=0,U.current.clear(),W.current.clear();return}let t=Ie*2**Ge.current;H.current=setTimeout(()=>{H.current=null,Ge.current+=1,je.current(e).catch(t=>{R(Y(t,f(`errors.load`))),U.current.size>0&&We.current(e)})},t)},[f]);let Xe=(0,z.useCallback)(async r=>{let i=++G.current,a=await w(e,t,n,r);if(i===G.current){if(a.batch_run_id){K.current=a.batch_run_id,await Z(a.batch_run_id,r);return}!r?.aborted&&i===G.current&&(K.current=null,V.current=null,v(null),X(null,`automatic`))}},[Z,e,n,t,X]),Q=(0,z.useCallback)(async()=>{if(o||s){let e=K.current;e&&await Z(e);return}await Xe()},[s,o,Z,Xe]);Me.current=Q;let Ze=(0,z.useCallback)(e=>{H.current||=setTimeout(()=>{H.current=null,Z(e).catch(e=>R(Y(e,f(`errors.load`))))},Ie)},[Z,f]);(0,z.useEffect)(()=>{let t=new AbortController;return E(!0),R(null),(async()=>{if(s){if(b(null),c){let n=await D(e,c,t.signal);if(n.run.kind!==`check_attempt`||n.details.kind!==`check_attempt`||!n.details.available||!n.details.attempt||n.details.attempt.batch_run_id!==s){u?.();return}}K.current=s,await Z(s,t.signal);return}if(!o){b(null),await Xe(t.signal);return}let n=await _e(e,o,t.signal);if(b(n),n.sourceBatchRunId){K.current=n.sourceBatchRunId,await Z(n.sourceBatchRunId,t.signal);return}K.current=null,V.current=null,v(null),X(null,`automatic`)})().catch(e=>{F(e)||(e instanceof A&&e.status===404&&u?.(),R(Y(e,f(`errors.load`))))}).finally(()=>{t.signal.aborted||(E(!1),J.current=!1,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie)))}),()=>t.abort()},[c,s,o,Z,Xe,u,e,f,X]),(0,z.useEffect)(()=>{let t=_?.batch.execution_run_id;if(!t){Te.current+=1,j(null),M(new Set),de(new Set),ge(``),ye(null);return}Ke.current?.batch_run_id!==t&&(j(null),M(new Set),de(new Set),ge(``),ye(null));let n=++Te.current,r=new AbortController;return fe(e,t,r.signal).then(e=>{n===Te.current&&e.batch_run_id===t&&K.current===t&&qe(e)}).catch(e=>{F(e)||R(Y(e,f(`errors.diagnostics`)))}),()=>r.abort()},[_?.batch.execution_run_id,Se,qe,e,f]),(0,z.useEffect)(()=>{let t=t=>{if(t.project_id!==e)return;let n=K.current;if(n!==null&&t.batch_run_id!==n)return;let r=V.current;if(!r||U.current.has(t.attempt_run_id)){Je(t),r&&U.current.has(t.attempt_run_id)&&We.current(r.batch.execution_run_id);return}let i=r.attempts.findIndex(e=>e.execution_run_id===t.attempt_run_id);if(i<0){Je(t),Ze(r.batch.execution_run_id);return}let a=r.attempts[i],o=pe(te(a),t);if(o.status===`ignored`)return;if(o.status===`refetch`){U.current.add(t.attempt_run_id),Je(t),We.current(r.batch.execution_run_id);return}let s=[...r.attempts];s[i]={...a,output_revision:o.snapshot.revision,retained_start_offset:o.snapshot.retainedStartOffset,retained_end_offset:o.snapshot.totalByteCount,total_persisted_bytes:o.snapshot.totalByteCount,retained_output:o.snapshot.retainedText};let c={...r,attempts:s};V.current=c,v(c)},n=t=>{if(t.project_id&&t.project_id!==e)return;if(J.current){q.current=!0;return}let n=V.current,r=t.execution_run_id??t.id;if(Ce(e=>e+1),N&&r===N.execution_run_id&&N.source_batch_run_id===K.current&&se(e,N.execution_run_id).then(ye).catch(()=>void 0),n&&(r===n.batch.execution_run_id||n.attempts.some(e=>e.execution_run_id===r))){G.current+=1,Ze(n.batch.execution_run_id);return}q.current=!0,!J.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie))},r=()=>{Ce(e=>e+1),Q().catch(e=>R(Y(e,f(`errors.load`))))};return p.on(`check-attempt:output`,t),p.on(`execution-run:updated`,n),p.on(`lifecycle-event:created`,n),p.on(`connect`,r),()=>{p.off(`check-attempt:output`,t),p.off(`execution-run:updated`,n),p.off(`lifecycle-event:created`,n),p.off(`connect`,r)}},[N,Je,e,Q,Ze,p,f]),(0,z.useEffect)(()=>()=>{H.current&&clearTimeout(H.current),U.current.clear(),W.current.clear()},[]);let Qe=(e,t)=>{G.current+=1,K.current=e.batch.execution_run_id,Ye(e,null,t)},$e=async(e,t)=>{G.current+=1,J.current=!0,ie(e),R(null);try{let n=await t();e!==`stop`&&(Ae.current=null),Qe(n,e===`stop`?`preserve`:`reset`),e!==`stop`&&l?.(n.batch.execution_run_id,void 0)}catch(t){R(Y(t,f(`errors.${e}`))),t instanceof A&&t.status===409&&await Q().catch(()=>void 0)}finally{ie(null),J.current=T,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie))}},et=_?Fe.has(_.batch.execution_status):!1,tt=_?et?`running`:_.batch.execution_status===`completed`?`finished`:_.batch.execution_status===`cancelled`||_.batch.execution_status===`interrupted`?`interrupted`:`error`:`inactive`,nt=_?.batch.execution_run_id??null,$=ae?.batch_run_id===nt?ae:null,rt=N?.source_batch_run_id===nt?N:null,it=$?.auto_fix??null,at=!!(it&&!it.terminal_reason),ot=$?He($):new Set,st=$?Ue($):new Set,ct=new Set([...oe].filter(e=>ot.has(e))),lt=new Set([...ce].filter(e=>st.has(e))),ut=[...h],dt=_?.attempts.filter(e=>e.execution_status!==`completed`).length??0,ft=async()=>{let t=[...ct],n=[...lt];if(!(!$||!nt||K.current!==nt||$.repair.eligibility.eligible!==!0||rt?.terminal_result===null||it&&!it.terminal_reason||t.length===0&&n.length===0)){I(!0),R(null);try{let r=await ne(e,t,n,$.repair.accepts_ticket_id?$.repair.candidate_tickets.some(e=>e.id===he)?he:$.repair.candidate_tickets[0]?.id||null:null);ye(r.source_batch_run_id===nt?r:null)}catch(t){if(R(Y(t,f(`errors.repair`))),t instanceof A&&t.status===409&&_){let t=_.batch.execution_run_id,n=++Te.current;fe(e,t).then(e=>{n===Te.current&&e.batch_run_id===t&&K.current===t&&qe(e)}).catch(()=>void 0)}}finally{I(!1)}}},pt=async()=>{let t=it&&!it.terminal_reason?it.execution_run_id:rt?.execution_run_id;if(t){I(!0),R(null);try{let n=await xe(e,t);`source_batch_run_id`in n&&ye(n),Ce(e=>e+1)}catch(e){R(Y(e,f(`errors.repairStop`)))}finally{I(!1)}}},mt=new Set([...$?.attempts.filter(e=>e.diagnostics.some(e=>ct.has(e.id))).map(e=>e.attempt_run_id)??[],...lt]),ht=(e,t,n)=>{M(r=>{let i=new Set(r);if(!n)return i.delete(t),i;if(i.size>=Be||!$||!ot.has(t))return r;let a=new Set($.attempts.filter(e=>e.diagnostics.some(e=>i.has(e.id))).map(e=>e.attempt_run_id)??[]);return!a.has(e)&&a.size>=Ve?r:(i.add(t),i)})},gt=(e,t)=>{de(n=>{let r=new Set(n);return t?!mt.has(e)&&mt.size>=Ve||!st.has(e)?n:(r.add(e),r):(r.delete(e),r)})},_t=(e,t)=>{g(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},vt=e=>{_&&(C(null),Ae.current={batchRunId:_.batch.execution_run_id,attemptRunId:e,previousBatchRunId:s===_.batch.execution_run_id?s:null,previousAttemptRunId:s===_.batch.execution_run_id?c:null},X(e,`manual`),l?.(_.batch.execution_run_id,e))},yt=e=>{let t=_?.attempts.find(t=>t.definition_id===e);if(t){vt(t.execution_run_id);return}C(e)},bt=S?_?.attempts.find(e=>e.definition_id===S)??null:_?.attempts.find(e=>e.execution_run_id===x)??null,xt=bt?.command_snapshot??r.find(e=>e.id===S)??null,St=S??bt?.definition_id??null,Ct=xt?{required:i.includes(xt.id),preReview:a.includes(xt.id)}:null,wt=_?O(_.batch):null,Tt=_?_.batch.running_count+_.batch.queued_count:0;return(0,z.useEffect)(()=>{d?.(tt)},[tt,d]),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[we&&(0,B.jsx)(`p`,{role:`alert`,className:`mx-4 mt-3 rounded-xl border border-red-400/25 bg-red-500/10 px-3 py-2 text-sm text-red-200 sm:mx-6`,children:we}),(0,B.jsxs)(`div`,{role:`toolbar`,"aria-label":f(`runActions`),className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-y border-border/70 bg-background/30 px-4 py-3 sm:px-6`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:f(`runActions`)})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(m,{type:`button`,size:`sm`,disabled:ut.length===0||et||at||k!==null,onClick:()=>void $e(`run`,()=>ve(e,{targetKind:t,targetBundleId:n,definitionIds:ut})),children:f(k===`run`?`starting`:`runSelected`)}),_&&et&&(0,B.jsx)(m,{type:`button`,variant:`destructive`,size:`sm`,disabled:k!==null||P,onClick:()=>void(at?pt():$e(`stop`,()=>ue(e,_.batch.execution_run_id))),children:f(k===`stop`||P?`stopping`:`stop`)}),_&&!et&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(m,{type:`button`,variant:`outline`,size:`xs`,disabled:at||k!==null,onClick:()=>void $e(`rerun`,()=>me(e,_.batch.execution_run_id,{mode:`all`})),children:f(`rerunAll`)}),(0,B.jsx)(m,{type:`button`,variant:`outline`,size:`xs`,disabled:at||k!==null||dt===0,onClick:()=>void $e(`rerun`,()=>me(e,_.batch.execution_run_id,{mode:`failed_only`})),children:f(`rerunFailed`)})]})]})]}),(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,auto)_minmax(0,1fr)] overflow-hidden md:grid-cols-[19rem_minmax(0,1fr)] md:grid-rows-1`,children:[(0,B.jsx)(`aside`,{className:`flex min-h-0 flex-col border-b border-border/70 md:border-r md:border-b-0`,children:(0,B.jsx)(Ne,{definitions:r,attempts:_?.attempts??[],requiredDefinitionIds:i,preReviewDefinitionIds:a,selectedDefinitionIds:h,selectedCheckId:St,diagnostics:$,selectedDiagnosticIds:ct,selectedRawOutputAttemptRunIds:lt,onToggleDefinition:_t,onSelectCheck:yt})}),(0,B.jsxs)(`main`,{className:`min-h-0 overflow-y-auto p-4 sm:p-6`,children:[o&&!y&&T&&(0,B.jsx)(`p`,{role:`status`,className:`mb-4 text-sm text-muted-foreground`,children:f(`gateLoading`)}),y&&(0,B.jsx)(ke,{evaluation:y}),T&&(0,B.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:f(`loading`)}),!T&&!_&&!xt&&(0,B.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border p-6 text-center`,children:[(0,B.jsx)(`h2`,{className:`font-medium text-foreground`,children:f(`emptyTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:f(`emptyDescription`)})]}),_&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:f(`status.${_.batch.execution_status}`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f(`summary`,{passed:_.batch.passed_count,failed:_.batch.failed_count,running:_.batch.running_count,queued:_.batch.queued_count})}),_.batch.stop_requested&&(0,B.jsx)(`span`,{className:`text-xs text-amber-200`,children:f(`stopRequested`)}),wt&&(0,B.jsx)(re,{evidence:wt})]}),wt?.provider===`docker_sandbox`&&et&&(0,B.jsxs)(`p`,{className:`mb-4 max-w-3xl text-xs text-amber-100`,children:[f(`environment.batchOwnership`,{count:Tt}),` `,f(`environment.wholeSandboxStop`)]})]}),(_||xt)&&(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(Ee,{projectId:e,attempt:bt,batch:_?.batch??null,definition:xt,diagnostics:$?.attempts.find(e=>e.attempt_run_id===bt?.execution_run_id)??null,repair:$?.repair??null,selectedDiagnosticIds:ct,selectedRawOutputAttemptRunIds:lt,selectedAttemptRunIds:mt,selectedTicketId:he,pending:P,activeRepair:rt,autoFix:it,policy:Ct,onSelectedTicketChange:ge,onToggleDiagnostic:(e,t)=>bt&&ht(bt.execution_run_id,e,t),onToggleRawOutput:e=>bt&>(bt.execution_run_id,e),onStartRepair:()=>void ft(),onStopRepair:()=>void pt()})})]})]})]})},Ge=(e,t)=>E(C(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),Ke=(e,t)=>E(C(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),X=(e,t={})=>E(C(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),qe=(e,t)=>E(C(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),Je=e=>E(C(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),Ye=e=>we(C(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),Z=256*1024,Xe=24,Q=(e,t)=>ce.t(`common:testsDialog.${e}`,t),Ze=(e,t)=>{let n=`${e}${t}`;return n.length<=Z?n:n.slice(-Z)},Qe=(e,t)=>e?e.run_id&&t.run_id&&e.run_id!==t.run_id?e.status===`running`||t.status!==`running`?e:t:e.status!==`idle`&&e.status!==`running`&&t.status===`running`?e:e.run_id===t.run_id&&e.output.length>t.output.length?{...t,output:e.output,output_truncated:e.output_truncated||t.output_truncated}:t:t,$e=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=Xe,et=e=>{e.scrollTop=e.scrollHeight},tt=(e,t=!1)=>{et(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{et(e),t&&(r=window.requestAnimationFrame(()=>{et(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},nt=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,$=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},rt=e=>{let t=e.split(`/`);return t[t.length-1]||e},it=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),at=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),ot=(e,t)=>{let n=it(t);return n.length===0?e:e.flatMap(e=>{let t=rt(e.path);if(at(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>at(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},st=e=>Q(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ct=e=>e?.selection?e.selection.kind===`all`?Q(`selection.allTests`):e.selection.kind===`case`?e.selection.name:rt(e.selection.path):Q(`selection.noRunYet`),lt=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,ut=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,dt=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ft=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,pt=({line:e,tone:n})=>(0,B.jsx)(`div`,{"data-tone":n,className:t(`whitespace-pre-wrap break-words`,ut(n)),children:e===``?` `:e}),mt=(0,z.memo)(({canRunGranular:e,filePath:n,isActive:r,name:i,onRunCase:a})=>(0,B.jsxs)(`button`,{type:`button`,"aria-label":Q(`caseRow.runAriaLabel`,{name:i}),title:i,className:t(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,r&&`bg-sky-500/10`),disabled:!e,onClick:()=>{a(n,i)},children:[(0,B.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,B.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:i})]}));mt.displayName=`TestCaseRow`;var ht=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:i,activeSelectionPath:a,canRunGranular:o,file:c,isExpanded:l,onRunCase:u,onRunFile:d,onToggleFile:f})=>{let p=e===`file`&&a===c.path,h=e===`case`&&a===c.path;return(0,B.jsx)(Se,{open:l,onOpenChange:e=>{f(c.path,e)},children:(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(r,{asChild:!0,children:(0,B.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":Q(l?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:c.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,B.jsx)(s,{className:t(`h-4 w-4 transition-transform`,l&&`rotate-180`)})})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":Q(`fileRow.runAriaLabel`,{path:c.path}),className:t(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,o?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(p||h)&&`border-sky-400/45 bg-sky-500/10`),disabled:!o,onClick:()=>{d(c.path)},children:(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,B.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,B.jsx)(n,{className:`h-3.5 w-3.5`})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:rt(c.path)}),(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:c.path})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:Q(`fileRow.testCount`,{count:c.cases.length})})]})]})})]}),(0,B.jsx)(g,{children:(0,B.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:c.cases.length===0?(0,B.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:Q(`fileRow.noNamedTests`)}):(0,B.jsx)(`div`,{className:`space-y-1`,children:c.cases.map(t=>{let n=e===`case`&&a===c.path&&i===t.name;return(0,B.jsx)(mt,{canRunGranular:o,filePath:c.path,isActive:n,name:t.name,onRunCase:u},t.id)})})})})]})})});ht.displayName=`DiscoveryFileRow`;var gt=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:n,activeSelectionPath:r,availableCommands:i,canRunGranular:o,discovery:c,expandedFiles:l,fullSuiteOnlyNotice:h,isLoading:g,selectedCommandId:_,selectedCommandName:v,sessionError:b,sessionStatus:x,shouldShowCommandSelector:ee,onRunCase:S,onRunFile:C,onSelectCommand:te,onToggleFile:w})=>{let[T,E]=(0,z.useState)(``),D=(0,z.useMemo)(()=>ot(c,T),[c,T]),ne=(0,z.useMemo)(()=>D.reduce((e,t)=>e+t.cases.length,0),[D]),O=it(T).length>0;return(0,B.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[ee&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:Q(`scope.label`)}),(0,B.jsxs)(u,{children:[(0,B.jsx)(a,{asChild:!0,children:(0,B.jsxs)(m,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":Q(`scope.selectedCommandAriaLabel`),disabled:i.length===0||x===`running`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:v??Q(`scope.selectTestScope`)}),(0,B.jsx)(s,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,B.jsx)(d,{align:`start`,className:`w-72`,children:i.map(e=>(0,B.jsx)(p,{className:t(_===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{te(e.id)},children:(0,B.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),h&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:h}),(c.length>0||T.length>0)&&(0,B.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,B.jsx)(y,{type:`search`,value:T,onChange:e=>{E(e.target.value)},placeholder:Q(`filter.placeholder`),"aria-label":Q(`filter.ariaLabel`),className:`pr-10`}),T.length>0&&(0,B.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Q(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{E(``)},children:(0,B.jsx)(f,{className:`size-4`})})]}),!i.length&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:Q(`discovery.noCommands`)}),b&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:b}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[Q(`discovery.fileCount`,{count:D.length}),`, `,Q(`discovery.caseCount`,{count:ne})]})}),g&&(0,B.jsx)(R,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:c.length===0&&!g?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:Q(`discovery.noFilesDetected`)}):D.length===0?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:Q(`discovery.noFilterMatches`)}):D.map(t=>(0,B.jsx)(ht,{activeSelectionKind:e,activeSelectionName:n,activeSelectionPath:r,canRunGranular:o,file:t,isExpanded:O||(l[t.path]??!1),onRunCase:S,onRunFile:C,onToggleFile:w},t.path))})]})]})})});gt.displayName=`DiscoveryPane`;var _t=(0,z.memo)(({durationMs:e,output:n,outputTruncated:r,selectionLabel:i,status:a,summaryCounts:o,viewportRef:s,onScroll:c})=>{let l=(0,z.useMemo)(()=>n?oe(n).replace(/\r\n/g,`
|
|
1
|
+
import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,B as n,C as r,E as i,F as a,G as o,H as s,J as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,St as _,V as v,W as y,X as b,Y as x,Z as ee,_ as S,_t as C,a as te,at as w,b as T,bt as E,c as D,ct as ne,d as O,et as k,f as re,g as ie,gt as A,h as ae,ht as j,i as oe,it as se,j as M,k as ce,l as le,lt as ue,n as de,nt as fe,o as pe,ot as me,p as he,q as ge,rt as _e,s as N,st as ve,t as ye,tt as be,ut as xe,v as P,vt as F,w as I,x as Se,xt as L,y as Ce,yt as we,z as R}from"./index-D_KmViSu.js";var z=e(_(),1),B=j(),V=e=>{if(!e.file_path)return null;if(!e.start_line)return e.file_path;let t=`${e.start_line}${e.start_column?`:${e.start_column}`:``}`,n=e.end_line?`-${e.end_line}${e.end_column?`:${e.end_column}`:``}`:``;return`${e.file_path}:${t}${n}`},H=[`error`,`warning`,`info`,`unknown`],U=e=>{let t={error:0,warning:0,info:0,unknown:0};return e.forEach(e=>{t[e.severity]+=1}),t},W=({counts:e,totalCount:t})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),r=H.filter(t=>e[t]>0);return(0,B.jsxs)(`div`,{"aria-label":n(`severitySummaryLabel`),className:`mt-3 flex flex-wrap items-center gap-2`,children:[r.map(t=>(0,B.jsx)(`span`,{className:`rounded-full border border-border/70 bg-background/45 px-2 py-1 text-[11px] text-muted-foreground`,children:n(`severityCount`,{count:e[t],severity:n(`severity.${t}`)})},t)),t>0&&t!==r.reduce((t,n)=>t+e[n],0)&&(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`totalAvailable`,{count:t})})]})},G=({attempt:e,parser:t,repair:n,ticketRequired:i,selectedTicketId:a,onSelectedTicketChange:o})=>{let{t:c}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),l=e.currency??`unavailable`;return(0,B.jsxs)(Se,{className:`mt-4 rounded-xl border border-border/60 bg-background/25`,children:[(0,B.jsx)(r,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-label":c(`technicalDetails`),className:`group flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left outline-none transition-colors hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring/60`,children:[(0,B.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:c(`technicalDetails`)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:c(`technicalDetailsHint`)}),(0,B.jsx)(s,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})}),(0,B.jsxs)(g,{className:`border-t border-border/60 px-3 py-3`,children:[(0,B.jsxs)(`dl`,{className:`grid gap-3 text-xs sm:grid-cols-2`,children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`parserLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`parser.${t.parser_kind}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`parserStateLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`state.${t.status}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`parserRetentionLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`retentionState.${t.retention_state}`)})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`outputRetentionLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`retentionState.${e.output_retention_state}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`applicabilityLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`applicability`,{state:c(`applicabilityState.${l}`)})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`sourceLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 break-words text-foreground`,children:e.command_snapshot.name})]}),n&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:c(`destinationTitle`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:c(`destination.${n.destination}`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-muted-foreground`,children:c(`destinationHint`)})]})]}),i&&n&&(0,B.jsxs)(`label`,{className:`mt-3 block text-xs text-muted-foreground`,children:[c(`ticketLabel`),(0,B.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`mt-1 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,B.jsx)(`option`,{value:``,children:c(`ticketPlaceholder`)}),n.candidate_tickets.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]})]})]})},Te=({attempt:e,diagnostics:t,repair:n,selectedDiagnosticIds:r,selectedRawOutputAttemptRunIds:i,selectedAttemptRunIds:a,selectedTicketId:o,pending:s,activeRepair:c,autoFix:l,onSelectedTicketChange:u,onToggleDiagnostic:d,onToggleRawOutput:f,onStartRepair:p,onStopRepair:h})=>{let{t:g}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),{t:_}=L(`common`,{keyPrefix:`checksDialog`});if(e.execution_status!==`failed`)return null;let v=t?.parser??null,y=t?.diagnostics??[],b=U(y),x=!!(l&&!l.terminal_reason),ee=l?.attempts[l.attempts.length-1]??null,S=c?.terminal_result===null||x,C=!!(n?.eligibility.eligible&&n.eligible_attempt_run_ids.includes(e.execution_run_id)&&v?.status===`complete`&&v.retention_state===`retained`),te=!!(n?.eligibility.eligible&&n.eligible_raw_output_attempt_run_ids.includes(e.execution_run_id)&&e.output_retention_state===`retained`&&e.retained_output),w=i.has(e.execution_run_id),T=r.size,E=T>=32,D=a.size>=8&&!a.has(e.execution_run_id),ne=E?g(`diagnosticLimit`,{count:32}):D?g(`attemptLimit`,{count:8}):null,O=!!(n?.accepts_ticket_id&&n.candidate_tickets.length>1),k=T+i.size,re=k>0&&(!O||o!==``),ie=n&&!n.eligibility.eligible?g(`disabled.${n.eligibility.reason}`):null,A=v&&t&&(v.status===`interrupted`||y.length===0&&[`unsupported`,`malformed`].includes(v.status))?v.status:null,ae=!!(v&&t&&y.length===0&&v.status===`complete`&&v.retention_state===`retained`&&v.diagnostic_count===0),j=!!(v&&t&&y.length===0&&v.status===`complete`&&v.retention_state===`retained`&&v.diagnostic_count>0),oe=v?.diagnostic_count??y.length;return(0,B.jsxs)(`section`,{"aria-labelledby":`diagnostics-${e.execution_run_id}`,className:`mt-5 rounded-2xl border border-border/70 bg-background/25 p-4`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{id:`diagnostics-${e.execution_run_id}`,className:`text-sm font-semibold text-foreground`,children:g(`title`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:v&&v.status===`pending`?g(`loading`):v&&oe>0?j||v.retention_state===`expired`?g(`totalAvailable`,{count:oe}):g(`availableCount`,{count:oe}):g(t?`noneAvailable`:`loading`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:g(`failureOutcome`,{outcome:e.outcome?_(`outcomeValue.${e.outcome}`):_(`status.${e.execution_status}`)})}),t&&y.length>0&&(0,B.jsx)(W,{counts:b,totalCount:oe})]})}),v?.retention_state===`expired`&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:g(`expired`)}),v?.truncated&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:g(`truncated`)}),A&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:g(`fallback.${A}`)}),ae&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:g(`noStructuredDiagnostics`)}),j&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:g(`structuredDetailsUnavailable`)}),te&&(0,B.jsxs)(`label`,{className:`mt-4 flex items-start gap-3 rounded-xl border border-amber-400/25 bg-amber-500/5 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,"aria-label":g(`rawOutputSelect`),checked:w,disabled:S||!w&&D,onChange:e=>f(e.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:g(`rawOutputSelect`)}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:g(`rawOutputHint`)}),e.retained_start_offset>0&&(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-amber-200`,children:g(`rawOutputTruncated`)})]})]}),t&&y.length>0&&(0,B.jsxs)(`fieldset`,{className:`mt-4`,children:[(0,B.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:g(`selectLegend`)}),(0,B.jsx)(`ul`,{className:`mt-2 space-y-2`,children:y.map(e=>{let t=V(e),n=r.has(e.id);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-border/60 bg-background/35 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:n,disabled:!C||S||!n&&ne!==null,onChange:t=>d(e.id,t.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:`font-semibold uppercase text-foreground`,children:g(`severity.${e.severity}`)}),e.code&&(0,B.jsx)(`code`,{children:e.code})]}),(0,B.jsx)(`span`,{className:`mt-1 block break-words text-sm text-foreground`,children:e.message}),t&&(0,B.jsx)(`span`,{className:`mt-1 block break-all font-mono text-xs text-muted-foreground`,children:t})]})]})},e.id)})})]}),ie&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:ie}),ne&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:ne}),c&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:g(c.terminal_result?`repairResult.${c.terminal_result}`:`repairRunning`)}),c.terminal_message&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:c.terminal_message})]}),l&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,role:`status`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:l.terminal_reason?g(`autoFix.terminal.${l.terminal_reason}`):ee?.fallback_used?g(`autoFix.phase.fallback`):g(`autoFix.phase.${l.phase}`)}),!l.terminal_reason&&l.attempt_count>0&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:g(`autoFix.attempt`,{current:l.attempt_count,total:l.max_attempts})})]}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:g(`selectedEvidence`,{count:k})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(m,{type:`button`,size:`sm`,disabled:n?.eligibility.eligible!==!0||!re||s||S,title:ie??void 0,onClick:p,children:s?g(`starting`):g(`repairSelectedEvidence`,{count:k})}),S&&(0,B.jsx)(m,{type:`button`,variant:`destructive`,size:`sm`,disabled:s||l?.phase===`stopping`,onClick:h,children:g(x?`autoFix.stop`:`stopRepair`)})]})]}),(0,B.jsx)(G,{attempt:e,parser:v,repair:n,ticketRequired:O,selectedTicketId:o,onSelectedTicketChange:u})]})},K=({attempt:e})=>{let{t}=L(`common`,{keyPrefix:`checksDialog`}),n=e.retained_output?oe(e.retained_output):``;return(0,B.jsxs)(he,{title:t(`rawOutput`),defaultOpen:!0,children:[e.output_retention_state===`expired`&&(0,B.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputExpired`)}),e.output_retention_state===`retained`&&!n&&(0,B.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputEmpty`)}),e.output_retention_state===`retained`&&n&&(0,B.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border bg-[#090b12] p-4 font-mono text-xs text-slate-200`,children:n}),e.retained_start_offset>0&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:t(`outputTruncated`)})]})},q=({definition:e,policy:t})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog`});return(0,B.jsxs)(`article`,{"aria-labelledby":`configured-check-${e.id}`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`configured-check-${e.id}`,className:`text-lg font-semibold text-foreground`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`status.notRun`)})]})}),(0,B.jsx)(`p`,{className:`mt-4 rounded-xl border border-dashed border-border px-3 py-2 text-sm text-muted-foreground`,children:n(`notRunDescription`)}),(0,B.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.cwd??n(`targetRoot`)})]}),t&&(0,B.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`policyLabel`)}),(0,B.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[n(t.required?`required`:`optional`),` · `,n(t.preReview?`preReview`:`finalOnly`)]})]})]})]})},Ee=({attempt:e,batch:t,definition:n,diagnostics:r,repair:i,selectedDiagnosticIds:a,selectedRawOutputAttemptRunIds:o,selectedAttemptRunIds:s,selectedTicketId:c,pending:l,activeRepair:u,autoFix:d,onSelectedTicketChange:f,onToggleDiagnostic:p,onToggleRawOutput:m,onStartRepair:h,onStopRepair:g,policy:_,projectId:v})=>{let{t:y}=L(`common`,{keyPrefix:`checksDialog`}),{t:b}=L(`common`,{keyPrefix:`activityView`}),x=t?O(t,e):null;return e?(0,B.jsxs)(`article`,{"aria-labelledby":`selected-check-${e.execution_run_id}`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`selected-check-${e.execution_run_id}`,className:`text-lg font-semibold text-foreground`,children:e.command_snapshot.name}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:y(`status.${e.execution_status}`)})]}),e.outcome&&(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:y(`outcomeValue.${e.outcome}`)})]}),(0,B.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command_snapshot.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.command_snapshot.cwd??y(`targetRoot`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`outcome`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.outcome?y(`outcomeValue.${e.outcome}`):y(`status.${e.execution_status}`)})]}),e.currency&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`currencyLabel`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:b(`currency.${e.currency}`)})]}),_&&(0,B.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:y(`policyLabel`)}),(0,B.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[y(_.required?`required`:`optional`),` · `,y(_.preReview?`preReview`:`finalOnly`)]})]})]}),x&&(0,B.jsxs)(`div`,{className:`mt-4 space-y-2 rounded-xl border border-border/60 bg-background/30 p-3`,children:[(0,B.jsx)(re,{evidence:x}),(0,B.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:e.placement?y(`environment.attemptPlacementRecorded`,{target:e.placement.targetKey}):y(`environment.attemptPlacementPending`)})]}),(0,B.jsx)(N,{projectId:v,executionRunId:e.execution_run_id}),e.execution_status===`failed`&&(0,B.jsx)(Te,{attempt:e,diagnostics:r,repair:i,selectedDiagnosticIds:a,selectedRawOutputAttemptRunIds:o,selectedAttemptRunIds:s,selectedTicketId:c,pending:l,activeRepair:u,autoFix:d,onSelectedTicketChange:f,onToggleDiagnostic:p,onToggleRawOutput:m,onStartRepair:h,onStopRepair:g}),(0,B.jsx)(K,{attempt:e},e.execution_run_id)]}):n?(0,B.jsx)(q,{definition:n,policy:_}):(0,B.jsxs)(`section`,{"aria-labelledby":`selected-check-heading`,className:`rounded-2xl border border-dashed border-border p-6`,children:[(0,B.jsx)(`h2`,{id:`selected-check-heading`,className:`font-medium text-foreground`,children:y(`selectAttemptTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:y(`selectAttemptDescription`)})]})},J={current:`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`,stale:`border-amber-400/30 bg-amber-500/10 text-amber-200`,failed:`border-red-400/30 bg-red-500/10 text-red-200`,missing:`border-border bg-muted/40 text-muted-foreground`,interrupted:`border-orange-400/30 bg-orange-500/10 text-orange-200`,blocked:`border-amber-400/30 bg-amber-500/10 text-amber-200`},De=(e,t)=>e.presentApplicability.appliesToCurrentState===!1?`stale`:t?t.execution_status===`interrupted`||t.execution_status===`cancelled`?`interrupted`:t.execution_status===`failed`?`failed`:t.currency===`stale`?`stale`:t.outcome&&t.outcome!==`passed`?`failed`:t.outcome===`passed`&&t.currency===`current`?`current`:e.decision===`blocked`?`blocked`:`current`:`missing`,Oe=e=>e===!0?`gateApplicability.overallCurrent`:e===!1?`gateApplicability.overallStale`:`gateApplicability.overallUnverifiable`,ke=({evaluation:e})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog`}),r=e.presentApplicability.appliesToCurrentState===!1?`gateStale`:e.presentApplicability.appliesToCurrentState===null?`gateUnverifiable`:e.decision===`passed`?`gatePassed`:`gateBlocked`,i=e.reasonCodes[0],a=i?n(`gateReasonSummary`,{reason:n(`reason.${i}`)}):e.decision===`passed`?n(`gatePassedSummary`):n(`gateBlockedSummary`);return(0,B.jsxs)(`section`,{"aria-labelledby":`automated-delivery-gate-heading`,className:`mb-5 rounded-2xl border border-border/70 bg-background/30 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`automated-delivery-gate-heading`,className:`font-semibold text-foreground`,children:n(`gateTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:a})]}),(0,B.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-2.5 py-1 text-xs font-medium`,e.decision===`passed`&&e.presentApplicability.appliesToCurrentState===!0?J.current:J.blocked),children:n(r)})]}),(0,B.jsx)(he,{title:n(`gateDetails`),children:(0,B.jsxs)(`div`,{className:`space-y-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{children:n(`gateScope`)}),(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,B.jsx)(`p`,{children:n(`gateBoundary.label`,{boundary:n(`gateBoundary.${e.boundaryKind}`)})}),(0,B.jsx)(`p`,{className:`break-all`,children:n(`gatePolicy`,{fingerprint:e.policy.fingerprint.slice(0,12)})}),(0,B.jsx)(`p`,{children:n(`gatePolicyStatus`,{status:n(e.policy.status===`valid`?`gatePolicyValid`:`gatePolicyInvalid`)})}),(0,B.jsx)(`p`,{className:`break-all`,children:e.sourceBatchRunId?n(`gateSourceBatch`,{batchId:e.sourceBatchRunId}):n(`gateNoBatch`)}),(0,B.jsx)(`p`,{className:`break-words`,children:n(`gateApplicability.label`,{workspace:n(`gateApplicability.${e.presentApplicability.workspace}`),policy:n(`gateApplicability.${e.presentApplicability.policy}`),overall:n(Oe(e.presentApplicability.appliesToCurrentState))})})]}),e.reasonCodes.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-medium text-foreground`,children:n(`gateReasonsTitle`)}),(0,B.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.reasonCodes.map(e=>(0,B.jsx)(`li`,{children:n(`reason.${e}`)},e))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-medium text-foreground`,children:n(`gateEvidenceTitle`)}),(0,B.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.policy.definitions.map(r=>{let i=De(e,e.evaluatedAttempts.find(e=>e.definition_id===r.id));return(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-xl border border-border/60 p-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:r.name}),(0,B.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:r.command})]}),(0,B.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-2 py-1 text-xs`,J[i]),children:n(`evidence.${i}`)})]},r.id)})})]}),e.policy.status===`invalid`&&(0,B.jsx)(`p`,{className:`break-words text-amber-200`,children:e.policy.error})]})})]})},Ae=e=>e.execution_status===`completed`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.execution_status===`failed`||e.execution_status===`interrupted`?`border-red-400/30 bg-red-500/10 text-red-200`:e.execution_status===`running`||e.execution_status===`queued`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border bg-muted/40 text-muted-foreground`,je=e=>e.execution_status===`completed`&&e.outcome&&e.outcome!==`passed`?`outcomeValue.${e.outcome}`:`status.${e.execution_status}`,Me=(e,t,n,r)=>((t?.attempts.find(t=>t.attempt_run_id===e.execution_run_id))?.diagnostics.filter(e=>n.has(e.id)).length??0)+ +!!r.has(e.execution_run_id),Ne=({definitions:e,attempts:n,requiredDefinitionIds:r,preReviewDefinitionIds:i,selectedDefinitionIds:a,selectedCheckId:o,diagnostics:s,selectedDiagnosticIds:c,selectedRawOutputAttemptRunIds:l,onToggleDefinition:u,onSelectCheck:d})=>{let{t:f}=L(`common`,{keyPrefix:`checksDialog`}),p=new Set(r),m=new Set(i),h=new Set(e.map(e=>e.id)),g=[...e.map(e=>({definition:e,attempt:n.find(t=>t.definition_id===e.id),historical:!1})),...n.filter(e=>!h.has(e.definition_id)).map(e=>({definition:e.command_snapshot,attempt:e,historical:!0}))];return(0,B.jsxs)(`section`,{"aria-labelledby":`configured-checks-heading`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`header`,{className:`shrink-0 border-b border-border/60 px-4 py-4 sm:px-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-1`,children:[(0,B.jsx)(`h2`,{id:`configured-checks-heading`,className:`text-sm font-semibold text-foreground`,children:f(`configured`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f(`selectionHint`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border/70 bg-background/35 p-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`font-medium text-foreground`,children:f(`policySummary.title`)}),(0,B.jsx)(`p`,{className:`mt-1`,children:f(`policySummary.counts`,{requiredCount:r.length,preReviewCount:i.length})})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 md:max-h-none md:py-5 max-md:max-h-[min(35vh,18rem)]`,children:(0,B.jsx)(`ul`,{"aria-label":f(`configured`),className:`space-y-2`,children:g.map(({definition:e,attempt:n,historical:r})=>{let i=o===e.id,h=n?Me(n,s,c,l):0,g=p.has(e.id),_=m.has(e.id),v=`${f(`category.${e.category}`)} · ${f(g?`required`:`optional`)} · ${f(_?`preReview`:`finalOnly`)}`;return(0,B.jsx)(`li`,{className:`rounded-xl border border-border/60 bg-background/30 p-2.5`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[!r&&(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 shrink-0 accent-primary`,checked:a.has(e.id),"aria-label":f(`selectForRun`,{name:e.name}),onChange:t=>u(e.id,t.target.checked)}),n?(0,B.jsxs)(`button`,{type:`button`,className:t(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,i&&`bg-accent/60`),"aria-label":f(`inspectAttempt`,{name:e.name,status:f(je(n))}),"aria-pressed":i,"aria-current":i?`true`:void 0,onClick:()=>d(e.id),children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:t(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium`,Ae(n)),children:f(je(n))})]}),(0,B.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:v}),h>0&&(0,B.jsx)(`span`,{"data-evidence-selected":`true`,className:`mt-1.5 inline-flex rounded-full border border-amber-400/30 bg-amber-500/10 px-2 py-0.5 text-[11px] text-amber-200`,children:f(`evidenceSelected`,{count:h})})]}):(0,B.jsxs)(`button`,{type:`button`,className:t(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,i&&`bg-accent/60`),"aria-label":f(`inspectAttempt`,{name:e.name,status:f(`status.notRun`)}),"aria-pressed":i,"aria-current":i?`true`:void 0,onClick:()=>d(e.id),children:[(0,B.jsx)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name})}),(0,B.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:v})]})]})},n?.execution_run_id??e.id)})})})]})},Pe=(e,t)=>{let n=new Set(t?.attempts.filter(e=>e.parser.status===`complete`&&e.parser.retention_state===`retained`&&e.diagnostics.length>0).map(e=>e.attempt_run_id)??[]);return e.find(e=>e.execution_status===`failed`&&n.has(e.execution_run_id))??e.find(e=>e.execution_status===`failed`)??e.find(e=>e.execution_status===`running`)??e[0]??null},Fe=new Set([`queued`,`running`,`waiting`]),Ie=75,Le=32,Re=64,ze=3,Be=32,Ve=8,Y=(e,t)=>e instanceof A?e.message:t,He=e=>{let t=new Set(e.repair.eligibility.eligible?e.repair.eligible_attempt_run_ids:[]);return new Set(e.attempts.filter(e=>t.has(e.attempt_run_id)).flatMap(e=>e.diagnostics.map(e=>e.id)))},Ue=e=>new Set(e.repair.eligibility.eligible?e.repair.eligible_raw_output_attempt_run_ids:[]),We=({projectId:e,targetKind:t,targetBundleId:n,definitions:r,requiredDefinitionIds:i=[],preReviewDefinitionIds:a=[],gateEvaluationId:o=null,directBatchRunId:s=null,directAttemptRunId:c=null,onSelectionChange:l,onUnavailable:u,onStatusChange:d})=>{let{t:f}=L(`common`,{keyPrefix:`checksDialog`}),p=le(),[h,g]=(0,z.useState)(()=>new Set(r.map(e=>e.id))),[_,v]=(0,z.useState)(null),[y,b]=(0,z.useState)(null),[x,ee]=(0,z.useState)(null),[S,C]=(0,z.useState)(null),[T,E]=(0,z.useState)(!0),[k,ie]=(0,z.useState)(null),[ae,j]=(0,z.useState)(null),[oe,M]=(0,z.useState)(new Set),[ce,de]=(0,z.useState)(new Set),[he,ge]=(0,z.useState)(``),[N,ye]=(0,z.useState)(null),[P,I]=(0,z.useState)(!1),[Se,Ce]=(0,z.useState)(0),[we,R]=(0,z.useState)(null),V=(0,z.useRef)(_),H=(0,z.useRef)(null),U=(0,z.useRef)(new Set),W=(0,z.useRef)(new Map),G=(0,z.useRef)(0),Te=(0,z.useRef)(0),K=(0,z.useRef)(null),q=(0,z.useRef)(!1),J=(0,z.useRef)(!0),De=(0,z.useRef)(null),Oe=(0,z.useRef)(`automatic`),Ae=(0,z.useRef)(null),je=(0,z.useRef)(async()=>void 0),Me=(0,z.useRef)(async()=>void 0),We=(0,z.useRef)(()=>void 0),Ge=(0,z.useRef)(0),Ke=(0,z.useRef)(ae);V.current=_,Ke.current=ae,J.current=T||k!==null;let X=(0,z.useCallback)((e,t)=>{De.current=e,Oe.current=t,ee(e)},[]),qe=(0,z.useCallback)(e=>{j(e),ye(e.latest_repair?.source_batch_run_id===e.batch_run_id?e.latest_repair:null),M(t=>{let n=He(e);return new Set([...t].filter(e=>n.has(e)))}),de(t=>{let n=Ue(e);return new Set([...t].filter(e=>n.has(e)))}),ge(t=>e.repair.candidate_tickets.some(e=>e.id===t)?t:e.repair.candidate_tickets.length===1&&e.repair.accepts_ticket_id?e.repair.candidate_tickets[0].id:``);let t=V.current;Oe.current===`automatic`&&t?.batch.execution_run_id===e.batch_run_id&&X(Pe(t.attempts,e)?.execution_run_id??null,`automatic`)},[X]),Je=(0,z.useCallback)(e=>{let t=W.current;if(!t.has(e.attempt_run_id)&&t.size>=Le){let e=t.keys().next().value;e&&(t.delete(e),U.current.delete(e))}let n=t.get(e.attempt_run_id)??[];t.set(e.attempt_run_id,[...n.slice(-(Re-1)),e])},[]),Ye=(0,z.useCallback)((e,t,n=`route`)=>{let r=V.current?.batch.execution_run_id===e.batch.execution_run_id?V.current:null,i=!1,a=new Set(e.attempts.map(e=>e.execution_run_id));for(let e of W.current.keys())a.has(e)||(W.current.delete(e),U.current.delete(e));let o=e.attempts.map(e=>{let t=!1,n=r?.attempts.find(t=>t.execution_run_id===e.execution_run_id),a=n&&n.output_revision>e.output_revision?n:e,o=W.current.get(e.execution_run_id)??[];for(let e of[...o].sort((e,t)=>e.revision-t.revision)){let n=pe(te(a),e);if(n.status===`refetch`){t=!0,i=!0;continue}n.status===`applied`&&(a={...a,output_revision:n.snapshot.revision,retained_start_offset:n.snapshot.retainedStartOffset,retained_end_offset:n.snapshot.totalByteCount,total_persisted_bytes:n.snapshot.totalByteCount,retained_output:n.snapshot.retainedText})}return t?U.current.add(e.execution_run_id):(U.current.delete(e.execution_run_id),W.current.delete(e.execution_run_id)),a}),s={...e,attempts:o};K.current=e.batch.execution_run_id,V.current=s,v(s);let c=t?s.attempts.find(e=>e.execution_run_id===t):null,d=De.current,p=Oe.current,m=!!(d&&s.attempts.some(e=>e.execution_run_id===d)),h=Pe(s.attempts,Ke.current?.batch_run_id===s.batch.execution_run_id?Ke.current:null),g=Ae.current,_=!!(g&&g.batchRunId===s.batch.execution_run_id&&g.attemptRunId===t),y=!!(g&&g.previousBatchRunId===s.batch.execution_run_id&&g.previousAttemptRunId===t);if(n===`reset`)X(h?.execution_run_id??null,`automatic`);else if(t)if(c)if(_)X(c.execution_run_id,`manual`);else if(y&&p===`manual`)X(m?d:h?.execution_run_id??null,m?`manual`:`automatic`);else{let e=p!==`external`||d!==c.execution_run_id;X(c.execution_run_id,`external`),e&&l?.(s.batch.execution_run_id,c.execution_run_id)}else _||y?p===`manual`&&m?X(d,`manual`):X(h?.execution_run_id??null,`automatic`):(X(t,`external`),u?.());else n===`preserve`?p===`external`&&d?m?X(d,`external`):(X(d,`external`),u?.()):p===`manual`&&m?X(d,`manual`):X(p===`automatic`&&m?d:h?.execution_run_id??null,`automatic`):p===`manual`&&m?X(d,`manual`):X(h?.execution_run_id??null,`automatic`);i?We.current(e.batch.execution_run_id):Ge.current=0,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie))},[l,u,f,X]),Z=(0,z.useCallback)(async(t,n)=>{let r=++G.current,i=await be(e,t,n);if(r!==G.current||i.batch.execution_run_id!==t||K.current!==null&&K.current!==t){i.batch.execution_run_id!==t&&u?.();return}Ye(i,t===s?c:null)},[c,s,Ye,u,e]);je.current=Z,We.current=(0,z.useCallback)(e=>{if(H.current)return;if(Ge.current>=ze){Ge.current=0,U.current.clear(),W.current.clear();return}let t=Ie*2**Ge.current;H.current=setTimeout(()=>{H.current=null,Ge.current+=1,je.current(e).catch(t=>{R(Y(t,f(`errors.load`))),U.current.size>0&&We.current(e)})},t)},[f]);let Xe=(0,z.useCallback)(async r=>{let i=++G.current,a=await w(e,t,n,r);if(i===G.current){if(a.batch_run_id){K.current=a.batch_run_id,await Z(a.batch_run_id,r);return}!r?.aborted&&i===G.current&&(K.current=null,V.current=null,v(null),X(null,`automatic`))}},[Z,e,n,t,X]),Q=(0,z.useCallback)(async()=>{if(o||s){let e=K.current;e&&await Z(e);return}await Xe()},[s,o,Z,Xe]);Me.current=Q;let Ze=(0,z.useCallback)(e=>{H.current||=setTimeout(()=>{H.current=null,Z(e).catch(e=>R(Y(e,f(`errors.load`))))},Ie)},[Z,f]);(0,z.useEffect)(()=>{let t=new AbortController;return E(!0),R(null),(async()=>{if(s){if(b(null),c){let n=await D(e,c,t.signal);if(n.run.kind!==`check_attempt`||n.details.kind!==`check_attempt`||!n.details.available||!n.details.attempt||n.details.attempt.batch_run_id!==s){u?.();return}}K.current=s,await Z(s,t.signal);return}if(!o){b(null),await Xe(t.signal);return}let n=await _e(e,o,t.signal);if(b(n),n.sourceBatchRunId){K.current=n.sourceBatchRunId,await Z(n.sourceBatchRunId,t.signal);return}K.current=null,V.current=null,v(null),X(null,`automatic`)})().catch(e=>{F(e)||(e instanceof A&&e.status===404&&u?.(),R(Y(e,f(`errors.load`))))}).finally(()=>{t.signal.aborted||(E(!1),J.current=!1,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie)))}),()=>t.abort()},[c,s,o,Z,Xe,u,e,f,X]),(0,z.useEffect)(()=>{let t=_?.batch.execution_run_id;if(!t){Te.current+=1,j(null),M(new Set),de(new Set),ge(``),ye(null);return}Ke.current?.batch_run_id!==t&&(j(null),M(new Set),de(new Set),ge(``),ye(null));let n=++Te.current,r=new AbortController;return fe(e,t,r.signal).then(e=>{n===Te.current&&e.batch_run_id===t&&K.current===t&&qe(e)}).catch(e=>{F(e)||R(Y(e,f(`errors.diagnostics`)))}),()=>r.abort()},[_?.batch.execution_run_id,Se,qe,e,f]),(0,z.useEffect)(()=>{let t=t=>{if(t.project_id!==e)return;let n=K.current;if(n!==null&&t.batch_run_id!==n)return;let r=V.current;if(!r||U.current.has(t.attempt_run_id)){Je(t),r&&U.current.has(t.attempt_run_id)&&We.current(r.batch.execution_run_id);return}let i=r.attempts.findIndex(e=>e.execution_run_id===t.attempt_run_id);if(i<0){Je(t),Ze(r.batch.execution_run_id);return}let a=r.attempts[i],o=pe(te(a),t);if(o.status===`ignored`)return;if(o.status===`refetch`){U.current.add(t.attempt_run_id),Je(t),We.current(r.batch.execution_run_id);return}let s=[...r.attempts];s[i]={...a,output_revision:o.snapshot.revision,retained_start_offset:o.snapshot.retainedStartOffset,retained_end_offset:o.snapshot.totalByteCount,total_persisted_bytes:o.snapshot.totalByteCount,retained_output:o.snapshot.retainedText};let c={...r,attempts:s};V.current=c,v(c)},n=t=>{if(t.project_id&&t.project_id!==e)return;if(J.current){q.current=!0;return}let n=V.current,r=t.execution_run_id??t.id;if(Ce(e=>e+1),N&&r===N.execution_run_id&&N.source_batch_run_id===K.current&&se(e,N.execution_run_id).then(ye).catch(()=>void 0),n&&(r===n.batch.execution_run_id||n.attempts.some(e=>e.execution_run_id===r))){G.current+=1,Ze(n.batch.execution_run_id);return}q.current=!0,!J.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie))},r=()=>{Ce(e=>e+1),Q().catch(e=>R(Y(e,f(`errors.load`))))};return p.on(`check-attempt:output`,t),p.on(`execution-run:updated`,n),p.on(`lifecycle-event:created`,n),p.on(`connect`,r),()=>{p.off(`check-attempt:output`,t),p.off(`execution-run:updated`,n),p.off(`lifecycle-event:created`,n),p.off(`connect`,r)}},[N,Je,e,Q,Ze,p,f]),(0,z.useEffect)(()=>()=>{H.current&&clearTimeout(H.current),U.current.clear(),W.current.clear()},[]);let Qe=(e,t)=>{G.current+=1,K.current=e.batch.execution_run_id,Ye(e,null,t)},$e=async(e,t)=>{G.current+=1,J.current=!0,ie(e),R(null);try{let n=await t();e!==`stop`&&(Ae.current=null),Qe(n,e===`stop`?`preserve`:`reset`),e!==`stop`&&l?.(n.batch.execution_run_id,void 0)}catch(t){R(Y(t,f(`errors.${e}`))),t instanceof A&&t.status===409&&await Q().catch(()=>void 0)}finally{ie(null),J.current=T,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Me.current().catch(e=>R(Y(e,f(`errors.load`))))},Ie))}},et=_?Fe.has(_.batch.execution_status):!1,tt=_?et?`running`:_.batch.execution_status===`completed`?`finished`:_.batch.execution_status===`cancelled`||_.batch.execution_status===`interrupted`?`interrupted`:`error`:`inactive`,nt=_?.batch.execution_run_id??null,$=ae?.batch_run_id===nt?ae:null,rt=N?.source_batch_run_id===nt?N:null,it=$?.auto_fix??null,at=!!(it&&!it.terminal_reason),ot=$?He($):new Set,st=$?Ue($):new Set,ct=new Set([...oe].filter(e=>ot.has(e))),lt=new Set([...ce].filter(e=>st.has(e))),ut=[...h],dt=_?.attempts.filter(e=>e.execution_status!==`completed`).length??0,ft=async()=>{let t=[...ct],n=[...lt];if(!(!$||!nt||K.current!==nt||$.repair.eligibility.eligible!==!0||rt?.terminal_result===null||it&&!it.terminal_reason||t.length===0&&n.length===0)){I(!0),R(null);try{let r=await ne(e,t,n,$.repair.accepts_ticket_id?$.repair.candidate_tickets.some(e=>e.id===he)?he:$.repair.candidate_tickets[0]?.id||null:null);ye(r.source_batch_run_id===nt?r:null)}catch(t){if(R(Y(t,f(`errors.repair`))),t instanceof A&&t.status===409&&_){let t=_.batch.execution_run_id,n=++Te.current;fe(e,t).then(e=>{n===Te.current&&e.batch_run_id===t&&K.current===t&&qe(e)}).catch(()=>void 0)}}finally{I(!1)}}},pt=async()=>{let t=it&&!it.terminal_reason?it.execution_run_id:rt?.execution_run_id;if(t){I(!0),R(null);try{let n=await xe(e,t);`source_batch_run_id`in n&&ye(n),Ce(e=>e+1)}catch(e){R(Y(e,f(`errors.repairStop`)))}finally{I(!1)}}},mt=new Set([...$?.attempts.filter(e=>e.diagnostics.some(e=>ct.has(e.id))).map(e=>e.attempt_run_id)??[],...lt]),ht=(e,t,n)=>{M(r=>{let i=new Set(r);if(!n)return i.delete(t),i;if(i.size>=Be||!$||!ot.has(t))return r;let a=new Set($.attempts.filter(e=>e.diagnostics.some(e=>i.has(e.id))).map(e=>e.attempt_run_id)??[]);return!a.has(e)&&a.size>=Ve?r:(i.add(t),i)})},gt=(e,t)=>{de(n=>{let r=new Set(n);return t?!mt.has(e)&&mt.size>=Ve||!st.has(e)?n:(r.add(e),r):(r.delete(e),r)})},_t=(e,t)=>{g(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},vt=e=>{_&&(C(null),Ae.current={batchRunId:_.batch.execution_run_id,attemptRunId:e,previousBatchRunId:s===_.batch.execution_run_id?s:null,previousAttemptRunId:s===_.batch.execution_run_id?c:null},X(e,`manual`),l?.(_.batch.execution_run_id,e))},yt=e=>{let t=_?.attempts.find(t=>t.definition_id===e);if(t){vt(t.execution_run_id);return}C(e)},bt=S?_?.attempts.find(e=>e.definition_id===S)??null:_?.attempts.find(e=>e.execution_run_id===x)??null,xt=bt?.command_snapshot??r.find(e=>e.id===S)??null,St=S??bt?.definition_id??null,Ct=xt?{required:i.includes(xt.id),preReview:a.includes(xt.id)}:null,wt=_?O(_.batch):null,Tt=_?_.batch.running_count+_.batch.queued_count:0;return(0,z.useEffect)(()=>{d?.(tt)},[tt,d]),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[we&&(0,B.jsx)(`p`,{role:`alert`,className:`mx-4 mt-3 rounded-xl border border-red-400/25 bg-red-500/10 px-3 py-2 text-sm text-red-200 sm:mx-6`,children:we}),(0,B.jsxs)(`div`,{role:`toolbar`,"aria-label":f(`runActions`),className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-y border-border/70 bg-background/30 px-4 py-3 sm:px-6`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:f(`runActions`)})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(m,{type:`button`,size:`sm`,disabled:ut.length===0||et||at||k!==null,onClick:()=>void $e(`run`,()=>ve(e,{targetKind:t,targetBundleId:n,definitionIds:ut})),children:f(k===`run`?`starting`:`runSelected`)}),_&&et&&(0,B.jsx)(m,{type:`button`,variant:`destructive`,size:`sm`,disabled:k!==null||P,onClick:()=>void(at?pt():$e(`stop`,()=>ue(e,_.batch.execution_run_id))),children:f(k===`stop`||P?`stopping`:`stop`)}),_&&!et&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(m,{type:`button`,variant:`outline`,size:`xs`,disabled:at||k!==null,onClick:()=>void $e(`rerun`,()=>me(e,_.batch.execution_run_id,{mode:`all`})),children:f(`rerunAll`)}),(0,B.jsx)(m,{type:`button`,variant:`outline`,size:`xs`,disabled:at||k!==null||dt===0,onClick:()=>void $e(`rerun`,()=>me(e,_.batch.execution_run_id,{mode:`failed_only`})),children:f(`rerunFailed`)})]})]})]}),(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,auto)_minmax(0,1fr)] overflow-hidden md:grid-cols-[19rem_minmax(0,1fr)] md:grid-rows-1`,children:[(0,B.jsx)(`aside`,{className:`flex min-h-0 flex-col border-b border-border/70 md:border-r md:border-b-0`,children:(0,B.jsx)(Ne,{definitions:r,attempts:_?.attempts??[],requiredDefinitionIds:i,preReviewDefinitionIds:a,selectedDefinitionIds:h,selectedCheckId:St,diagnostics:$,selectedDiagnosticIds:ct,selectedRawOutputAttemptRunIds:lt,onToggleDefinition:_t,onSelectCheck:yt})}),(0,B.jsxs)(`main`,{className:`min-h-0 overflow-y-auto p-4 sm:p-6`,children:[o&&!y&&T&&(0,B.jsx)(`p`,{role:`status`,className:`mb-4 text-sm text-muted-foreground`,children:f(`gateLoading`)}),y&&(0,B.jsx)(ke,{evaluation:y}),T&&(0,B.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:f(`loading`)}),!T&&!_&&!xt&&(0,B.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border p-6 text-center`,children:[(0,B.jsx)(`h2`,{className:`font-medium text-foreground`,children:f(`emptyTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:f(`emptyDescription`)})]}),_&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:f(`status.${_.batch.execution_status}`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f(`summary`,{passed:_.batch.passed_count,failed:_.batch.failed_count,running:_.batch.running_count,queued:_.batch.queued_count})}),_.batch.stop_requested&&(0,B.jsx)(`span`,{className:`text-xs text-amber-200`,children:f(`stopRequested`)}),wt&&(0,B.jsx)(re,{evidence:wt})]}),wt?.provider===`docker_sandbox`&&et&&(0,B.jsxs)(`p`,{className:`mb-4 max-w-3xl text-xs text-amber-100`,children:[f(`environment.batchOwnership`,{count:Tt}),` `,f(`environment.wholeSandboxStop`)]})]}),(_||xt)&&(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(Ee,{projectId:e,attempt:bt,batch:_?.batch??null,definition:xt,diagnostics:$?.attempts.find(e=>e.attempt_run_id===bt?.execution_run_id)??null,repair:$?.repair??null,selectedDiagnosticIds:ct,selectedRawOutputAttemptRunIds:lt,selectedAttemptRunIds:mt,selectedTicketId:he,pending:P,activeRepair:rt,autoFix:it,policy:Ct,onSelectedTicketChange:ge,onToggleDiagnostic:(e,t)=>bt&&ht(bt.execution_run_id,e,t),onToggleRawOutput:e=>bt&>(bt.execution_run_id,e),onStartRepair:()=>void ft(),onStopRepair:()=>void pt()})})]})]})]})},Ge=(e,t)=>E(C(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),Ke=(e,t)=>E(C(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),X=(e,t={})=>E(C(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),qe=(e,t)=>E(C(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),Je=e=>E(C(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),Ye=e=>we(C(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),Z=256*1024,Xe=24,Q=(e,t)=>ce.t(`common:testsDialog.${e}`,t),Ze=(e,t)=>{let n=`${e}${t}`;return n.length<=Z?n:n.slice(-Z)},Qe=(e,t)=>e?e.run_id&&t.run_id&&e.run_id!==t.run_id?e.status===`running`||t.status!==`running`?e:t:e.status!==`idle`&&e.status!==`running`&&t.status===`running`?e:e.run_id===t.run_id&&e.output.length>t.output.length?{...t,output:e.output,output_truncated:e.output_truncated||t.output_truncated}:t:t,$e=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=Xe,et=e=>{e.scrollTop=e.scrollHeight},tt=(e,t=!1)=>{et(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{et(e),t&&(r=window.requestAnimationFrame(()=>{et(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},nt=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,$=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},rt=e=>{let t=e.split(`/`);return t[t.length-1]||e},it=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),at=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),ot=(e,t)=>{let n=it(t);return n.length===0?e:e.flatMap(e=>{let t=rt(e.path);if(at(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>at(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},st=e=>Q(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ct=e=>e?.selection?e.selection.kind===`all`?Q(`selection.allTests`):e.selection.kind===`case`?e.selection.name:rt(e.selection.path):Q(`selection.noRunYet`),lt=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,ut=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,dt=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ft=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,pt=({line:e,tone:n})=>(0,B.jsx)(`div`,{"data-tone":n,className:t(`whitespace-pre-wrap break-words`,ut(n)),children:e===``?` `:e}),mt=(0,z.memo)(({canRunGranular:e,filePath:n,isActive:r,name:i,onRunCase:a})=>(0,B.jsxs)(`button`,{type:`button`,"aria-label":Q(`caseRow.runAriaLabel`,{name:i}),title:i,className:t(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,r&&`bg-sky-500/10`),disabled:!e,onClick:()=>{a(n,i)},children:[(0,B.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,B.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:i})]}));mt.displayName=`TestCaseRow`;var ht=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:i,activeSelectionPath:a,canRunGranular:o,file:c,isExpanded:l,onRunCase:u,onRunFile:d,onToggleFile:f})=>{let p=e===`file`&&a===c.path,h=e===`case`&&a===c.path;return(0,B.jsx)(Se,{open:l,onOpenChange:e=>{f(c.path,e)},children:(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(r,{asChild:!0,children:(0,B.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":Q(l?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:c.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,B.jsx)(s,{className:t(`h-4 w-4 transition-transform`,l&&`rotate-180`)})})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":Q(`fileRow.runAriaLabel`,{path:c.path}),className:t(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,o?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(p||h)&&`border-sky-400/45 bg-sky-500/10`),disabled:!o,onClick:()=>{d(c.path)},children:(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,B.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,B.jsx)(n,{className:`h-3.5 w-3.5`})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:rt(c.path)}),(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:c.path})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:Q(`fileRow.testCount`,{count:c.cases.length})})]})]})})]}),(0,B.jsx)(g,{children:(0,B.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:c.cases.length===0?(0,B.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:Q(`fileRow.noNamedTests`)}):(0,B.jsx)(`div`,{className:`space-y-1`,children:c.cases.map(t=>{let n=e===`case`&&a===c.path&&i===t.name;return(0,B.jsx)(mt,{canRunGranular:o,filePath:c.path,isActive:n,name:t.name,onRunCase:u},t.id)})})})})]})})});ht.displayName=`DiscoveryFileRow`;var gt=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:n,activeSelectionPath:r,availableCommands:i,canRunGranular:o,discovery:c,expandedFiles:l,fullSuiteOnlyNotice:h,isLoading:g,selectedCommandId:_,selectedCommandName:v,sessionError:b,sessionStatus:x,shouldShowCommandSelector:ee,onRunCase:S,onRunFile:C,onSelectCommand:te,onToggleFile:w})=>{let[T,E]=(0,z.useState)(``),D=(0,z.useMemo)(()=>ot(c,T),[c,T]),ne=(0,z.useMemo)(()=>D.reduce((e,t)=>e+t.cases.length,0),[D]),O=it(T).length>0;return(0,B.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[ee&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:Q(`scope.label`)}),(0,B.jsxs)(u,{children:[(0,B.jsx)(a,{asChild:!0,children:(0,B.jsxs)(m,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":Q(`scope.selectedCommandAriaLabel`),disabled:i.length===0||x===`running`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:v??Q(`scope.selectTestScope`)}),(0,B.jsx)(s,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,B.jsx)(d,{align:`start`,className:`w-72`,children:i.map(e=>(0,B.jsx)(p,{className:t(_===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{te(e.id)},children:(0,B.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),h&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:h}),(c.length>0||T.length>0)&&(0,B.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,B.jsx)(y,{type:`search`,value:T,onChange:e=>{E(e.target.value)},placeholder:Q(`filter.placeholder`),"aria-label":Q(`filter.ariaLabel`),className:`pr-10`}),T.length>0&&(0,B.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Q(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{E(``)},children:(0,B.jsx)(f,{className:`size-4`})})]}),!i.length&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:Q(`discovery.noCommands`)}),b&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:b}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[Q(`discovery.fileCount`,{count:D.length}),`, `,Q(`discovery.caseCount`,{count:ne})]})}),g&&(0,B.jsx)(R,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:c.length===0&&!g?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:Q(`discovery.noFilesDetected`)}):D.length===0?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:Q(`discovery.noFilterMatches`)}):D.map(t=>(0,B.jsx)(ht,{activeSelectionKind:e,activeSelectionName:n,activeSelectionPath:r,canRunGranular:o,file:t,isExpanded:O||(l[t.path]??!1),onRunCase:S,onRunFile:C,onToggleFile:w},t.path))})]})]})})});gt.displayName=`DiscoveryPane`;var _t=(0,z.memo)(({durationMs:e,output:n,outputTruncated:r,selectionLabel:i,status:a,summaryCounts:o,viewportRef:s,onScroll:c})=>{let l=(0,z.useMemo)(()=>n?oe(n).replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map(e=>({line:e,tone:lt(e)})):[],[n]);return(0,B.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,B.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:i}),a&&(0,B.jsx)(I,{variant:`outline`,className:t(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,nt(a)),children:st(a)}),o&&(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,B.jsxs)(`span`,{className:`text-rose-200`,children:[o.failed.count,` `,o.failed.label]}),(0,B.jsxs)(`span`,{className:`text-emerald-200`,children:[o.passed.count,` `,o.passed.label]})]}),e!=null&&(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:$(e)}),r&&(0,B.jsx)(I,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:Q(`output.trimmed`)})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,B.jsx)(`div`,{ref:s,"aria-label":Q(`output.ariaLabel`),className:`h-full overflow-auto px-4 py-4`,onScroll:c,children:(0,B.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:l.length>0?l.map((e,t)=>(0,B.jsx)(pt,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,B.jsx)(`div`,{className:`text-slate-200`,children:Q(`output.empty`)})})})})]})})});_t.displayName=`OutputPane`;var vt=(0,z.forwardRef)(({testCommands:e,onStatusChange:t,onTargetLabelChange:n,onClose:r,...a},s)=>{let u=a.scope,d=a.projectId,f=a.scope===`ticket`?a.ticketId:null,p=a.scope===`project`?a.targetKind:null,g=a.scope===`project`?a.targetBundleId:null,[_,v]=(0,z.useState)(e),[y,S]=(0,z.useState)(null),[C,te]=(0,z.useState)([]),[w,T]=(0,z.useState)(``),[E,D]=(0,z.useState)({}),[ne,O]=(0,z.useState)(!0),[re,ie]=(0,z.useState)(!1),[j,oe]=(0,z.useState)(!1),[se,M]=(0,z.useState)(null),[ce,le]=(0,z.useState)(!1),[ue,fe]=(0,z.useState)(!1),pe=(0,z.useRef)(null),me=(0,z.useRef)(!1),he=(0,z.useRef)(null),_e=(0,z.useRef)(!0),N=(0,z.useRef)(null),ve=(0,z.useRef)(null),ye=y?.selection?.kind??null,be=y?.selection?.kind===`all`?null:y?.selection?.path??null,xe=y?.selection?.kind===`case`?y.selection.name:null,P=y?.id??null,F=y?.status??null,I=(0,z.useMemo)(()=>_.find(e=>e.id===w)??null,[_,w]),Se=(0,z.useMemo)(()=>{if(y?.summary?.failed_count==null&&y?.summary?.passed_count==null&&y?.summary?.failed_file_count==null&&y?.summary?.passed_file_count==null)return null;let e=y?.summary?.failed_count==null&&y?.summary?.passed_count==null;return{failed:F===`failed`&&y?.summary?.failed_count==null&&y?.summary?.failed_file_count!=null||e?{count:y?.summary?.failed_file_count??0,label:Q(`summaryCounts.filesFailed`)}:{count:y?.summary?.failed_count??0,label:Q(`summaryCounts.failed`)},passed:e?{count:y?.summary?.passed_file_count??0,label:Q(`summaryCounts.filesPassed`)}:{count:y?.summary?.passed_count??y?.summary?.passed_file_count??0,label:Q(`summaryCounts.passed`)}}},[y?.summary?.failed_count,y?.summary?.passed_count,y?.summary?.failed_file_count,y?.summary?.passed_file_count,F]),L=I?.runner===`unknown`?Q(`scope.fullSuiteOnlyNotice`):null,Ce=!!(I&&y?.status!==`running`&&!re&&!j),we=Ce,R=Ce&&ue,V=_.length>1,{runs:H}=de(d),U=y?.run_id?H.find(e=>e.id===y.run_id)??null:null;(0,z.useEffect)(()=>{w||_.length===0||T(_[0]?.id??``)},[_,w]),(0,z.useEffect)(()=>{e.length>0&&v(t=>dt(t,e)?t:e)},[e]),(0,z.useEffect)(()=>{if(_.length>0||!d)return;let e=new AbortController;return k(e.signal).then(e=>{let t=e.find(e=>e.id===d);t&&v(e=>{let n=ae(t);return dt(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[_.length,d]),(0,z.useEffect)(()=>{let e=e=>{!e||e.id!==pe.current||S(t=>Qe(t,e))},t=e=>{!e||e.session_id!==pe.current||S(t=>!t||t.id!==e.session_id||e.run_id&&t.run_id&&e.run_id!==t.run_id?t:{...t,output:Ze(t.output,e.chunk),output_truncated:e.output_truncated})};return i.on(`test-session:updated`,e),i.on(`test-session:output`,t),()=>{i.off(`test-session:updated`,e),i.off(`test-session:output`,t)}},[]),(0,z.useEffect)(()=>{let e=he.current;if(!e){N.current=y?.output??null,ve.current=y?.status??null;return}let t=N.current!==(y?.output??null),n=ve.current!==`running`&&y?.status===`running`,r=ve.current===`running`&&y?.status!==`running`;if(n&&(_e.current=!0),n||t&&y?.status===`running`&&_e.current||r&&_e.current){let t=tt(e,r);return N.current=y?.output??null,ve.current=y?.status??null,t}N.current=y?.output??null,ve.current=y?.status??null},[y?.output,y?.status]),(0,z.useEffect)(()=>{let e=!1;return(async()=>{try{let t;if(u===`project`){if(!d)return;t=await Ge(d,{target_kind:p??`repo_root`,target_bundle_id:g??null})}else t=await Ke(f??``,d);if(e){Ye(t.id).catch(()=>{});return}pe.current=t.id,S(t)}catch(t){e||M(t instanceof A?t.message:Q(`messages.loadRunnerError`))}finally{!e&&pe.current==null&&O(!1)}})(),()=>{e=!0}},[d,u,g,p,f]),(0,z.useEffect)(()=>{U&&S(e=>{if(!e||e.run_id!==U.id)return e;let t=U.status===`completed`?`passed`:U.status===`failed`?`failed`:U.status===`cancelled`||U.status===`interrupted`?`stopped`:`running`;return e.status===t&&e.error===(U.failure?.message??e.error)?e:{...e,status:t,error:U.failure?.message??e.error,started_at:U.started_at??e.started_at,completed_at:U.completed_at??e.completed_at}})},[U]),(0,z.useEffect)(()=>{if(!y?.id){fe(!1);return}if(_.length>0&&!w){fe(!1);return}let e=new AbortController,t=!1;return O(!0),fe(!1),X(y.id,{commandId:w||null,signal:e.signal}).then(e=>{t||(te(e.files),fe(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||M(n instanceof A?n.message:Q(`messages.discoverError`))}).finally(()=>{t||O(!1)}),()=>{t=!0,e.abort()}},[_.length,w,y?.id]),(0,z.useEffect)(()=>()=>{let e=pe.current;!e||me.current||(me.current=!0,Ye(e).catch(()=>{}))},[]);let W=(0,z.useCallback)(async e=>{if(!(!P||F===`running`||!I||re||j)){M(null),ie(!0);try{let t=await qe(P,{command_id:I.id,selection:e});S(e=>Qe(e,t))}catch(e){M(e instanceof A?e.message:Q(`messages.startError`))}finally{ie(!1)}}},[re,j,I,P,F]),G=(0,z.useCallback)(async()=>{if(!(!P||F!==`running`||j)){M(null),oe(!0);try{let e=await Je(P);S(t=>Qe(t,e))}catch(e){M(e instanceof A?e.message:Q(`messages.stopError`))}finally{oe(!1)}}},[j,P,F]),Te=(0,z.useCallback)(()=>{let e=pe.current;if(!e||me.current){r();return}me.current=!0,r(),Ye(e).catch(()=>{})},[r]),K=(0,z.useCallback)(()=>{if(F===`running`){le(!0);return}Te()},[Te,F]);(0,z.useImperativeHandle)(s,()=>({requestClose:K}),[K]),(0,z.useEffect)(()=>{t?.(F===`running`?`running`:F===`passed`?`finished`:F===`failed`||F===`error`?`error`:F===`stopped`?`interrupted`:`inactive`)},[t,F]),(0,z.useEffect)(()=>{y?.target_label&&n?.(y.target_label)},[n,y?.target_label]);let q=(0,z.useCallback)(()=>{let e=he.current;e&&(_e.current=$e(e))},[]),Ee=(0,z.useCallback)(e=>{T(e)},[]),J=(0,z.useCallback)((e,t)=>{D(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),De=(0,z.useCallback)(e=>{W({kind:`file`,path:e})},[W]),Oe=(0,z.useCallback)((e,t)=>{W({kind:`case`,path:e,name:t})},[W]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-testid":`tests-panel-layout`,children:[(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-0 lg:grid-cols-[22rem_minmax(0,1fr)] lg:grid-rows-1`,children:[(0,B.jsx)(gt,{activeSelectionKind:ye,activeSelectionName:xe,activeSelectionPath:be,availableCommands:_,canRunGranular:R,discovery:C,expandedFiles:E,fullSuiteOnlyNotice:L,isLoading:ne,selectedCommandId:w,selectedCommandName:I?.name??null,sessionError:se,sessionStatus:F,shouldShowCommandSelector:V,onRunCase:Oe,onRunFile:De,onSelectCommand:Ee,onToggleFile:J}),(0,B.jsx)(_t,{durationMs:y?.duration_ms??null,output:y?.output??``,outputTruncated:y?.output_truncated??!1,selectionLabel:ct(y),status:F,summaryCounts:Se,viewportRef:he,onScroll:q})]}),(0,B.jsx)(x,{className:`shrink-0 border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,B.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:y?.status===`running`?(0,B.jsxs)(m,{type:`button`,variant:`destructive`,className:ft,onClick:()=>{G()},disabled:j,children:[(0,B.jsx)(l,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:Q(`actions.stop`)})]}):(0,B.jsxs)(m,{type:`button`,variant:`success`,className:ft,disabled:!we,onClick:()=>{W({kind:`all`})},children:[(0,B.jsx)(h,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:Q(`actions.run`)})]})})})]}),(0,B.jsx)(o,{open:ce,onOpenChange:le,children:(0,B.jsxs)(ge,{showCloseButton:!1,overlayClassName:`z-[60] bg-black/60`,className:`z-[60] max-w-md rounded-2xl border border-border bg-card p-6 shadow-2xl`,children:[(0,B.jsxs)(b,{children:[(0,B.jsx)(ee,{className:`text-sm font-semibold uppercase tracking-widest text-muted-foreground`,children:Q(`closeConfirmation.title`)}),(0,B.jsx)(c,{className:`text-sm text-foreground whitespace-pre-line`,children:Q(`closeConfirmation.description`)})]}),(0,B.jsxs)(x,{className:`sm:flex-row sm:justify-end`,children:[(0,B.jsx)(m,{type:`button`,variant:`ghost`,onClick:()=>le(!1),children:Q(`closeConfirmation.keepRunning`)}),(0,B.jsx)(m,{type:`button`,variant:`destructive`,onClick:()=>{le(!1),Te()},children:Q(`closeConfirmation.stopAndClose`)})]})]})})]})});vt.displayName=`TestsPanel`;var yt=`archon.verification-tab`,bt=()=>{try{let e=window.localStorage.getItem(yt);return e===`checks`||e===`tests`?e:null}catch{return null}},xt=e=>{try{window.localStorage.setItem(yt,e)}catch{}},St=({targetLabel:e,definitions:t,requiredDefinitionIds:n=[],preReviewDefinitionIds:r=[],checksTarget:i,testsTarget:a,onClose:s,onOpenActivity:l,requestedInitialTab:u,directBatchRunId:d,directAttemptRunId:p,onCheckSelectionChange:h,onUnavailable:g})=>{let{t:_}=L(`common`,{keyPrefix:`verificationDialog`}),y=ie(t),b=i!==null&&(t.length>0||!!i.gateEvaluationId||!!d),x=a!==null&&y.length>0,[C,te]=(0,z.useState)(()=>{if(u===`checks`&&b||u===`tests`&&x)return u;let e=bt();return e===`checks`&&b||e===`tests`&&x?e:b?`checks`:`tests`}),[w,E]=(0,z.useState)(()=>new Set([C])),[D,ne]=(0,z.useState)(`inactive`),[O,k]=(0,z.useState)(`inactive`),re=(0,z.useRef)(null),A=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(C===`checks`&&!b||C===`tests`&&!x){let e=b?`checks`:`tests`;te(e),E(t=>new Set(t).add(e))}},[C,b,x]);let ae=e=>{if(A.current=e??null,a){let e=re.current;if(e){e.requestClose();return}}(e??s)()},j=()=>{let e=A.current??s;A.current=null,e()};return(0,B.jsx)(o,{open:!0,onOpenChange:e=>{e||ae()},children:(0,B.jsxs)(ge,{showCloseButton:!1,className:`flex h-[calc(100vh-1rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl p-0 sm:h-[calc(100vh-2rem)] sm:max-w-7xl`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),children:[(0,B.jsx)(ee,{className:`sr-only`,children:_(`title`)}),(0,B.jsx)(c,{className:`sr-only`,children:_(`description`)}),(0,B.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-border/70 px-4 py-4 sm:px-6`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,B.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border bg-background/60 text-sky-200`,children:(0,B.jsx)(v,{className:`size-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:_(`title`)}),(0,B.jsx)(`p`,{className:`truncate text-sm text-muted-foreground`,children:e})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,B.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ae(l),children:_(`openActivity`)}),(0,B.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":_(`close`),onClick:()=>ae(),children:(0,B.jsx)(f,{className:`size-4`})})]})]}),(0,B.jsxs)(S,{value:C,onValueChange:e=>{e!==`checks`&&e!==`tests`||(te(e),E(t=>new Set(t).add(e)),xt(e))},className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,B.jsxs)(Ce,{"aria-label":_(`tabsAriaLabel`),children:[b&&(0,B.jsxs)(T,{value:`checks`,className:`gap-2`,children:[(0,B.jsx)(v,{className:`size-4`}),(0,B.jsx)(`span`,{children:_(`tabs.checks.label`)}),(0,B.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":_(`status.checks.${D}`),children:(0,B.jsx)(M,{state:D})})]}),x&&(0,B.jsxs)(T,{value:`tests`,className:`gap-2`,children:[(0,B.jsx)(ye,{className:`size-4`}),(0,B.jsx)(`span`,{children:_(`tabs.tests.label`)}),(0,B.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":_(`status.tests.${O}`),children:(0,B.jsx)(M,{state:O})})]})]}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:_(`tabs.${C}.description`)})]}),b&&i&&w.has(`checks`)&&(0,B.jsx)(P,{value:`checks`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,B.jsx)(We,{...i,definitions:t,requiredDefinitionIds:n,preReviewDefinitionIds:r,directBatchRunId:d,directAttemptRunId:p,onSelectionChange:C===`checks`?h:void 0,onUnavailable:g,onStatusChange:ne})}),a&&y.length>0&&w.has(`tests`)&&(0,B.jsx)(P,{value:`tests`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,B.jsx)(vt,{ref:re,...a,testCommands:y,onStatusChange:k,onClose:j})})]})]})})};export{St as VerificationDialog};
|