@xdevops/issue-auto-finish 1.0.75 → 1.0.76
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/package.json
CHANGED
|
@@ -120,7 +120,7 @@ Consider installing the package or pass your own 'workerFactory' to ELK's constr
|
|
|
120
120
|
`),K.value=Ce.postconditions.join(`
|
|
121
121
|
`))}Jr(I,he);function ke(){b.selectedUseCaseId&&m("update-usecase",b.selectedUseCaseId,{name:P.value,displayName:U.value,description:V.value,importance:X.value,preconditions:ee.value.split(`
|
|
122
122
|
`).filter(Ce=>Ce.trim()),postconditions:K.value.split(`
|
|
123
|
-
`).filter(Ce=>Ce.trim())})}function ue(Ce){j.value[Ce]=!j.value[Ce]}const oe=En(()=>b.selectedUseCaseId?b.model.relationships.filter(Ce=>Ce.sourceId===b.selectedUseCaseId||Ce.targetId===b.selectedUseCaseId):[]);function re(Ce){const Se=b.model.useCases.find(te=>te.id===Ce);return Se?.displayName||Se?.name||Ce}const ye=Ye(!1),pe=Ye({sourceId:"",targetId:"",type:"include",label:""});function be(){const Ce="ucrel-"+Date.now().toString(36);m("add-relationship",{id:Ce,type:pe.value.type,sourceId:pe.value.sourceId,targetId:pe.value.targetId,label:pe.value.label||void 0}),pe.value={sourceId:"",targetId:"",type:"include",label:""},ye.value=!1}const se=Object.entries(qO).map(([Ce,Se])=>({value:Ce,label:Se.label})),le=Object.entries(x3).map(([Ce,Se])=>({value:Ce,label:Se.label}));return(Ce,Se)=>(R(),J("div",jdn,[E("div",Idn,[E("button",{class:wn(["flex-1 px-3 py-2 text-xs font-medium",w.value==="list"?"text-blue-600 border-b-2 border-blue-600":"text-gray-500 hover:text-gray-700"]),onClick:Se[0]||(Se[0]=te=>w.value="list")},"用例列表",2),E("button",{class:wn(["flex-1 px-3 py-2 text-xs font-medium",w.value==="detail"?"text-blue-600 border-b-2 border-blue-600":"text-gray-500 hover:text-gray-700"]),disabled:!I.value,onClick:Se[1]||(Se[1]=te=>w.value="detail")},"详情",10,Adn)]),E("div",Tdn,[w.value==="list"?(R(),J(sn,{key:0},[E("div",Mdn,[Nn(E("input",{"onUpdate:modelValue":Se[2]||(Se[2]=te=>$.value=te),class:"w-full px-2 py-1 border rounded text-xs",placeholder:"搜索用例..."},null,512),[[Ci,$.value]]),E("div",Pdn,[(R(!0),J(sn,null,bi([{value:"all",label:"全部"},...A(le)],te=>(R(),J("button",{key:te.value,class:wn(["px-2 py-0.5 text-[10px] rounded-full border",p.value===te.value?"bg-blue-600 text-white border-blue-600":"text-gray-500 border-gray-300 hover:border-gray-400"]),onClick:q=>p.value=te.value},M(te.label),11,Ddn))),128))])]),E("div",Odn,M(N.value.length)+"/"+M(a.model.useCases.length)+" 用例 · "+M(a.model.relationships.length)+" 关系 ",1),(R(!0),J(sn,null,bi(N.value,te=>(R(),J("div",{key:te.id,class:wn(["flex items-center gap-2 px-2 py-1.5 rounded text-xs cursor-pointer hover:bg-gray-50 group",{"bg-blue-50":a.selectedUseCaseId===te.id}]),onClick:q=>m("select-usecase",te.id)},[E("span",{class:"w-2 h-2 rounded-full flex-shrink-0",style:_c({backgroundColor:A(x3)[te.importance]?.color})},null,4),E("span",Ndn,M(te.displayName||te.name),1),E("span",Rdn,M(te.mainPath.length)+"步",1),E("button",{class:"text-red-400 hover:text-red-600 opacity-0 group-hover:opacity-100",title:"删除",onClick:Ah(q=>m("remove-usecase",te.id),["stop"])},"×",8,Fdn)],10,Ldn))),128)),E("div",Bdn,[E("div",Hdn,[Se[27]||(Se[27]=E("span",{class:"text-xs font-semibold text-gray-600"},"关系",-1)),E("button",{class:"text-xs text-blue-600 hover:text-blue-800",onClick:Se[3]||(Se[3]=te=>ye.value=!0)},"+ 添加")]),(R(!0),J(sn,null,bi(a.model.relationships,te=>(R(),J("div",{key:te.id,class:"flex items-center gap-1 px-2 py-1 text-[10px] text-gray-500 hover:bg-gray-50 rounded"},[E("span",Gdn,M(re(te.sourceId))+" → "+M(re(te.targetId)),1),E("span",Jdn,M(A(qO)[te.type]?.label),1),E("button",{class:"text-red-400 hover:text-red-600",onClick:q=>m("remove-relationship",te.id)},"×",8,Udn)]))),128))])],64)):Ae("",!0),w.value==="detail"&&I.value?(R(),J("div",zdn,[E("div",qdn,[E("span",{class:"text-[10px] font-medium px-1.5 py-0.5 rounded-full",style:_c({color:A(x3)[I.value.importance]?.color,backgroundColor:A(x3)[I.value.importance]?.bgColor,border:"1px solid "+A(x3)[I.value.importance]?.color})},M(A(x3)[I.value.importance]?.label),5),E("span",Vdn,M(I.value.status),1)]),E("div",Kdn,M(I.value.displayName||I.value.name),1),E("div",Wdn,M(I.value.description),1),E("div",null,[Se[28]||(Se[28]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"参与者",-1)),E("div",Xdn,[ci(" 主: "+M(I.value.primaryActor)+" ",1),I.value.auxiliaryActors.length?(R(),J("span",Ydn," · 辅: "+M(I.value.auxiliaryActors.join(", ")),1)):Ae("",!0)])]),I.value.preconditions.length?(R(),J("div",Qdn,[Se[29]||(Se[29]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"前置条件",-1)),E("ul",Zdn,[(R(!0),J(sn,null,bi(I.value.preconditions,(te,q)=>(R(),J("li",{key:q},M(te),1))),128))])])):Ae("",!0),E("div",null,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[4]||(Se[4]=te=>ue("mainPath"))},[E("span",null,"主路径 ("+M(I.value.mainPath.length)+"步)",1),E("span",null,M(j.value.mainPath?"▼":"▶"),1)]),j.value.mainPath?(R(),J("div",ehn,[(R(!0),J(sn,null,bi(I.value.mainPath,te=>(R(),J("div",{key:te.number,class:"flex gap-2 text-xs py-0.5"},[E("span",thn,M(te.number),1),E("span",{class:wn(["text-[10px] font-medium px-1 rounded flex-shrink-0",{"bg-blue-100 text-blue-700":te.type==="request","bg-yellow-100 text-yellow-700":te.type==="validate","bg-green-100 text-green-700":te.type==="change","bg-purple-100 text-purple-700":te.type==="feedback","bg-orange-100 text-orange-700":te.type==="request-auxiliary","bg-teal-100 text-teal-700":te.type==="validate-auxiliary"}])},M(A(ydn)[te.type]),3),E("span",nhn,M(te.description),1)]))),128))])):Ae("",!0)]),I.value.extensions.length?(R(),J("div",ihn,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[5]||(Se[5]=te=>ue("extensions"))},[E("span",null,"扩展路径 ("+M(I.value.extensions.length)+")",1),E("span",null,M(j.value.extensions?"▼":"▶"),1)]),j.value.extensions?(R(),J("div",rhn,[(R(!0),J(sn,null,bi(I.value.extensions,te=>(R(),J("div",{key:te.id,class:"border-l-2 border-orange-200 pl-2"},[E("div",shn,M(te.condition),1),(R(!0),J(sn,null,bi(te.steps,q=>(R(),J("div",{key:q.number,class:"flex gap-2 text-xs py-0.5"},[E("span",ohn,M(q.number),1),E("span",chn,M(q.description),1)]))),128))]))),128))])):Ae("",!0)])):Ae("",!0),I.value.constraints.length?(R(),J("div",uhn,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[6]||(Se[6]=te=>ue("constraints"))},[E("span",null,"补充约束 ("+M(I.value.constraints.length)+")",1),E("span",null,M(j.value.constraints?"▼":"▶"),1)]),j.value.constraints?(R(),J("div",lhn,[(R(!0),J(sn,null,bi(I.value.constraints,te=>(R(),J("div",{key:te.id,class:"text-xs"},[E("div",ahn,[E("span",{class:wn(["text-[10px] font-medium px-1 rounded",{"bg-blue-100 text-blue-700":te.type==="field-list","bg-yellow-100 text-yellow-700":te.type==="business-rule","bg-green-100 text-green-700":te.type==="quality","bg-purple-100 text-purple-700":te.type==="design"}])},M({"field-list":"字段","business-rule":"规则",quality:"质量",design:"设计"}[te.type]),3),E("span",fhn,M(te.name),1)]),E("div",dhn,M(te.content),1)]))),128))])):Ae("",!0)])):Ae("",!0),I.value.postconditions.length?(R(),J("div",hhn,[Se[30]||(Se[30]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"后置条件",-1)),E("ul",ghn,[(R(!0),J(sn,null,bi(I.value.postconditions,(te,q)=>(R(),J("li",{key:q},M(te),1))),128))])])):Ae("",!0),oe.value.length?(R(),J("div",bhn,[E("label",phn,"关系 ("+M(oe.value.length)+")",1),(R(!0),J(sn,null,bi(oe.value,te=>(R(),J("div",{key:te.id,class:"text-xs text-gray-600 pl-2 py-0.5"},[te.sourceId===a.selectedUseCaseId?(R(),J("span",whn,"→ "+M(re(te.targetId)),1)):(R(),J("span",vhn,"← "+M(re(te.sourceId)),1)),E("span",mhn,"("+M(A(qO)[te.type]?.label)+")",1)]))),128))])):Ae("",!0),E("div",yhn,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[7]||(Se[7]=te=>ue("edit"))},[Se[31]||(Se[31]=E("span",null,"编辑",-1)),E("span",null,M(j.value.edit?"▼":"▶"),1)]),j.value.edit?(R(),J("div",khn,[E("div",null,[Se[32]||(Se[32]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"名称",-1)),Nn(E("input",{"onUpdate:modelValue":Se[8]||(Se[8]=te=>P.value=te),class:"w-full px-2 py-1 border rounded text-xs",onBlur:Se[9]||(Se[9]=te=>ke())},null,544),[[Ci,P.value]])]),E("div",null,[Se[33]||(Se[33]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"中文名",-1)),Nn(E("input",{"onUpdate:modelValue":Se[10]||(Se[10]=te=>U.value=te),class:"w-full px-2 py-1 border rounded text-xs",onBlur:Se[11]||(Se[11]=te=>ke())},null,544),[[Ci,U.value]])]),E("div",null,[Se[34]||(Se[34]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"描述",-1)),Nn(E("textarea",{"onUpdate:modelValue":Se[12]||(Se[12]=te=>V.value=te),class:"w-full px-2 py-1 border rounded text-xs",rows:"2",onBlur:Se[13]||(Se[13]=te=>ke())},null,544),[[Ci,V.value]])]),E("div",null,[Se[35]||(Se[35]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"重要性",-1)),Nn(E("select",{"onUpdate:modelValue":Se[14]||(Se[14]=te=>X.value=te),class:"w-full px-2 py-1 border rounded text-xs",onChange:Se[15]||(Se[15]=te=>ke())},[(R(!0),J(sn,null,bi(A(le),te=>(R(),J("option",{key:te.value,value:te.value},M(te.label),9,xhn))),128))],544),[[Rd,X.value]])]),E("div",null,[Se[36]||(Se[36]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"前置条件(每行一条)",-1)),Nn(E("textarea",{"onUpdate:modelValue":Se[16]||(Se[16]=te=>ee.value=te),class:"w-full px-2 py-1 border rounded text-xs",rows:"2",onBlur:Se[17]||(Se[17]=te=>ke())},null,544),[[Ci,ee.value]])]),E("div",null,[Se[37]||(Se[37]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"后置条件(每行一条)",-1)),Nn(E("textarea",{"onUpdate:modelValue":Se[18]||(Se[18]=te=>K.value=te),class:"w-full px-2 py-1 border rounded text-xs",rows:"2",onBlur:Se[19]||(Se[19]=te=>ke())},null,544),[[Ci,K.value]])]),E("button",{class:"w-full px-3 py-1.5 text-xs bg-red-50 text-red-600 rounded hover:bg-red-100",onClick:Se[20]||(Se[20]=te=>{m("remove-usecase",I.value.id),w.value="list"})},"删除此用例")])):Ae("",!0)])])):w.value==="detail"?(R(),J("div",$hn,"点击画布上的节点查看详情")):Ae("",!0)]),ye.value?(R(),J("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:Se[26]||(Se[26]=Ah(te=>ye.value=!1,["self"]))},[E("div",Ehn,[Se[41]||(Se[41]=E("h4",{class:"text-sm font-semibold"},"添加用例关系",-1)),E("div",null,[Se[38]||(Se[38]=E("label",{class:"text-[10px] text-gray-500"},"源用例",-1)),Nn(E("select",{"onUpdate:modelValue":Se[21]||(Se[21]=te=>pe.value.sourceId=te),class:"w-full px-2 py-1 border rounded text-xs"},[(R(!0),J(sn,null,bi(a.model.useCases,te=>(R(),J("option",{key:te.id,value:te.id},M(te.displayName||te.name),9,Chn))),128))],512),[[Rd,pe.value.sourceId]])]),E("div",null,[Se[39]||(Se[39]=E("label",{class:"text-[10px] text-gray-500"},"目标用例",-1)),Nn(E("select",{"onUpdate:modelValue":Se[22]||(Se[22]=te=>pe.value.targetId=te),class:"w-full px-2 py-1 border rounded text-xs"},[(R(!0),J(sn,null,bi(a.model.useCases,te=>(R(),J("option",{key:te.id,value:te.id},M(te.displayName||te.name),9,Shn))),128))],512),[[Rd,pe.value.targetId]])]),E("div",null,[Se[40]||(Se[40]=E("label",{class:"text-[10px] text-gray-500"},"关系类型",-1)),Nn(E("select",{"onUpdate:modelValue":Se[23]||(Se[23]=te=>pe.value.type=te),class:"w-full px-2 py-1 border rounded text-xs"},[(R(!0),J(sn,null,bi(A(se),te=>(R(),J("option",{key:te.value,value:te.value},M(te.label),9,_hn))),128))],512),[[Rd,pe.value.type]])]),E("div",jhn,[E("button",{class:"px-3 py-1 text-xs bg-gray-200 rounded hover:bg-gray-300",onClick:Se[24]||(Se[24]=te=>ye.value=!1)},"取消"),E("button",{class:"px-3 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50",disabled:!pe.value.sourceId||!pe.value.targetId,onClick:Se[25]||(Se[25]=te=>be())},"添加",8,Ihn)])])])):Ae("",!0)]))}}),Thn={class:"space-y-3"},Mhn={class:"flex items-center justify-between"},Phn={class:"text-[10px] text-gray-500 uppercase font-semibold"},Dhn={key:0,class:"space-y-1"},Ohn={class:"text-[10px] text-indigo-500 font-mono"},Lhn={class:"flex-1 truncate text-gray-700"},Nhn=["onClick"],Rhn={key:1,class:"text-[10px] text-gray-400"},Fhn={class:"max-h-32 overflow-y-auto space-y-0.5"},Bhn=["onClick"],Hhn={class:"text-[10px] text-gray-400 font-mono"},Ghn={class:"flex-1 truncate text-gray-600"},Jhn=wr({__name:"DomainLinkPanel",props:{useCase:{},availableElements:{}},emits:["update-links","suggest"],setup(a,{emit:d}){const b=a,m=d,w=Ye(""),$=En(()=>b.availableElements.filter(N=>b.useCase.domainElementIds.includes(N.id))),p=En(()=>{const N=w.value.toLowerCase();return b.availableElements.filter(P=>!b.useCase.domainElementIds.includes(P.id)).filter(P=>!N||P.name.toLowerCase().includes(N)||P.displayName.toLowerCase().includes(N))});function j(N){m("update-links",[...b.useCase.domainElementIds,N])}function I(N){m("update-links",b.useCase.domainElementIds.filter(P=>P!==N))}return(N,P)=>(R(),J("div",Thn,[E("div",Mhn,[E("label",Phn,"领域关联 ("+M($.value.length)+")",1),E("button",{class:"text-[10px] text-indigo-600 hover:text-indigo-800",onClick:P[0]||(P[0]=U=>m("suggest"))},"AI 推荐")]),$.value.length?(R(),J("div",Dhn,[(R(!0),J(sn,null,bi($.value,U=>(R(),J("div",{key:U.id,class:"flex items-center gap-2 px-2 py-1 bg-indigo-50 rounded text-xs"},[E("span",Ohn,M(U.type),1),E("span",Lhn,M(U.displayName||U.name),1),E("button",{class:"text-red-400 hover:text-red-600 text-xs",onClick:V=>I(U.id)},"×",8,Nhn)]))),128))])):(R(),J("div",Rhn,"暂无关联的领域元素")),E("div",null,[Nn(E("input",{"onUpdate:modelValue":P[1]||(P[1]=U=>w.value=U),class:"w-full px-2 py-1 border rounded text-xs mb-1",placeholder:"搜索领域元素..."},null,512),[[Ci,w.value]]),E("div",Fhn,[(R(!0),J(sn,null,bi(p.value,U=>(R(),J("div",{key:U.id,class:"flex items-center gap-2 px-2 py-1 hover:bg-gray-50 rounded text-xs cursor-pointer",onClick:V=>j(U.id)},[E("span",Hhn,M(U.type),1),E("span",Ghn,M(U.displayName||U.name),1),P[2]||(P[2]=E("span",{class:"text-blue-500 text-[10px]"},"+ 添加",-1))],8,Bhn))),128))])])]))}}),Uhn={class:"flex flex-col",style:{height:"calc(100vh - 220px)"}},zhn={class:"flex items-center gap-2 px-4 py-2 bg-white border-b border-gray-200"},qhn=["disabled"],Vhn=["disabled"],Khn=["disabled"],Whn=["disabled"],Xhn=["disabled"],Yhn={key:1,class:"text-xs text-gray-400"},Qhn={key:0},Zhn={key:0,class:"bg-red-50 border-b border-red-200 text-red-700 px-4 py-2 text-sm"},e1n={key:1,class:"bg-blue-50 border-b border-blue-200 px-4 py-2"},t1n={class:"flex items-center gap-2 text-sm"},n1n={class:"text-blue-700"},i1n={key:2,class:"border-b border-gray-200 bg-white"},r1n={class:"px-4 py-1.5 flex items-center justify-between bg-gray-50 border-b border-gray-100"},s1n={class:"text-xs font-medium text-gray-600"},o1n={class:"overflow-y-auto",style:{"max-height":"12rem"}},c1n={class:"text-gray-400 mr-2"},u1n={class:"flex-1 flex overflow-hidden"},l1n={key:0,class:"flex-1 relative"},a1n={key:1,class:"flex-1 flex items-center justify-center bg-gray-50"},f1n={class:"text-center"},d1n={class:"text-gray-500 mb-2"},h1n={key:2,class:"w-64 border-l border-gray-200 bg-white overflow-auto p-3"},g1n={key:3,class:"flex items-center gap-4 px-4 py-1.5 bg-gray-50 border-t border-gray-200 text-[10px] text-gray-500 overflow-x-auto"},b1n=wr({__name:"SystemUseCasePanel",setup(a){const{model:d,analyzing:b,analyzeProgress:m,loading:w,error:$,selectedUseCaseId:p,selectedUseCase:j,dirty:I,agentLogs:N,suggestingAssociations:P,loadModel:U,saveModel:V,runAnalysis:X,confirmAndPersist:ee,updateUseCase:K,removeUseCase:he,addRelationship:ke,removeRelationship:ue,suggestDomainAssociations:oe,updateDomainLinks:re}=mdn(),ye=Ye(!1),pe=Ye(!0),be=Ye(!1),se=Ye([]);async function le(){try{const gt=await Ewt();gt.model&&(se.value=gt.model.elements.map(ze=>({id:ze.id,name:ze.name,displayName:ze.displayName,type:ze.type})))}catch{}}const Ce={usecase:I3(Cdn),actor:I3(_dn)},Se=En(()=>{if(!d.value)return[];const gt=[],ze=new Set;for(const Jt of d.value.useCases){ze.add(Jt.primaryActor);for(const xe of Jt.auxiliaryActors)ze.add(xe)}for(const Jt of d.value.actors)ze.add(Jt);let jt=50;for(const Jt of ze)gt.push({id:`actor-${Jt}`,type:"actor",position:{x:50,y:jt},data:{name:Jt}}),jt+=120;for(const[Jt,xe]of d.value.useCases.entries())gt.push({id:xe.id,type:"usecase",position:xe.position??{x:300+Jt%3*250,y:50+Math.floor(Jt/3)*160},data:xe});return gt}),te=En(()=>{if(!d.value)return[];const gt=[];for(const ze of d.value.useCases){gt.push({id:`edge-actor-${ze.primaryActor}-${ze.id}`,source:`actor-${ze.primaryActor}`,target:ze.id,type:"default",style:{stroke:"#94A3B8"}});for(const jt of ze.auxiliaryActors)gt.push({id:`edge-actor-${jt}-${ze.id}`,source:`actor-${jt}`,target:ze.id,type:"default",style:{stroke:"#94A3B8",strokeDasharray:"4 3"}})}for(const ze of d.value.relationships){const jt=qO[ze.type];gt.push({id:ze.id,source:ze.sourceId,target:ze.targetId,label:ze.label||jt?.label||"",type:"default",style:{stroke:jt?.color||"#94A3B8",...jt?.style==="dashed"?{strokeDasharray:"6 3"}:{}},markerEnd:sL.ArrowClosed,data:ze})}return gt});function q(gt){gt.node.type==="usecase"&&(p.value=gt.node.id)}function He(){p.value=null}return gl(async()=>{await U(),await le()}),Jr(()=>b.value,async(gt,ze)=>{ze&&!gt&&await le()}),(gt,ze)=>(R(),J("div",Uhn,[E("div",zhn,[E("button",{class:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50",disabled:A(b),onClick:ze[0]||(ze[0]=jt=>A(X)(!1))},M(A(b)?"分析中...":"分析系统用例"),9,qhn),E("button",{class:"px-3 py-1.5 text-sm bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",disabled:A(b),onClick:ze[1]||(ze[1]=jt=>A(X)(!0))},"精炼分析",8,Vhn),E("button",{class:"px-3 py-1.5 text-sm bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50",disabled:!A(d)||A(w),onClick:ze[2]||(ze[2]=jt=>A(V)())}," 保存"+M(A(I)?" *":""),9,Khn),E("button",{class:"px-3 py-1.5 text-sm bg-purple-600 text-white rounded hover:bg-purple-700 disabled:opacity-50",disabled:!A(d)||A(w),onClick:ze[3]||(ze[3]=jt=>A(ee)())},"确认入库",8,Whn),E("button",{class:"px-3 py-1.5 text-sm bg-indigo-600 text-white rounded hover:bg-indigo-700 disabled:opacity-50",disabled:!A(d)||A(P),onClick:ze[4]||(ze[4]=jt=>A(oe)())},M(A(P)?"推荐中...":"推荐关联"),9,Xhn),ze[12]||(ze[12]=E("div",{class:"flex-1"},null,-1)),A(b)?(R(),J("button",{key:0,class:"px-2 py-1 text-xs text-gray-600 border rounded hover:bg-gray-50",onClick:ze[5]||(ze[5]=jt=>ye.value=!ye.value)},M(ye.value?"隐藏日志":"显示日志"),1)):Ae("",!0),E("button",{class:"px-2 py-1 text-xs text-gray-600 border rounded hover:bg-gray-50",onClick:ze[6]||(ze[6]=jt=>be.value=!be.value)},M(be.value?"隐藏关联":"领域关联"),1),E("button",{class:"px-2 py-1 text-xs text-gray-600 border rounded hover:bg-gray-50",onClick:ze[7]||(ze[7]=jt=>pe.value=!pe.value)},M(pe.value?"隐藏面板":"显示面板"),1),A(d)?(R(),J("div",Yhn,[ci(M(A(d).useCases.length)+" 用例 · "+M(A(d).relationships.length)+" 关系 ",1),A(d).analyzedAt?(R(),J("span",Qhn," · 分析于 "+M(new Date(A(d).analyzedAt).toLocaleString("zh-CN")),1)):Ae("",!0)])):Ae("",!0)]),A($)?(R(),J("div",Zhn,M(A($)),1)):Ae("",!0),A(b)&&A(m)?(R(),J("div",e1n,[E("div",t1n,[ze[13]||(ze[13]=E("svg",{class:"animate-spin h-4 w-4 text-blue-600",viewBox:"0 0 24 24",fill:"none"},[E("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),E("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),E("span",n1n,M(A(m).message),1)])])):Ae("",!0),A(b)&&ye.value&&A(N).length>0?(R(),J("div",i1n,[E("div",r1n,[E("span",s1n,"AI 实时日志 ("+M(A(N).length)+")",1)]),E("div",o1n,[(R(!0),J(sn,null,bi(A(N),(jt,Jt)=>(R(),J("div",{key:Jt,class:"px-4 py-1 text-xs text-gray-600 border-b border-gray-50"},[E("span",c1n,M(jt.type),1),E("span",null,M(jt.content),1)]))),128))])])):Ae("",!0),E("div",u1n,[A(d)&&A(d).useCases.length>0?(R(),J("div",l1n,[xr(A(Xvt),{nodes:Se.value,edges:te.value,"node-types":Ce,"default-viewport":{x:0,y:0,zoom:.8},"fit-view-on-init":"",onNodeClick:q,onPaneClick:He},{default:zg(()=>[xr(A(Zvt)),xr(A(e2t))]),_:1},8,["nodes","edges"])])):(R(),J("div",a1n,[E("div",f1n,[ze[14]||(ze[14]=E("div",{class:"text-6xl text-gray-300 mb-4"},"⚙",-1)),E("div",d1n,[A(w)?(R(),J(sn,{key:0},[ci("加载中...")],64)):A(b)?(R(),J(sn,{key:1},[ci("正在分析系统用例...")],64)):(R(),J(sn,{key:2},[ci("暂无系统用例数据")],64))]),!A(w)&&!A(b)?(R(),J("button",{key:0,class:"px-4 py-2 text-sm bg-blue-600 text-white rounded hover:bg-blue-700",onClick:ze[8]||(ze[8]=jt=>A(X)(!1))},"开始分析")):Ae("",!0)])])),be.value&&A(j)?(R(),J("div",h1n,[xr(Jhn,{"use-case":A(j),"available-elements":se.value,onUpdateLinks:ze[9]||(ze[9]=jt=>A(re)(A(p),jt)),onSuggest:ze[10]||(ze[10]=jt=>A(oe)())},null,8,["use-case","available-elements"])])):Ae("",!0),pe.value&&A(d)?(R(),Ts(Ahn,{key:3,model:A(d),"selected-use-case-id":A(p),onSelectUsecase:ze[11]||(ze[11]=jt=>p.value=jt),onUpdateUsecase:A(K),onRemoveUsecase:A(he),onAddRelationship:A(ke),onRemoveRelationship:A(ue)},null,8,["model","selected-use-case-id","onUpdateUsecase","onRemoveUsecase","onAddRelationship","onRemoveRelationship"])):Ae("",!0)]),A(d)?(R(),J("div",g1n,[ze[15]||(ze[15]=E("span",{class:"font-semibold text-gray-600"},"图例:",-1)),(R(!0),J(sn,null,bi(A(x3),(jt,Jt)=>(R(),J("span",{key:Jt,class:"flex items-center gap-1 whitespace-nowrap"},[E("span",{class:"inline-block w-3 h-3 rounded-full border",style:_c({backgroundColor:jt.bgColor,borderColor:jt.color})},null,4),ci(" "+M(jt.label),1)]))),128)),ze[16]||(ze[16]=E("span",{class:"text-gray-400"},"|",-1)),(R(!0),J(sn,null,bi(A(qO),(jt,Jt)=>(R(),J("span",{key:Jt,class:"whitespace-nowrap"},[E("span",{style:_c({color:jt.color})},M(jt.label),5)]))),128))])):Ae("",!0)]))}}),p1n={key:0,class:"fixed inset-0 z-50 flex items-center justify-center"},w1n={class:"relative bg-white rounded-xl shadow-2xl w-full max-w-xl max-h-[90vh] overflow-y-auto"},v1n={class:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between z-10 rounded-t-xl"},m1n={class:"text-lg font-bold text-gray-800"},y1n={class:"px-6 py-4 space-y-4"},k1n={class:"text-sm text-gray-500 mb-1"},x1n={class:"text-sm font-medium text-gray-800"},$1n={key:0},E1n={class:"text-sm text-gray-500 mb-1"},C1n={class:"text-sm text-gray-600 bg-gray-50 rounded-lg p-3 max-h-32 overflow-y-auto whitespace-pre-wrap"},S1n={class:"border-t border-gray-200 pt-4"},_1n={class:"text-sm font-semibold text-gray-700 mb-3"},j1n={class:"space-y-3"},I1n={class:"block text-xs font-medium text-gray-600 mb-1"},A1n=["value","placeholder"],T1n={class:"block text-xs font-medium text-gray-600 mb-1"},M1n=["value","placeholder"],P1n={class:"block text-xs font-medium text-gray-600 mb-1"},D1n=["value","placeholder"],O1n={class:"block text-xs font-medium text-gray-600 mb-1"},L1n=["value","placeholder"],N1n={class:"block text-xs font-medium text-gray-600 mb-1"},R1n=["value","placeholder"],F1n={class:"block text-xs font-medium text-gray-600 mb-1"},B1n=["value","placeholder"],H1n={class:"block text-xs font-medium text-gray-600 mb-1"},G1n=["value","placeholder"],J1n={class:"sticky bottom-0 bg-white border-t border-gray-200 px-6 py-4 flex justify-end space-x-3 rounded-b-xl"},U1n=["disabled"],z1n=wr({__name:"StartDialog",props:{issue:{},supplement:{},processing:{type:Boolean}},emits:["close","start","update:supplement"],setup(a,{emit:d}){const b=a,m=d;function w($,p){m("update:supplement",{...b.supplement,[$]:p})}return($,p)=>(R(),Ts(wwt,{name:"fade"},{default:zg(()=>[a.issue?(R(),J("div",p1n,[E("div",{class:"absolute inset-0 bg-black/30",onClick:p[0]||(p[0]=j=>m("close"))}),E("div",w1n,[E("div",v1n,[E("h2",m1n,M($.$t("start.title",{iid:a.issue.iid})),1),E("button",{class:"text-gray-400 hover:text-gray-600 text-2xl leading-none",onClick:p[1]||(p[1]=j=>m("close"))},"×")]),E("div",y1n,[E("div",null,[E("div",k1n,M($.$t("start.issueTitle")),1),E("div",x1n,M(a.issue.title),1)]),a.issue.description?(R(),J("div",$1n,[E("div",E1n,M($.$t("start.descPreview")),1),E("div",C1n,M(a.issue.description?.slice(0,500))+M((a.issue.description?.length||0)>500?"...":""),1)])):Ae("",!0),E("div",S1n,[E("h3",_1n,M($.$t("start.supplement")),1),E("div",j1n,[E("div",null,[E("label",I1n,M($.$t("start.requirements")),1),E("textarea",{value:a.supplement.requirements,onInput:p[2]||(p[2]=j=>w("requirements",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.requirementsPlaceholder")},null,40,A1n)]),E("div",null,[E("label",T1n,M($.$t("start.acceptance")),1),E("textarea",{value:a.supplement.acceptanceCriteria,onInput:p[3]||(p[3]=j=>w("acceptanceCriteria",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.acceptancePlaceholder")},null,40,M1n)]),E("div",null,[E("label",P1n,M($.$t("start.scope")),1),E("input",{value:a.supplement.scope,onInput:p[4]||(p[4]=j=>w("scope",j.target.value)),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.scopePlaceholder")},null,40,D1n)]),E("div",null,[E("label",O1n,M($.$t("start.constraints")),1),E("textarea",{value:a.supplement.constraints,onInput:p[5]||(p[5]=j=>w("constraints",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.constraintsPlaceholder")},null,40,L1n)]),E("div",null,[E("label",N1n,M($.$t("start.references")),1),E("textarea",{value:a.supplement.references,onInput:p[6]||(p[6]=j=>w("references",j.target.value)),rows:"1",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.referencesPlaceholder")},null,40,R1n)]),E("div",null,[E("label",F1n,M($.$t("start.freeText")),1),E("textarea",{value:a.supplement.freeText,onInput:p[7]||(p[7]=j=>w("freeText",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.freeTextPlaceholder")},null,40,B1n)]),E("div",null,[E("label",H1n,M($.$t("start.tapdId")),1),E("input",{value:a.supplement.tapdId,onInput:p[8]||(p[8]=j=>w("tapdId",j.target.value)),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.tapdIdPlaceholder")},null,40,G1n)])])])]),E("div",J1n,[E("button",{class:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200",onClick:p[9]||(p[9]=j=>m("close"))},M($.$t("start.cancel")),1),E("button",{class:"px-4 py-2 text-sm text-white bg-green-500 rounded-lg hover:bg-green-600 font-medium disabled:opacity-50",disabled:a.processing,onClick:p[10]||(p[10]=j=>m("start"))},M(a.processing?$.$t("start.processing"):$.$t("start.submit")),9,U1n)])])])):Ae("",!0)]),_:1}))}}),q1n={key:0,class:"text-base font-semibold text-gray-700 mb-3"},V1n={key:1,class:"flex flex-col gap-1"},K1n={class:"flex items-center gap-3"},W1n={key:0},X1n={key:1,class:"pulse-dot"},Y1n={key:2},Q1n={key:3},Z1n={class:"flex-1 min-w-0"},e0n={class:"flex items-center gap-2"},t0n={key:0,class:"text-xs text-gray-400"},n0n=["onClick"],i0n={key:0,class:"ml-3.5 relative"},r0n={key:2,class:"flex items-center justify-between"},s0n={class:"flex flex-col items-center space-y-1"},o0n={key:0},c0n={key:1,class:"pulse-dot"},u0n={key:2},l0n={key:3},a0n={class:"text-xs text-gray-600"},f0n={key:0,class:"text-xs text-gray-400"},d0n=["onClick"],h0n={key:0,class:"flex-1 relative mx-2"},g0n=["title"],t2t=wr({__name:"PipelineProgress",props:{issue:{},progress:{},verifyFixLoop:{},vertical:{type:Boolean}},emits:["retryFromPhase"],setup(a,{emit:d}){const b=a,m=d,{getPhaseNames:w,phaseLabel:$,phaseNodeClass:p,phaseStatus:j}=r_();function I(P){return b.progress?.phases?.[P]?b.progress.phases[P].status:j(b.issue,P)}function N(P){if(!b.progress?.phases)return"";const U=b.progress.phases[P];if(!U?.startedAt)return"";const V=new Date(U.startedAt),X=U.completedAt?new Date(U.completedAt):new Date;return Awt(X.getTime()-V.getTime())}return(P,U)=>(R(),J("div",null,[a.vertical?Ae("",!0):(R(),J("h3",q1n,M(P.$t("pipeline.title")),1)),a.vertical?(R(),J("div",V1n,[(R(!0),J(sn,null,bi(A(w)(a.issue),(V,X)=>(R(),J(sn,{key:V},[E("div",K1n,[E("div",{class:wn(["w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0",A(p)(I(V))])},[I(V)==="completed"?(R(),J("span",W1n,"✓")):I(V)==="in_progress"?(R(),J("span",X1n,"●")):I(V)==="failed"?(R(),J("span",Y1n,"✗")):(R(),J("span",Q1n,M(X+1),1))],2),E("div",Z1n,[E("div",e0n,[E("span",{class:wn(["text-sm font-medium",I(V)==="in_progress"?"text-blue-600":"text-gray-700"])},M(A($)(V)),3),N(V)?(R(),J("span",t0n,M(N(V)),1)):Ae("",!0)])]),E("button",{class:"text-xs text-gray-400 hover:text-blue-600 hover:underline flex-shrink-0",onClick:ee=>m("retryFromPhase",V)},M(P.$t("pipeline.retryFrom")),9,n0n)]),X<A(w)(a.issue).length-1?(R(),J("div",i0n,[E("div",{class:wn(["w-px h-3",I(V)==="completed"?"bg-green-400":"bg-gray-200"])},null,2),a.verifyFixLoop&&a.verifyFixLoop.iteration>0&&V==="build"?(R(),J("span",{key:0,class:wn(["absolute -left-1 top-0 text-xs rounded-full px-1.5 py-0.5 font-medium whitespace-nowrap border",a.verifyFixLoop.active?"bg-amber-100 text-amber-700 border-amber-300":a.verifyFixLoop.lastPassed?"bg-green-100 text-green-700 border-green-300":"bg-red-100 text-red-700 border-red-300"]),style:{"margin-left":"24px"}},"⟲ "+M(a.verifyFixLoop.iteration)+"/"+M(a.verifyFixLoop.maxIterations),3)):Ae("",!0)])):Ae("",!0)],64))),128))])):(R(),J("div",r0n,[(R(!0),J(sn,null,bi(A(w)(a.issue),(V,X)=>(R(),J(sn,{key:V},[E("div",s0n,[E("div",{class:wn(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-bold",A(p)(I(V))])},[I(V)==="completed"?(R(),J("span",o0n,"✓")):I(V)==="in_progress"?(R(),J("span",c0n,"●")):I(V)==="failed"?(R(),J("span",u0n,"✗")):(R(),J("span",l0n,M(X+1),1))],2),E("span",a0n,M(A($)(V)),1),N(V)?(R(),J("span",f0n,M(N(V)),1)):Ae("",!0),E("button",{class:"text-xs text-blue-500 hover:text-blue-700 hover:underline mt-0.5",onClick:ee=>m("retryFromPhase",V)},M(P.$t("pipeline.retryFrom")),9,d0n)]),X<A(w)(a.issue).length-1?(R(),J("div",h0n,[E("div",{class:wn(["h-0.5",I(A(w)(a.issue)[X])==="completed"?"bg-green-400":"bg-gray-200"])},null,2),a.verifyFixLoop&&a.verifyFixLoop.iteration>0&&V==="build"?(R(),J("span",{key:0,class:wn(["absolute -top-3.5 left-1/2 -translate-x-1/2 text-xs rounded-full px-1.5 py-0.5 font-medium whitespace-nowrap border",a.verifyFixLoop.active?"bg-amber-100 text-amber-700 border-amber-300":a.verifyFixLoop.lastPassed?"bg-green-100 text-green-700 border-green-300":"bg-red-100 text-red-700 border-red-300"]),title:P.$t("verify.loopBadgeTooltip",{n:a.verifyFixLoop.iteration,max:a.verifyFixLoop.maxIterations})},"⟲ "+M(a.verifyFixLoop.iteration)+"/"+M(a.verifyFixLoop.maxIterations),11,g0n)):Ae("",!0)])):Ae("",!0)],64))),128))]))]))}}),b0n={class:"bg-yellow-50 border-2 border-yellow-300 rounded-lg p-4"},p0n={class:"text-base font-semibold text-yellow-800 mb-3"},w0n={class:"text-sm text-yellow-700 mb-3"},v0n={key:0,class:"text-yellow-600 font-medium"},m0n={key:0,class:"mb-4"},y0n={class:"flex items-center mb-2"},k0n={class:"text-xs font-semibold text-yellow-700"},x0n={class:"ml-2 px-1.5 py-0.5 text-xs bg-yellow-200 text-yellow-800 rounded-full"},$0n={class:"space-y-2 max-h-48 overflow-y-auto border border-yellow-200 rounded-lg bg-white/60 p-3"},E0n={class:"flex items-baseline space-x-2 mb-0.5"},C0n={class:"text-xs font-semibold text-yellow-700"},S0n={class:"text-xs text-gray-400"},_0n={class:"text-sm text-gray-700 whitespace-pre-wrap break-words"},j0n={class:"flex items-center space-x-3 mb-3"},I0n=["disabled"],A0n=["disabled"],T0n={class:"space-y-2"},M0n={class:"block text-xs font-medium text-yellow-700"},P0n=["placeholder"],D0n=["disabled"],n2t=wr({__name:"ReviewGatePanel",props:cX({reviewSubmitting:{type:Boolean},reviewHistory:{}},{reviewFeedback:{required:!0},reviewFeedbackModifiers:{}}),emits:cX(["approve","reject","skip"],["update:reviewFeedback"]),setup(a,{emit:d}){const b=ime(a,"reviewFeedback"),m=d;function w($){try{return new Date($).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return $}}return($,p)=>(R(),J("div",b0n,[E("h3",p0n,M($.$t("review.title")),1),E("p",w0n,[ci(M($.$t("review.description"))+" ",1),a.reviewHistory.length>0?(R(),J("span",v0n,M($.$t("review.currentRound",{round:a.reviewHistory.length+1})),1)):Ae("",!0)]),a.reviewHistory.length>0?(R(),J("div",m0n,[E("div",y0n,[E("span",k0n,M($.$t("review.history")),1),E("span",x0n,M($.$t("review.roundLabel",{n:a.reviewHistory.length})),1)]),E("div",$0n,[(R(!0),J(sn,null,bi(a.reviewHistory,j=>(R(),J("div",{key:j.round,class:wn(["relative pl-5 pb-2 border-l-2",j.round===a.reviewHistory.length?"border-yellow-500":"border-yellow-200"])},[E("div",{class:wn(["absolute left-[-5px] top-1 w-2 h-2 rounded-full",j.round===a.reviewHistory.length?"bg-yellow-500":"bg-yellow-300"])},null,2),E("div",E0n,[E("span",C0n,M($.$t("review.roundPrefix",{round:j.round})),1),E("span",S0n,M(w(j.timestamp)),1)]),E("p",_0n,M(j.feedback),1)],2))),128))])])):Ae("",!0),E("div",j0n,[E("button",{class:"px-4 py-2 bg-green-500 text-white text-sm rounded-lg hover:bg-green-600 font-medium disabled:opacity-50",disabled:a.reviewSubmitting,onClick:p[0]||(p[0]=j=>m("approve"))},M(a.reviewSubmitting?$.$t("review.submitting"):$.$t("review.approve")),9,I0n),E("button",{class:"px-4 py-2 bg-gray-400 text-white text-sm rounded-lg hover:bg-gray-500 font-medium disabled:opacity-50",disabled:a.reviewSubmitting,onClick:p[1]||(p[1]=j=>m("skip"))},M($.$t("review.skip")),9,A0n)]),E("div",T0n,[E("label",M0n,M($.$t("review.feedbackLabel")),1),Nn(E("textarea",{"onUpdate:modelValue":p[2]||(p[2]=j=>b.value=j),rows:"3",class:"w-full border border-yellow-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-yellow-400",placeholder:$.$t("review.feedbackPlaceholder")},null,8,P0n),[[Ci,b.value]]),E("button",{class:"px-4 py-2 bg-red-500 text-white text-sm rounded-lg hover:bg-red-600 font-medium disabled:opacity-50",disabled:a.reviewSubmitting||!b.value.trim(),onClick:p[3]||(p[3]=j=>m("reject"))},M($.$t("review.reject")),9,D0n)])]))}}),O0n={class:"flex items-center justify-between mb-2"},L0n={class:"text-base font-semibold text-gray-700"},N0n={class:"flex items-center space-x-2"},R0n=["disabled"],F0n={key:0,class:"py-4 text-center text-gray-400 text-sm"},B0n={key:1},H0n={key:0,class:"space-y-2 text-sm"},G0n={key:0},J0n={class:"text-gray-500 font-medium"},U0n={class:"text-gray-700"},z0n={key:1},q0n={class:"text-gray-500 font-medium"},V0n={class:"text-gray-700"},K0n={key:2},W0n={class:"text-gray-500 font-medium"},X0n={class:"text-gray-700"},Y0n={key:3},Q0n={class:"text-gray-500 font-medium"},Z0n={class:"text-gray-700"},egn={key:4},tgn={class:"text-gray-500 font-medium"},ngn={class:"text-gray-700"},ign={key:5},rgn={class:"text-gray-500 font-medium"},sgn={class:"text-gray-700"},ogn={key:6},cgn={class:"text-gray-500 font-medium"},ugn={class:"text-gray-700"},lgn={key:1,class:"py-4 text-center text-gray-400 text-sm"},agn={key:2,class:"space-y-3"},fgn={class:"block text-xs font-medium text-gray-600 mb-1"},dgn=["value"],hgn={class:"block text-xs font-medium text-gray-600 mb-1"},ggn=["value"],bgn={class:"block text-xs font-medium text-gray-600 mb-1"},pgn=["value"],wgn={class:"block text-xs font-medium text-gray-600 mb-1"},vgn=["value"],mgn={class:"block text-xs font-medium text-gray-600 mb-1"},ygn=["value"],kgn={class:"block text-xs font-medium text-gray-600 mb-1"},xgn=["value"],$gn={class:"block text-xs font-medium text-gray-600 mb-1"},Egn=["value","placeholder"],i2t=wr({__name:"SupplementEditor",props:{supplement:{},supplementForm:{},loading:{type:Boolean},editing:{type:Boolean},saving:{type:Boolean},hasData:{type:Boolean}},emits:["edit","save","cancel","update:supplementForm"],setup(a,{emit:d}){const b=a,m=d;function w($,p){m("update:supplementForm",{...b.supplementForm,[$]:p})}return($,p)=>(R(),J("div",null,[E("div",O0n,[E("h3",L0n,M($.$t("supplement.title")),1),E("div",N0n,[a.editing?(R(),J(sn,{key:1},[E("button",{class:"px-2 py-1 text-xs bg-green-500 text-white rounded hover:bg-green-600",disabled:a.saving,onClick:p[1]||(p[1]=j=>m("save"))},M(a.saving?$.$t("supplement.saving"):$.$t("supplement.save")),9,R0n),E("button",{class:"px-2 py-1 text-xs bg-gray-200 text-gray-600 rounded hover:bg-gray-300",onClick:p[2]||(p[2]=j=>m("cancel"))},M($.$t("supplement.cancel")),1)],64)):(R(),J("button",{key:0,class:"px-2 py-1 text-xs bg-blue-100 text-blue-600 rounded hover:bg-blue-200",onClick:p[0]||(p[0]=j=>m("edit"))},M($.$t("supplement.edit")),1))])]),a.loading?(R(),J("div",F0n,M($.$t("supplement.loading")),1)):a.editing?(R(),J("div",agn,[E("div",null,[E("label",fgn,M($.$t("supplement.requirementsLabel")),1),E("textarea",{value:a.supplementForm.requirements,onInput:p[3]||(p[3]=j=>w("requirements",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,dgn)]),E("div",null,[E("label",hgn,M($.$t("supplement.acceptanceLabel")),1),E("textarea",{value:a.supplementForm.acceptanceCriteria,onInput:p[4]||(p[4]=j=>w("acceptanceCriteria",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,ggn)]),E("div",null,[E("label",bgn,M($.$t("supplement.scopeLabel")),1),E("input",{value:a.supplementForm.scope,onInput:p[5]||(p[5]=j=>w("scope",j.target.value)),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,pgn)]),E("div",null,[E("label",wgn,M($.$t("supplement.constraintsLabel")),1),E("textarea",{value:a.supplementForm.constraints,onInput:p[6]||(p[6]=j=>w("constraints",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,vgn)]),E("div",null,[E("label",mgn,M($.$t("supplement.referencesLabel")),1),E("textarea",{value:a.supplementForm.references,onInput:p[7]||(p[7]=j=>w("references",j.target.value)),rows:"1",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,ygn)]),E("div",null,[E("label",kgn,M($.$t("supplement.freeTextLabel")),1),E("textarea",{value:a.supplementForm.freeText,onInput:p[8]||(p[8]=j=>w("freeText",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,xgn)]),E("div",null,[E("label",$gn,M($.$t("supplement.tapdIdLabel")),1),E("input",{value:a.supplementForm.tapdId,onInput:p[9]||(p[9]=j=>w("tapdId",j.target.value)),type:"text",placeholder:$.$t("supplement.tapdIdPlaceholder"),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,Egn)])])):(R(),J("div",B0n,[a.hasData?(R(),J("div",H0n,[a.supplement.requirements?(R(),J("div",G0n,[E("span",J0n,M($.$t("supplement.requirements")),1),p[10]||(p[10]=ci()),E("span",U0n,M(a.supplement.requirements),1)])):Ae("",!0),a.supplement.acceptanceCriteria?(R(),J("div",z0n,[E("span",q0n,M($.$t("supplement.acceptance")),1),p[11]||(p[11]=ci()),E("span",V0n,M(a.supplement.acceptanceCriteria),1)])):Ae("",!0),a.supplement.scope?(R(),J("div",K0n,[E("span",W0n,M($.$t("supplement.scope")),1),p[12]||(p[12]=ci()),E("span",X0n,M(a.supplement.scope),1)])):Ae("",!0),a.supplement.constraints?(R(),J("div",Y0n,[E("span",Q0n,M($.$t("supplement.constraints")),1),p[13]||(p[13]=ci()),E("span",Z0n,M(a.supplement.constraints),1)])):Ae("",!0),a.supplement.references?(R(),J("div",egn,[E("span",tgn,M($.$t("supplement.references")),1),p[14]||(p[14]=ci()),E("span",ngn,M(a.supplement.references),1)])):Ae("",!0),a.supplement.freeText?(R(),J("div",ign,[E("span",rgn,M($.$t("supplement.freeText")),1),p[15]||(p[15]=ci()),E("span",sgn,M(a.supplement.freeText),1)])):Ae("",!0),a.supplement.tapdId?(R(),J("div",ogn,[E("span",cgn,M($.$t("supplement.tapdId")),1),p[16]||(p[16]=ci()),E("span",ugn,M(a.supplement.tapdId),1)])):Ae("",!0)])):(R(),J("div",lgn,M($.$t("supplement.empty")),1))]))]))}}),Cgn={class:"flex items-center justify-between mb-2"},Sgn={class:"text-base font-semibold text-gray-700"},_gn={class:"flex items-center space-x-2"},jgn={class:"flex items-center space-x-1 text-xs text-gray-500 cursor-pointer"},Ign={class:"flex items-center space-x-1 text-xs text-gray-500 cursor-pointer"},Agn={key:0,class:"border border-gray-200 rounded-lg p-6 text-center text-gray-400 text-sm"},Tgn={class:"text-xs mt-1"},Mgn={key:0,class:"text-xs mt-1"},Pgn={class:"log-badge"},Dgn={class:"text-gray-400 text-xs mr-1"},Ogn={key:0,class:"text-gray-400 text-xs mr-1"},Lgn={class:"text-gray-700 break-all"},Ngn={key:2,class:"text-xs text-gray-400 mt-1 text-right"},r2t=wr({__name:"AgentLogViewer",props:cX({logs:{},issueState:{},currentPhase:{}},{autoScroll:{type:Boolean,default:!0},autoScrollModifiers:{},debugMode:{type:Boolean,default:!1},debugModeModifiers:{}}),emits:cX(["clear"],["update:autoScroll","update:debugMode"]),setup(a,{emit:d}){const b=d,m=ime(a,"autoScroll"),w=ime(a,"debugMode"),{stateLabel:$,isTerminalState:p}=r_(),{agentLogContainer:j,agentLogLabel:I}=JX();return(N,P)=>(R(),J("div",null,[E("div",Cgn,[E("h3",Sgn,M(N.$t("agentLog.title")),1),E("div",_gn,[E("label",jgn,[Nn(E("input",{type:"checkbox","onUpdate:modelValue":P[0]||(P[0]=U=>m.value=U),class:"rounded"},null,512),[[a9,m.value]]),E("span",null,M(N.$t("agentLog.autoScroll")),1)]),E("label",Ign,[Nn(E("input",{type:"checkbox","onUpdate:modelValue":P[1]||(P[1]=U=>w.value=U),class:"rounded"},null,512),[[a9,w.value]]),P[3]||(P[3]=E("span",null,"Debug",-1))]),E("button",{class:"px-2 py-0.5 text-xs bg-gray-200 text-gray-600 rounded hover:bg-gray-300",onClick:P[2]||(P[2]=U=>b("clear"))},M(N.$t("agentLog.clear")),1)])]),a.logs.length===0?(R(),J("div",Agn,[a.issueState&&A(p)(a.issueState)?(R(),J(sn,{key:0},[P[4]||(P[4]=E("svg",{class:"h-5 w-5 mx-auto mb-2 text-gray-300",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-3-3v6m-7 4h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)),E("div",null,M(N.$t("agentLog.ended")),1),E("div",Tgn,[ci(M(N.$t("agentLog.finalState"))+" ",1),E("span",{class:wn(a.issueState==="completed"?"text-green-500":"text-red-500")},M(A($)(a.issueState,a.currentPhase)),3)])],64)):(R(),J(sn,{key:1},[P[5]||(P[5]=E("svg",{class:"animate-spin h-5 w-5 mx-auto mb-2 text-blue-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[E("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),E("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),E("div",null,M(N.$t("agentLog.waiting")),1),a.issueState?(R(),J("div",Mgn,M(N.$t("agentLog.currentState"))+" "+M(A($)(a.issueState,a.currentPhase)),1)):Ae("",!0)],64))])):(R(),J("div",{key:1,ref_key:"agentLogContainer",ref:j,class:"agent-log border border-gray-200 rounded-lg overflow-y-auto bg-white",style:{"max-height":"20rem"}},[(R(!0),J(sn,null,bi(a.logs,(U,V)=>(R(),J("div",{key:V,class:wn(["agent-log-item","log-"+U.type])},[E("span",Pgn,M(A(I)(U.type)),1),E("span",Dgn,M(A(Twt)(U.timestamp)),1),U.phase?(R(),J("span",Ogn,"["+M(U.phase)+"]",1)):Ae("",!0),E("span",Lgn,M(U.summary),1)],2))),128))],512)),a.logs.length>0?(R(),J("div",Ngn,M(N.$t("agentLog.count",{count:a.logs.length})),1)):Ae("",!0)]))}}),Rgn={class:"flex items-center justify-between mb-2"},Fgn={class:"text-base font-semibold text-gray-700"},Bgn={class:"flex items-center space-x-2"},Hgn=["disabled"],Ggn=["title"],Jgn={class:"flex space-x-1 mb-3 border-b border-gray-200"},Ugn=["onClick"],zgn={key:0,class:"py-8 text-center text-gray-400"},qgn={key:1,class:"py-8 text-center text-gray-400"},Vgn={key:2},Kgn=["placeholder"],Wgn=["innerHTML"],Xgn={key:4,class:"py-8 text-center text-gray-400"},Ygn={key:0,class:"fullscreen-doc-overlay"},Qgn={class:"fullscreen-doc-container"},Zgn={class:"flex items-center justify-between px-6 py-4 border-b border-gray-200 shrink-0"},ebn={class:"flex items-center space-x-3"},tbn={class:"text-lg font-bold text-gray-800"},nbn={class:"text-sm text-gray-400"},ibn={class:"flex items-center space-x-2"},rbn=["disabled"],sbn=["title"],obn={class:"flex space-x-1 px-6 pt-3 border-b border-gray-200 shrink-0"},cbn=["onClick"],ubn={class:"flex-1 overflow-y-auto min-h-0"},lbn={key:0,class:"flex items-center justify-center h-full text-gray-400"},abn={class:"text-base"},fbn={key:1,class:"flex items-center justify-center h-full text-gray-400"},dbn={class:"text-base"},hbn={key:2,class:"h-full p-4"},gbn=["placeholder"],bbn=["innerHTML"],pbn={key:4,class:"flex items-center justify-center h-full text-gray-400"},wbn={class:"text-base"},s2t=wr({__name:"PlanDocViewer",props:{issueIid:{},planDocs:{},isEditableDoc:{type:Function},detailVersion:{}},setup(a,{expose:d}){const b=a;Jr(()=>b.detailVersion,()=>{m.value&&ee(m.value)});const m=Ye(null),w=Ye(""),$=Ye(!1),p=Ye(""),j=Ye(!1),I=Ye(""),N=Ye(!1),P=Ye(!1),U=Ye(!1),{t:V}=Kg(),X={"review-feedback.md":()=>V("planDoc.noReviewFeedback"),"02-verify-report.md":()=>V("planDoc.verifyNotGenerated"),"04-verify-report.md":()=>V("planDoc.verifyNotGenerated")};async function ee(ye){m.value=ye,j.value=!1,I.value="",$.value=!0,w.value="",p.value="",P.value=!1;try{w.value=await Rgt(b.issueIid,ye,"html")}catch(pe){const be=pe.message;be.includes("not found")&&ye in X?(P.value=!0,p.value=X[ye]()):p.value=be}finally{$.value=!1}}async function K(){if(m.value)try{I.value=await Rgt(b.issueIid,m.value,"raw"),j.value=!0}catch(ye){alert(V("planDoc.fetchFailed")+" "+ye.message)}}function he(){j.value=!1,I.value="",m.value&&ee(m.value)}async function ke(){if(m.value){N.value=!0;try{await TKt(b.issueIid,m.value,I.value),j.value=!1,I.value="",await ee(m.value)}catch(ye){alert(V("planDoc.saveFailed")+" "+ye.message)}finally{N.value=!1}}}function ue(){U.value=!0,document.body.style.overflow="hidden",!m.value&&b.planDocs.length>0&&ee(b.planDocs[0].file)}function oe(){U.value=!1,document.body.style.overflow=""}function re(ye){ye.key==="Escape"&&U.value&&oe()}return gl(()=>{document.addEventListener("keydown",re),b.planDocs.length>0&&ee(b.planDocs[0].file)}),dp(()=>{document.removeEventListener("keydown",re),document.body.style.overflow=""}),d({activeDoc:m}),(ye,pe)=>(R(),J("div",null,[E("div",Rgn,[E("h3",Fgn,M(ye.$t("planDoc.title")),1),E("div",Bgn,[m.value&&a.isEditableDoc(m.value)&&!U.value?(R(),J(sn,{key:0},[j.value?(R(),J(sn,{key:1},[E("button",{class:"px-2 py-1 text-xs bg-green-500 text-white rounded hover:bg-green-600",disabled:N.value,onClick:pe[1]||(pe[1]=be=>ke())},M(N.value?ye.$t("planDoc.saving"):ye.$t("planDoc.save")),9,Hgn),E("button",{class:"px-2 py-1 text-xs bg-gray-200 text-gray-600 rounded hover:bg-gray-300",onClick:pe[2]||(pe[2]=be=>he())},M(ye.$t("planDoc.cancel")),1)],64)):(R(),J("button",{key:0,class:"px-2 py-1 text-xs bg-blue-100 text-blue-600 rounded hover:bg-blue-200",onClick:pe[0]||(pe[0]=be=>K())},M(ye.$t("planDoc.edit")),1))],64)):Ae("",!0),E("button",{class:"px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded hover:bg-gray-200 inline-flex items-center space-x-1",title:ye.$t("planDoc.fullscreen"),onClick:pe[3]||(pe[3]=be=>ue())},[pe[10]||(pe[10]=E("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})],-1)),E("span",null,M(ye.$t("planDoc.expand")),1)],8,Ggn)])]),E("div",Jgn,[(R(!0),J(sn,null,bi(a.planDocs,be=>(R(),J("button",{key:be.file,class:wn(["px-3 py-2 text-sm font-medium border-b-2 transition-colors",m.value===be.file?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"]),onClick:se=>ee(be.file)},M(be.label),11,Ugn))),128))]),$.value?(R(),J("div",zgn,M(ye.$t("planDoc.loading")),1)):p.value?(R(),J("div",qgn,M(p.value),1)):j.value&&!U.value?(R(),J("div",Vgn,[Nn(E("textarea",{"onUpdate:modelValue":pe[4]||(pe[4]=be=>I.value=be),class:"w-full h-96 border border-gray-300 rounded-lg p-3 text-sm font-mono text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:ye.$t("planDoc.editPlaceholder")},null,8,Kgn),[[Ci,I.value]])])):w.value&&!U.value?(R(),J("div",{key:3,class:"plan-doc text-sm text-gray-700 max-h-96 overflow-y-auto border border-gray-100 rounded-lg p-4",innerHTML:w.value},null,8,Wgn)):U.value?Ae("",!0):(R(),J("div",Xgn,M(ye.$t("planDoc.selectTab")),1)),(R(),Ts(Lme,{to:"body"},[xr(wwt,{name:"fullscreen-fade"},{default:zg(()=>[U.value?(R(),J("div",Ygn,[E("div",Qgn,[E("div",Zgn,[E("div",ebn,[E("h2",tbn,M(ye.$t("planDoc.title")),1),E("span",nbn,"Issue #"+M(a.issueIid),1)]),E("div",ibn,[m.value&&a.isEditableDoc(m.value)?(R(),J(sn,{key:0},[j.value?(R(),J(sn,{key:1},[E("button",{class:"px-3 py-1.5 text-sm bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors",disabled:N.value,onClick:pe[6]||(pe[6]=be=>ke())},M(N.value?ye.$t("planDoc.saving"):ye.$t("planDoc.save")),9,rbn),E("button",{class:"px-3 py-1.5 text-sm bg-gray-200 text-gray-600 rounded-lg hover:bg-gray-300 transition-colors",onClick:pe[7]||(pe[7]=be=>he())},M(ye.$t("planDoc.cancel")),1)],64)):(R(),J("button",{key:0,class:"px-3 py-1.5 text-sm bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors",onClick:pe[5]||(pe[5]=be=>K())},M(ye.$t("planDoc.edit")),1))],64)):Ae("",!0),E("button",{class:"ml-2 p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",title:ye.$t("planDoc.closeFullscreen"),onClick:pe[8]||(pe[8]=be=>oe())},[...pe[11]||(pe[11]=[E("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,sbn)])]),E("div",obn,[(R(!0),J(sn,null,bi(a.planDocs,be=>(R(),J("button",{key:"fs-"+be.file,class:wn(["px-4 py-2.5 text-sm font-medium border-b-2 transition-colors",m.value===be.file?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"]),onClick:se=>ee(be.file)},M(be.label),11,cbn))),128))]),E("div",ubn,[$.value?(R(),J("div",lbn,[E("span",abn,M(ye.$t("planDoc.loading")),1)])):p.value?(R(),J("div",fbn,[E("span",dbn,M(p.value),1)])):j.value?(R(),J("div",hbn,[Nn(E("textarea",{"onUpdate:modelValue":pe[9]||(pe[9]=be=>I.value=be),class:"w-full h-full border border-gray-300 rounded-lg p-4 text-sm font-mono text-gray-700 resize-none focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:ye.$t("planDoc.editPlaceholder")},null,8,gbn),[[Ci,I.value]])])):w.value?(R(),J("div",{key:3,class:"plan-doc text-sm text-gray-700 p-6",innerHTML:w.value},null,8,bbn)):(R(),J("div",pbn,[E("span",wbn,M(ye.$t("planDoc.selectTab")),1)]))])])])):Ae("",!0)]),_:1})]))]))}}),vbn={class:"bg-white rounded-xl shadow-2xl w-[90vw] max-w-5xl max-h-[90vh] flex flex-col overflow-hidden"},mbn={class:"flex items-center justify-between px-6 py-4 border-b border-gray-200 bg-gray-50"},ybn={class:"text-lg font-bold text-gray-800"},kbn={key:0,class:"text-sm text-gray-500 mt-0.5"},xbn={class:"text-xs text-gray-400 ml-2"},$bn={key:0,class:"flex-1 flex items-center justify-center py-12"},Ebn={class:"text-sm text-gray-400"},Cbn={key:1,class:"flex-1 flex items-center justify-center py-12"},Sbn={class:"text-sm text-red-500"},_bn={class:"flex border-b border-gray-200 px-6 bg-white"},jbn=["onClick"],Ibn={class:"flex-1 overflow-y-auto px-6 py-4"},Abn={key:0,class:"space-y-4"},Tbn={class:"grid grid-cols-4 gap-3"},Mbn={class:"bg-blue-50 rounded-lg p-4 text-center"},Pbn={class:"text-2xl font-bold text-blue-600"},Dbn={class:"text-xs text-blue-500 mt-1"},Obn={class:"bg-amber-50 rounded-lg p-4 text-center"},Lbn={class:"text-2xl font-bold text-amber-600"},Nbn={class:"text-xs text-amber-500 mt-1"},Rbn={class:"bg-purple-50 rounded-lg p-4 text-center"},Fbn={class:"text-2xl font-bold text-purple-600"},Bbn={class:"text-xs text-purple-500 mt-1"},Hbn={class:"bg-green-50 rounded-lg p-4 text-center"},Gbn={class:"text-2xl font-bold text-green-600"},Jbn={class:"text-xs text-green-500 mt-1"},Ubn={class:"bg-gray-50 rounded-lg p-4"},zbn={class:"flex items-center justify-between mb-2"},qbn={class:"text-sm font-medium text-gray-700"},Vbn={class:"text-sm text-gray-500"},Kbn={class:"w-full bg-gray-200 rounded-full h-2.5"},Wbn={class:"text-sm font-semibold text-gray-700 mb-2"},Xbn={class:"space-y-1.5"},Ybn=["onClick"],Qbn={class:"text-sm text-gray-700 flex-1 truncate"},Zbn={key:0,class:"text-xs text-green-600 bg-green-50 px-1.5 py-0.5 rounded"},epn={class:"text-xs text-gray-400"},tpn={key:1,class:"space-y-3"},npn={key:0,class:"text-sm text-gray-400 text-center py-8"},ipn=["onClick"],rpn={class:"text-sm font-medium text-gray-800 flex-1"},spn={key:0,class:"text-xs text-green-600 bg-green-50 px-1.5 py-0.5 rounded"},opn={class:"text-xs text-gray-400 font-mono"},cpn={key:0,class:"px-4 py-3 space-y-3 border-t border-gray-100"},upn={key:0},lpn={class:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1"},apn={class:"list-decimal list-inside text-sm text-gray-600 space-y-0.5 pl-1"},fpn={key:1},dpn={class:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1"},hpn={class:"list-decimal list-inside text-sm text-gray-600 space-y-0.5 pl-1"},gpn={key:2},bpn={class:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1"},ppn={class:"list-decimal list-inside text-sm text-gray-600 space-y-0.5 pl-1"},wpn={class:"text-xs text-gray-400 pt-1 border-t border-gray-100 font-mono"},vpn={key:2,class:"space-y-4"},mpn={class:"text-sm font-semibold text-gray-700 mb-2"},ypn={class:"text-xs font-normal text-gray-400 ml-1"},kpn={key:0,class:"grid grid-cols-2 gap-1.5"},xpn={class:"flex-shrink-0"},$pn={class:"font-mono text-xs flex-shrink-0"},Epn={class:"truncate"},Cpn={key:1,class:"text-sm text-gray-400 py-2"},Spn={class:"text-sm font-semibold text-gray-700 mb-2"},_pn={class:"text-xs font-normal text-gray-400 ml-1"},jpn={key:0,class:"grid grid-cols-2 gap-1.5"},Ipn={class:"flex-shrink-0"},Apn={class:"truncate"},Tpn={key:1,class:"text-sm text-gray-400 py-2"},Mpn=wr({__name:"ScenarioViewer",props:{url:{}},emits:["close"],setup(a,{emit:d}){const b=a,m=d,{t:w}=Kg(),$=Ye(null),p=Ye(!0),j=Ye(""),I=Ye("overview"),N=Ye(null),P=En(()=>{if(!$.value)return[];const ue=$.value.test_scenarios;return[...ue.main_path_scenarios.map(oe=>({...oe,_class:"main"})),...ue.verify_behavior_scenarios.map(oe=>({...oe,_class:"behavior"})),...ue.verify_rule_scenarios.map(oe=>({...oe,_class:"rule"}))]}),U=En(()=>{if(!$.value)return[];const ue=$.value.test_scenarios;switch(I.value){case"main":return ue.main_path_scenarios;case"behavior":return ue.verify_behavior_scenarios;case"rule":return ue.verify_rule_scenarios;default:return[]}}),V=En(()=>$.value?.result_report?Math.round($.value.result_report.rule_column_covered_ratio*100):0),X=En(()=>{if(!$.value?.coverage_report?.node_info_list)return{covered:0,total:0};const ue=$.value.coverage_report.node_info_list;return{covered:ue.filter(oe=>oe.isCovered).length,total:ue.length}}),ee=En(()=>{if(!$.value?.coverage_report?.rule_column_info_list)return{covered:0,total:0};const ue=$.value.coverage_report.rule_column_info_list;return{covered:ue.filter(oe=>oe.isCovered).length,total:ue.length}});function K(ue){N.value=N.value===ue?null:ue}function he(ue){return{main:"主路径",behavior:"验证行为",rule:"验证规则"}[ue]||ue}function ke(ue){return{main:"bg-blue-100 text-blue-700",behavior:"bg-amber-100 text-amber-700",rule:"bg-purple-100 text-purple-700"}[ue]||"bg-gray-100 text-gray-700"}return gl(async()=>{try{const ue=await fetch(b.url);if(!ue.ok)throw new Error(`HTTP ${ue.status}`);$.value=await ue.json()}catch(ue){j.value=ue.message}finally{p.value=!1}}),(ue,oe)=>(R(),Ts(Lme,{to:"body"},[E("div",{class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60",onClick:oe[1]||(oe[1]=Ah(re=>m("close"),["self"]))},[E("div",vbn,[E("div",mbn,[E("div",null,[E("h2",ybn,M(A(w)("detail.scenarioViewer")),1),$.value?.result_report?.uc_fullname?(R(),J("p",kbn,[ci(M($.value.result_report.uc_fullname)+" ",1),E("span",xbn,"v"+M($.value.result_report.uc_version),1)])):Ae("",!0)]),E("button",{class:"text-gray-400 hover:text-gray-600 text-2xl leading-none",onClick:oe[0]||(oe[0]=re=>m("close"))},"×")]),p.value?(R(),J("div",$bn,[E("span",Ebn,M(A(w)("detail.loading")),1)])):j.value?(R(),J("div",Cbn,[E("span",Sbn,M(j.value),1)])):$.value?(R(),J(sn,{key:2},[E("div",_bn,[(R(!0),J(sn,null,bi([{key:"overview",label:A(w)("detail.scenarioOverview")},{key:"main",label:`${A(w)("detail.scenarioMainPath")} (${$.value.test_scenarios.main_path_scenarios.length})`},{key:"behavior",label:`${A(w)("detail.scenarioVerifyBehavior")} (${$.value.test_scenarios.verify_behavior_scenarios.length})`},{key:"rule",label:`${A(w)("detail.scenarioVerifyRule")} (${$.value.test_scenarios.verify_rule_scenarios.length})`},{key:"coverage",label:A(w)("detail.scenarioCoverage")}],re=>(R(),J("button",{key:re.key,class:wn(["px-4 py-2.5 text-sm font-medium border-b-2 transition-colors -mb-px",I.value===re.key?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"]),onClick:ye=>I.value=re.key},M(re.label),11,jbn))),128))]),E("div",Ibn,[I.value==="overview"?(R(),J("div",Abn,[E("div",Tbn,[E("div",Mbn,[E("div",Pbn,M($.value.test_scenarios.main_path_scenarios.length),1),E("div",Dbn,M(A(w)("detail.scenarioMainPath")),1)]),E("div",Obn,[E("div",Lbn,M($.value.test_scenarios.verify_behavior_scenarios.length),1),E("div",Nbn,M(A(w)("detail.scenarioVerifyBehavior")),1)]),E("div",Rbn,[E("div",Fbn,M($.value.test_scenarios.verify_rule_scenarios.length),1),E("div",Bbn,M(A(w)("detail.scenarioVerifyRule")),1)]),E("div",Hbn,[E("div",Gbn,M(V.value)+"%",1),E("div",Jbn,M(A(w)("detail.scenarioRuleCoverage")),1)])]),E("div",Ubn,[E("div",zbn,[E("span",qbn,M(A(w)("detail.scenarioRuleCoverage")),1),E("span",Vbn,M($.value.result_report.scenario_covered_rule_column_num)+" / "+M($.value.result_report.total_rule_column_num),1)]),E("div",Kbn,[E("div",{class:"bg-green-500 h-2.5 rounded-full transition-all",style:_c({width:V.value+"%"})},null,4)])]),E("div",null,[E("h3",Wbn,M(A(w)("detail.scenarioAllList"))+" ("+M(P.value.length)+")",1),E("div",Xbn,[(R(!0),J(sn,null,bi(P.value,(re,ye)=>(R(),J("div",{key:re.scenario_scene_id||ye,class:"flex items-center gap-2 px-3 py-2 bg-white border border-gray-200 rounded-lg hover:border-gray-300 cursor-pointer",onClick:pe=>{I.value=re._class,N.value=re.scenario_scene_id}},[E("span",{class:wn(["text-xs px-1.5 py-0.5 rounded font-medium",ke(re._class)])},M(he(re._class)),3),E("span",Qbn,M(re.scenario_name),1),re.is_inherit?(R(),J("span",Zbn,M(A(w)("detail.scenarioInherited")),1)):Ae("",!0),E("span",epn,M(re.key_node_num),1)],8,Ybn))),128))])])])):I.value==="main"||I.value==="behavior"||I.value==="rule"?(R(),J("div",tpn,[U.value.length===0?(R(),J("div",npn,M(A(w)("detail.scenarioEmpty")),1)):Ae("",!0),(R(!0),J(sn,null,bi(U.value,(re,ye)=>(R(),J("div",{key:re.scenario_scene_id||ye,class:"border border-gray-200 rounded-lg overflow-hidden"},[E("div",{class:"flex items-center gap-2 px-4 py-3 bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:pe=>K(re.scenario_scene_id||String(ye))},[(R(),J("svg",{class:wn(["w-4 h-4 text-gray-400 transition-transform flex-shrink-0",{"rotate-90":N.value===(re.scenario_scene_id||String(ye))}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...oe[2]||(oe[2]=[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),E("span",rpn,M(re.scenario_name),1),re.is_inherit?(R(),J("span",spn,M(A(w)("detail.scenarioInherited")),1)):Ae("",!0),E("span",opn,M(re.key_node_num),1)],8,ipn),N.value===(re.scenario_scene_id||String(ye))?(R(),J("div",cpn,[re.precondition_list?.length?(R(),J("div",upn,[E("h5",lpn,M(A(w)("detail.scenarioPreconditions")),1),E("ol",apn,[(R(!0),J(sn,null,bi(re.precondition_list,(pe,be)=>(R(),J("li",{key:be},M(pe),1))),128))])])):Ae("",!0),re.operating_procedure_list?.length?(R(),J("div",fpn,[E("h5",dpn,M(A(w)("detail.scenarioSteps")),1),E("ol",hpn,[(R(!0),J(sn,null,bi(re.operating_procedure_list,(pe,be)=>(R(),J("li",{key:be},M(pe),1))),128))])])):Ae("",!0),re.predicated_result_list?.length?(R(),J("div",gpn,[E("h5",bpn,M(A(w)("detail.scenarioExpectedResults")),1),E("ol",ppn,[(R(!0),J(sn,null,bi(re.predicated_result_list,(pe,be)=>(R(),J("li",{key:be},M(pe),1))),128))])])):Ae("",!0),E("div",wpn," ID: "+M(re.scenario_scene_id),1)])):Ae("",!0)]))),128))])):I.value==="coverage"?(R(),J("div",vpn,[E("div",null,[E("h3",mpn,[ci(M(A(w)("detail.scenarioNodeCoverage"))+" ",1),E("span",ypn,"("+M(X.value.covered)+"/"+M(X.value.total)+")",1)]),$.value.coverage_report?.node_info_list?.length?(R(),J("div",kpn,[(R(!0),J(sn,null,bi($.value.coverage_report.node_info_list,(re,ye)=>(R(),J("div",{key:ye,class:wn(["flex items-center gap-2 px-3 py-1.5 rounded text-sm",re.isCovered?"bg-green-50 text-green-700":"bg-red-50 text-red-600"])},[E("span",xpn,M(re.isCovered?"✓":"✗"),1),E("span",$pn,M(re.nodeNum),1),E("span",Epn,M(re.nodeDesc),1)],2))),128))])):(R(),J("div",Cpn,M(A(w)("detail.scenarioEmpty")),1))]),E("div",null,[E("h3",Spn,[ci(M(A(w)("detail.scenarioRuleColumnCoverage"))+" ",1),E("span",_pn,"("+M(ee.value.covered)+"/"+M(ee.value.total)+")",1)]),$.value.coverage_report?.rule_column_info_list?.length?(R(),J("div",jpn,[(R(!0),J(sn,null,bi($.value.coverage_report.rule_column_info_list,(re,ye)=>(R(),J("div",{key:ye,class:wn(["flex items-center gap-2 px-3 py-1.5 rounded text-sm",re.isCovered?"bg-green-50 text-green-700":"bg-red-50 text-red-600"])},[E("span",Ipn,M(re.isCovered?"✓":"✗"),1),E("span",Apn,M(re.ruleColumnName),1)],2))),128))])):(R(),J("div",Tpn,M(A(w)("detail.scenarioEmpty")),1))])])):Ae("",!0)])],64)):Ae("",!0)])])]))}}),Ppn={class:"text-base font-semibold text-gray-700 mb-3 flex items-center gap-2"},Dpn={key:0,class:"text-xs font-normal text-gray-400"},Opn={key:0,class:"text-sm text-gray-400 py-4 text-center"},Lpn={key:1,class:"bg-gray-50 border border-gray-200 rounded-lg px-4 py-6 text-center"},Npn={class:"text-sm text-gray-500"},Rpn={class:"text-xs text-gray-400 mt-1"},Fpn={key:2,class:"bg-gray-50 border border-gray-200 rounded-lg px-4 py-6 text-center"},Bpn={class:"text-sm text-gray-500"},Hpn={class:"text-xs text-gray-400 mt-1"},Gpn={key:0,class:"mb-4"},Jpn={class:"text-sm font-medium text-gray-600 mb-2"},Upn={class:"text-xs font-normal text-gray-400 ml-1"},zpn={class:"space-y-1"},qpn=["onClick"],Vpn={class:"text-base flex-shrink-0"},Kpn={class:"text-sm text-gray-700 truncate flex-1 group-hover:text-blue-600"},Wpn={key:0,class:"text-xs text-indigo-600 bg-indigo-100 px-1.5 py-0.5 rounded flex-shrink-0"},Xpn={class:"text-xs text-gray-400 flex-shrink-0"},Ypn={key:0,class:"mt-3 border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},Qpn={class:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200"},Zpn={class:"flex items-center gap-2 min-w-0"},ewn={class:"text-base flex-shrink-0"},twn={class:"text-sm font-medium text-gray-700 truncate"},nwn={class:"text-xs text-gray-400 flex-shrink-0"},iwn={class:"flex items-center gap-1 flex-shrink-0"},rwn=["href"],swn={key:0,class:"px-4 py-8 text-center text-sm text-gray-400"},own={key:1,class:"relative"},cwn={class:"px-4 py-3 text-sm leading-relaxed overflow-auto max-h-[60vh] bg-gray-50 m-0"},uwn={key:1,class:"mb-4"},lwn={class:"text-sm font-medium text-gray-600 mb-2"},awn={class:"text-xs font-normal text-gray-400 ml-1"},fwn={class:"space-y-1"},dwn=["onClick"],hwn={class:"text-base flex-shrink-0"},gwn={class:"text-sm text-gray-700 truncate flex-1 group-hover:text-blue-600"},bwn={class:"text-xs text-gray-400 flex-shrink-0"},pwn={key:0,class:"mt-3 border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},wwn={class:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200"},vwn={class:"flex items-center gap-2 min-w-0"},mwn={class:"text-base flex-shrink-0"},ywn={class:"text-sm font-medium text-gray-700 truncate"},kwn={class:"text-xs text-gray-400 flex-shrink-0"},xwn={class:"flex items-center gap-1 flex-shrink-0"},$wn=["href"],Ewn={key:0,class:"px-4 py-8 text-center text-sm text-gray-400"},Cwn={key:1,class:"relative"},Swn={class:"px-4 py-3 text-sm leading-relaxed overflow-auto max-h-[60vh] bg-gray-50 m-0"},_wn={class:"mb-3"},jwn=["value"],Iwn={key:0,class:"text-sm text-gray-400 py-4 text-center"},Awn={key:1,class:"mb-4"},Twn={class:"text-sm font-medium text-gray-600 mb-2"},Mwn={class:"grid grid-cols-3 gap-2"},Pwn=["onClick"],Dwn=["src","alt"],Own={class:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-end"},Lwn={class:"w-full px-2 py-1.5 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},Nwn={class:"text-xs text-white truncate"},Rwn={class:"text-[10px] text-white/70"},Fwn={key:2,class:"mb-4"},Bwn={class:"text-sm font-medium text-gray-600 mb-2"},Hwn={class:"space-y-3"},Gwn=["src"],Jwn={class:"px-3 py-2 bg-gray-50 flex items-center justify-between text-xs text-gray-500"},Uwn={key:3,class:"mb-4"},zwn={class:"text-sm font-medium text-gray-600 mb-2"},qwn={class:"space-y-1"},Vwn=["onClick"],Kwn={class:"text-base flex-shrink-0"},Wwn={class:"text-sm text-gray-700 truncate flex-1 group-hover:text-blue-600"},Xwn={class:"text-xs text-gray-400 flex-shrink-0"},Ywn={key:0,class:"mt-3 border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},Qwn={class:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200"},Zwn={class:"flex items-center gap-2 min-w-0"},evn={class:"text-base flex-shrink-0"},tvn={class:"text-sm font-medium text-gray-700 truncate"},nvn={class:"text-xs text-gray-400 flex-shrink-0"},ivn={class:"flex items-center gap-1 flex-shrink-0"},rvn=["href"],svn={key:0,class:"px-4 py-8 text-center text-sm text-gray-400"},ovn={key:1,class:"relative"},cvn={class:"px-4 py-3 text-sm leading-relaxed overflow-auto max-h-[60vh] bg-gray-50 m-0"},uvn={key:4,class:"text-sm text-gray-400 text-center py-4"},lvn=["src"],avn=["src"],o2t=wr({__name:"E2eArtifactsViewer",props:{issueIid:{}},setup(a){const d=a,{t:b}=Kg(),m=Ye(!1),w=Ye([]),$=Ye([]),p=Ye(null),j=Ye([]),I=Ye(!1),N=Ye(!1),P=Ye(null),U=Ye("image"),V=En(()=>j.value.filter(xe=>xe.type==="image")),X=En(()=>j.value.filter(xe=>xe.type==="video")),ee=En(()=>j.value.filter(xe=>xe.type==="document")),K={".md":"📝",".py":"🐍",".json":"📋",".jsonl":"📋",".log":"📄",".html":"🌐",".har":"🔍",".txt":"📄"};function he(xe){const Pe=xe.slice(xe.lastIndexOf(".")).toLowerCase();return K[Pe]||"📄"}const ke=Ye(null),ue=Ye(null);function oe(xe){return xe.name.endsWith(".py")}const re=En(()=>$.value.filter(xe=>!oe(xe))),ye=En(()=>$.value.filter(xe=>oe(xe)));function pe(xe){const Pe=xe.slice(xe.lastIndexOf(".")).toLowerCase();return{".py":"python",".js":"javascript",".ts":"typescript",".json":"json",".jsonl":"json",".md":"markdown",".html":"html",".log":"log",".txt":"plaintext",".har":"json",".yaml":"yaml",".yml":"yaml"}[Pe]||"plaintext"}function be(xe){const Pe=Hgt(xe.relativePath,d.issueIid);xe.name==="result.json"?ke.value=Pe:le(xe,Pe)}function se(xe){const Pe=Hgt(xe.relativePath,d.issueIid);le(xe,Pe)}async function le(xe,Pe){ue.value={file:xe,url:Pe,content:"",loading:!0};try{const Je=await fetch(Pe);if(!Je.ok)throw new Error(`HTTP ${Je.status}`);ue.value={file:xe,url:Pe,content:await Je.text(),loading:!1}}catch(Je){ue.value={file:xe,url:Pe,content:`Failed to load: ${Je.message}`,loading:!1}}}function Ce(xe){const Pe=_W(p.value,xe.relativePath,d.issueIid);le(xe,Pe)}function Se(){ue.value=null}const te=En(()=>w.value.length>0||$.value.length>0);async function q(){I.value=!0;try{const xe=await oWt(d.issueIid);m.value=xe.configured,w.value=xe.runs,$.value=xe.scenarios??[],xe.runs.length>0&&!p.value&&(p.value=xe.runs[0].runId)}catch(xe){console.error("Failed to load E2E runs",xe)}finally{I.value=!1}}async function He(xe){N.value=!0,j.value=[];try{const Pe=await cWt(xe,d.issueIid);j.value=Pe.files}catch(Pe){console.error("Failed to load E2E run files",Pe)}finally{N.value=!1}}Jr(p,xe=>{xe&&He(xe)}),Jr(()=>d.issueIid,()=>{p.value=null,j.value=[],$.value=[],ue.value=null,q()});function gt(xe){P.value=_W(p.value,xe.relativePath,d.issueIid),U.value=xe.type}function ze(){P.value=null}function jt(xe){return xe<1024?`${xe} B`:xe<1024*1024?`${(xe/1024).toFixed(1)} KB`:`${(xe/(1024*1024)).toFixed(1)} MB`}function Jt(xe){const Pe=xe.match(/^(\d{4})(\d{2})(\d{2})-(\d{2})(\d{2})(\d{2})/);return Pe?`${Pe[1]}-${Pe[2]}-${Pe[3]} ${Pe[4]}:${Pe[5]}:${Pe[6]}`:xe}return gl(q),(xe,Pe)=>(R(),J("div",null,[E("h3",Ppn,[ci(M(A(b)("detail.e2eArtifacts"))+" ",1),w.value.length>0?(R(),J("span",Dpn,"("+M(w.value.length)+" "+M(A(b)("detail.e2eRuns"))+")",1)):Ae("",!0)]),I.value?(R(),J("div",Opn,M(A(b)("detail.loading")),1)):m.value?te.value?(R(),J(sn,{key:3},[re.value.length>0?(R(),J("div",Gpn,[E("h4",Jpn,[ci(M(A(b)("detail.e2eScenariosLabel"))+" ",1),E("span",Upn,"("+M(re.value.length)+")",1)]),E("div",zpn,[(R(!0),J(sn,null,bi(re.value,Je=>(R(),J("div",{key:"sc-"+Je.relativePath,class:wn(["flex items-center gap-2 px-3 py-2 border rounded-lg cursor-pointer transition-colors group",Je.name==="result.json"?"border-indigo-200 bg-indigo-50/50 hover:border-indigo-400 hover:bg-indigo-50":ue.value?.file===Je?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50 hover:border-blue-300 hover:bg-blue-50"]),onClick:Bt=>be(Je)},[E("span",Vpn,M(he(Je.name)),1),E("span",Kpn,M(Je.name),1),Je.name==="result.json"?(R(),J("span",Wpn,M(A(b)("detail.scenarioViewer")),1)):Ae("",!0),E("span",Xpn,M(jt(Je.size)),1)],10,qpn))),128))]),ue.value&&re.value.some(Je=>Je===ue.value.file)?(R(),J("div",Ypn,[E("div",Qpn,[E("div",Zpn,[E("span",ewn,M(he(ue.value.file.name)),1),E("span",twn,M(ue.value.file.name),1),E("span",nwn,M(jt(ue.value.file.size)),1)]),E("div",iwn,[E("a",{href:ue.value.url,target:"_blank",class:"p-1 text-gray-400 hover:text-blue-500 rounded",title:"Open in new tab"},[...Pe[4]||(Pe[4]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,rwn),E("button",{class:"p-1 text-gray-400 hover:text-gray-600 rounded",onClick:Se},[...Pe[5]||(Pe[5]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),ue.value.loading?(R(),J("div",swn,M(A(b)("detail.loading")),1)):(R(),J("div",own,[E("pre",cwn,[E("code",{class:wn("language-"+pe(ue.value.file.name))},M(ue.value.content),3)])]))])):Ae("",!0)])):Ae("",!0),ye.value.length>0?(R(),J("div",uwn,[E("h4",lwn,[ci(M(A(b)("detail.e2eScriptsLabel"))+" ",1),E("span",awn,"("+M(ye.value.length)+")",1)]),E("div",fwn,[(R(!0),J(sn,null,bi(ye.value,Je=>(R(),J("div",{key:"ss-"+Je.relativePath,class:wn(["flex items-center gap-2 px-3 py-2 border rounded-lg cursor-pointer transition-colors group",ue.value?.file===Je?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50 hover:border-blue-300 hover:bg-blue-50"]),onClick:Bt=>se(Je)},[E("span",hwn,M(he(Je.name)),1),E("span",gwn,M(Je.name),1),E("span",bwn,M(jt(Je.size)),1)],10,dwn))),128))]),ue.value&&ye.value.some(Je=>Je===ue.value.file)?(R(),J("div",pwn,[E("div",wwn,[E("div",vwn,[E("span",mwn,M(he(ue.value.file.name)),1),E("span",ywn,M(ue.value.file.name),1),E("span",kwn,M(jt(ue.value.file.size)),1)]),E("div",xwn,[E("a",{href:ue.value.url,target:"_blank",class:"p-1 text-gray-400 hover:text-blue-500 rounded",title:"Open in new tab"},[...Pe[6]||(Pe[6]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,$wn),E("button",{class:"p-1 text-gray-400 hover:text-gray-600 rounded",onClick:Se},[...Pe[7]||(Pe[7]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),ue.value.loading?(R(),J("div",Ewn,M(A(b)("detail.loading")),1)):(R(),J("div",Cwn,[E("pre",Swn,[E("code",{class:wn("language-"+pe(ue.value.file.name))},M(ue.value.content),3)])]))])):Ae("",!0)])):Ae("",!0),w.value.length>0?(R(),J(sn,{key:2},[E("div",_wn,[Nn(E("select",{"onUpdate:modelValue":Pe[0]||(Pe[0]=Je=>p.value=Je),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"},[(R(!0),J(sn,null,bi(w.value,Je=>(R(),J("option",{key:Je.runId,value:Je.runId},[ci(M(Jt(Je.runId))+" — "+M(Je.imageCount)+" "+M(A(b)("detail.e2eImages"))+", "+M(Je.videoCount)+" "+M(A(b)("detail.e2eVideos")),1),Je.documentCount?(R(),J(sn,{key:0},[ci(", "+M(Je.documentCount)+" "+M(A(b)("detail.e2eDocuments")),1)],64)):Ae("",!0)],8,jwn))),128))],512),[[Rd,p.value]])]),N.value?(R(),J("div",Iwn,M(A(b)("detail.loading")),1)):Ae("",!0),!N.value&&V.value.length>0?(R(),J("div",Awn,[E("h4",Twn,M(A(b)("detail.e2eScreenshots")),1),E("div",Mwn,[(R(!0),J(sn,null,bi(V.value,Je=>(R(),J("div",{key:Je.relativePath,class:"relative group cursor-pointer rounded-lg overflow-hidden border border-gray-200 hover:border-blue-400 hover:shadow-md transition-all",onClick:Bt=>gt(Je)},[E("img",{src:_W(p.value,Je.relativePath,d.issueIid),alt:Je.name,class:"w-full h-32 object-cover bg-gray-100",loading:"lazy"},null,8,Dwn),E("div",Own,[E("div",Lwn,[E("p",Nwn,M(Je.name),1),E("p",Rwn,M(jt(Je.size)),1)])])],8,Pwn))),128))])])):Ae("",!0),!N.value&&X.value.length>0?(R(),J("div",Fwn,[E("h4",Bwn,M(A(b)("detail.e2eVideoRecordings")),1),E("div",Hwn,[(R(!0),J(sn,null,bi(X.value,Je=>(R(),J("div",{key:Je.relativePath,class:"border border-gray-200 rounded-lg overflow-hidden"},[E("video",{src:_W(p.value,Je.relativePath,d.issueIid),controls:"",preload:"metadata",class:"w-full max-h-80 bg-black"},null,8,Gwn),E("div",Jwn,[E("span",null,M(Je.name),1),E("span",null,M(jt(Je.size)),1)])]))),128))])])):Ae("",!0),!N.value&&ee.value.length>0?(R(),J("div",Uwn,[E("h4",zwn,M(A(b)("detail.e2eRunDocuments")),1),E("div",qwn,[(R(!0),J(sn,null,bi(ee.value,Je=>(R(),J("div",{key:Je.relativePath,class:wn(["flex items-center gap-2 px-3 py-2 border rounded-lg cursor-pointer transition-colors group",ue.value?.file.relativePath===Je.relativePath&&!ue.value?.url.includes("e2e-scenarios")?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50 hover:border-blue-300 hover:bg-blue-50"]),onClick:Bt=>Ce(Je)},[E("span",Kwn,M(he(Je.name)),1),E("span",Wwn,M(Je.relativePath),1),E("span",Xwn,M(jt(Je.size)),1),Pe[8]||(Pe[8]=E("svg",{class:"w-4 h-4 text-gray-300 group-hover:text-blue-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1))],10,Vwn))),128))]),ue.value&&!ue.value.url.includes("e2e-scenarios")?(R(),J("div",Ywn,[E("div",Qwn,[E("div",Zwn,[E("span",evn,M(he(ue.value.file.name)),1),E("span",tvn,M(ue.value.file.relativePath),1),E("span",nvn,M(jt(ue.value.file.size)),1)]),E("div",ivn,[E("a",{href:ue.value.url,target:"_blank",class:"p-1 text-gray-400 hover:text-blue-500 rounded",title:"Open in new tab"},[...Pe[9]||(Pe[9]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,rvn),E("button",{class:"p-1 text-gray-400 hover:text-gray-600 rounded",onClick:Se},[...Pe[10]||(Pe[10]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),ue.value.loading?(R(),J("div",svn,M(A(b)("detail.loading")),1)):(R(),J("div",ovn,[E("pre",cvn,[E("code",{class:wn("language-"+pe(ue.value.file.name))},M(ue.value.content),3)])]))])):Ae("",!0)])):Ae("",!0),!N.value&&V.value.length===0&&X.value.length===0&&ee.value.length===0&&p.value?(R(),J("div",uvn,M(A(b)("detail.e2eNoMedia")),1)):Ae("",!0)],64)):Ae("",!0)],64)):(R(),J("div",Fpn,[Pe[3]||(Pe[3]=E("svg",{class:"mx-auto h-10 w-10 text-gray-300 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),E("p",Bpn,M(A(b)("detail.e2eNoRuns")),1),E("p",Hpn,M(A(b)("detail.e2eNoRunsHint")),1)])):(R(),J("div",Lpn,[Pe[2]||(Pe[2]=E("svg",{class:"mx-auto h-10 w-10 text-gray-300 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)),E("p",Npn,M(A(b)("detail.e2eNotConfigured")),1),E("p",Rpn,M(A(b)("detail.e2eNotConfiguredHint")),1)])),(R(),Ts(Lme,{to:"body"},[P.value?(R(),J("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80",onClick:Ah(ze,["self"])},[E("button",{class:"absolute top-4 right-4 text-white/80 hover:text-white text-3xl leading-none z-10",onClick:ze},"×"),U.value==="image"?(R(),J("img",{key:0,src:P.value,class:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg shadow-2xl"},null,8,lvn)):(R(),J("video",{key:1,src:P.value,controls:"",autoplay:"",class:"max-w-[90vw] max-h-[90vh] rounded-lg shadow-2xl"},null,8,avn))])):Ae("",!0)])),ke.value?(R(),Ts(Mpn,{key:4,url:ke.value,onClose:Pe[1]||(Pe[1]=Je=>ke.value=null)},null,8,["url"])):Ae("",!0)]))}}),fvn={class:"fixed inset-0 z-50 flex"},dvn={class:"relative ml-auto w-full max-w-2xl bg-white shadow-xl overflow-y-auto"},hvn={class:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between z-10"},gvn={class:"flex items-center space-x-2"},bvn={class:"text-lg font-bold text-gray-800"},pvn=["href"],wvn={class:"px-6 py-4 space-y-6"},vvn={class:"text-base font-semibold text-gray-700 mb-2"},mvn={class:"grid grid-cols-2 gap-3 text-sm"},yvn={class:"text-gray-500"},kvn={class:"text-gray-800"},xvn={class:"text-gray-500"},$vn={class:"text-xs bg-gray-100 px-1 py-0.5 rounded"},Evn={class:"text-gray-500"},Cvn={class:"text-gray-500"},Svn={class:"text-gray-500"},_vn={class:"text-gray-500"},jvn={class:"flex items-center justify-between text-sm bg-gray-50 rounded-lg px-4 py-2.5 border border-gray-200"},Ivn={class:"text-gray-600"},Avn=["disabled"],Tvn={class:"flex items-center justify-between text-sm bg-gray-50 rounded-lg px-4 py-2.5 border border-gray-200"},Mvn={class:"text-gray-600"},Pvn=["disabled"],Dvn={key:0,class:"bg-green-50 border border-green-200 rounded-lg p-4 flex items-center space-x-2"},Ovn={class:"text-sm text-green-700 font-medium"},Lvn=["href"],Nvn={key:1,class:"bg-green-50 border border-green-200 rounded-lg p-4 space-y-2"},Rvn={class:"text-sm text-green-700 font-medium"},Fvn={class:"text-xs text-green-600 font-mono"},Bvn=["href"],Hvn={key:2,class:"bg-red-50 border border-red-200 rounded-lg p-4"},Gvn={class:"text-sm font-semibold text-red-700 mb-1"},Jvn={class:"text-sm text-red-600 whitespace-pre-wrap break-words"},Uvn={class:"flex flex-wrap gap-3 pt-2 border-t border-gray-200"},zvn=wr({__name:"DetailModal",props:{issue:{},progress:{},systemStatus:{},verifyFixLoop:{},agentLogs:{},agentAutoScroll:{type:Boolean},agentDebugMode:{type:Boolean},supplement:{},supplementForm:{},supplementLoading:{type:Boolean},supplementEditing:{type:Boolean},supplementSaving:{type:Boolean},hasSupplementData:{type:Boolean},detailVersion:{},reviewFeedback:{},reviewSubmitting:{type:Boolean},reviewHistory:{}},emits:["close","start","retry","restart","cancel","markDeployed","stopPreview","restartPreview","retryFromPhase","approve","reject","skip","update:reviewFeedback","supplementEdit","supplementSave","supplementCancel","update:supplementForm","update:agentAutoScroll","update:agentDebugMode","clearLogs"],setup(a,{emit:d}){const b=a,m=d,{stateLabel:w,stateClass:$,getPlanDocs:p,isEditableDoc:j}=r_();function I(){if(!b.systemStatus)return"#";const ue=b.systemStatus.config.gongfengBaseUrl,oe=b.systemStatus.config.projectPath;return`${ue}/${oe}/issues/${_r(b.issue)}`}const N=Ye(b.issue.issueNoteSyncEnabled),P=Ye(!1),U=En(()=>N.value===!0?"on":N.value===!1?"off":"system");async function V(){const ue=[void 0,!0,!1],oe=ue.indexOf(N.value),re=ue[(oe+1)%ue.length];N.value=re,P.value=!0;try{await xwt(_r(b.issue),re===void 0?null:re)}catch(ye){console.error("Failed to toggle note sync",ye)}finally{P.value=!1}}const X=Ye(b.issue.e2eEnabled),ee=Ye(!1),K=En(()=>X.value===!0?"on":X.value===!1?"off":"system");async function he(){const ue=[void 0,!0,!1],oe=ue.indexOf(X.value),re=ue[(oe+1)%ue.length];X.value=re,ee.value=!0;try{await $wt(_r(b.issue),re===void 0?null:re)}catch(ye){console.error("Failed to toggle e2e",ye)}finally{ee.value=!1}}function ke(){window.open(`/detail?issue=${_r(b.issue)}`,"_blank")}return(ue,oe)=>(R(),J("div",fvn,[E("div",{class:"absolute inset-0 bg-black/30",onClick:oe[0]||(oe[0]=re=>m("close"))}),E("div",dvn,[E("div",hvn,[E("div",gvn,[E("h2",bvn,"Issue #"+M(A(_r)(a.issue)),1),E("a",{href:I(),target:"_blank",rel:"noopener",class:"inline-flex items-center px-2 py-0.5 text-xs font-medium text-blue-600 bg-blue-50 rounded hover:bg-blue-100 hover:text-blue-800 transition-colors"},[ci(M(ue.$t("detail.viewInGongfeng"))+" ",1),oe[24]||(oe[24]=E("svg",{class:"w-3 h-3 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1))],8,pvn),E("button",{class:"inline-flex items-center px-2 py-0.5 text-xs font-medium text-gray-600 bg-gray-100 rounded hover:bg-gray-200 hover:text-gray-800 transition-colors",onClick:oe[1]||(oe[1]=re=>ke())},[ci(M(ue.$t("detail.openFullPage"))+" ",1),oe[25]||(oe[25]=E("svg",{class:"w-3 h-3 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m7-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m7 5v-4m0 4h-4m4 0l-5-5"})],-1))])]),E("button",{class:"text-gray-400 hover:text-gray-600 text-2xl leading-none",onClick:oe[2]||(oe[2]=re=>m("close"))},"×")]),E("div",wvn,[E("div",null,[E("h3",vvn,M(ue.$t("detail.basicInfo")),1),E("div",mvn,[E("div",null,[E("span",yvn,M(ue.$t("detail.title")),1),oe[26]||(oe[26]=ci()),E("span",kvn,M(A(ywt)(a.issue)),1)]),E("div",null,[E("span",xvn,M(ue.$t("detail.branch")),1),oe[27]||(oe[27]=ci()),E("code",$vn,M(a.issue.branchName),1)]),E("div",null,[E("span",Evn,M(ue.$t("detail.state")),1),E("span",{class:wn(["px-2 py-0.5 rounded-full text-xs font-medium",A($)(a.issue.state)])},M(A(w)(a.issue.state,a.issue.currentPhase)),3)]),E("div",null,[E("span",Cvn,M(ue.$t("detail.createdAt")),1),ci(" "+M(A(YS)(a.issue.createdAt)),1)]),E("div",null,[E("span",Svn,M(ue.$t("detail.retries")),1),ci(" "+M(a.issue.attempts),1)]),E("div",null,[E("span",_vn,M(ue.$t("detail.updatedAt")),1),ci(" "+M(A(YS)(a.issue.updatedAt)),1)])])]),E("div",jvn,[E("span",Ivn,M(ue.$t("detail.noteSync")),1),E("button",{class:wn(["px-3 py-1 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":U.value==="on","bg-red-100 text-red-600 hover:bg-red-200":U.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":U.value==="system"}]),disabled:P.value,onClick:oe[3]||(oe[3]=re=>V())},M(U.value==="on"?ue.$t("detail.enabled"):U.value==="off"?ue.$t("detail.disabled"):ue.$t("detail.followSystem")),11,Avn)]),E("div",Tvn,[E("span",Mvn,M(ue.$t("detail.e2eTitle")),1),E("button",{class:wn(["px-3 py-1 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":K.value==="on","bg-red-100 text-red-600 hover:bg-red-200":K.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":K.value==="system"}]),disabled:ee.value,onClick:oe[4]||(oe[4]=re=>he())},M(K.value==="on"?ue.$t("detail.enabled"):K.value==="off"?ue.$t("detail.disabled"):ue.$t("detail.followSystem")),11,Pvn)]),a.issue.mrUrl?(R(),J("div",Dvn,[E("span",Ovn,M(ue.$t("detail.mrLabel")),1),E("a",{href:a.issue.mrUrl,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(a.issue.mrUrl),9,Lvn)])):Ae("",!0),a.issue.linkedMrUrls&&Object.keys(a.issue.linkedMrUrls).length>0?(R(),J("div",Nvn,[E("span",Rvn,M(ue.$t("detail.linkedMrLabel")),1),(R(!0),J(sn,null,bi(a.issue.linkedMrUrls,(re,ye)=>(R(),J("div",{key:ye,class:"flex items-center space-x-2 ml-2"},[E("span",Fvn,M(ye)+":",1),E("a",{href:re,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(re),9,Bvn)]))),128))])):Ae("",!0),a.issue.lastError?(R(),J("div",Hvn,[E("h3",Gvn,M(ue.$t("detail.errorInfo")),1),E("p",Jvn,M(a.issue.lastError),1)])):Ae("",!0),xr(t2t,{issue:a.issue,progress:a.progress,"verify-fix-loop":a.verifyFixLoop,onRetryFromPhase:oe[5]||(oe[5]=re=>m("retryFromPhase",A(_r)(a.issue),re))},null,8,["issue","progress","verify-fix-loop"]),a.issue.state==="phase_waiting"?(R(),Ts(n2t,{key:3,"review-submitting":a.reviewSubmitting,"review-feedback":a.reviewFeedback,"review-history":a.reviewHistory,"onUpdate:reviewFeedback":oe[6]||(oe[6]=re=>m("update:reviewFeedback",re)),onApprove:oe[7]||(oe[7]=re=>m("approve",A(_r)(a.issue))),onReject:oe[8]||(oe[8]=re=>m("reject",A(_r)(a.issue))),onSkip:oe[9]||(oe[9]=re=>m("skip",A(_r)(a.issue)))},null,8,["review-submitting","review-feedback","review-history"])):Ae("",!0),xr(i2t,{supplement:a.supplement,"supplement-form":a.supplementForm,loading:a.supplementLoading,editing:a.supplementEditing,saving:a.supplementSaving,"has-data":a.hasSupplementData,onEdit:oe[10]||(oe[10]=re=>m("supplementEdit")),onSave:oe[11]||(oe[11]=re=>m("supplementSave")),onCancel:oe[12]||(oe[12]=re=>m("supplementCancel")),"onUpdate:supplementForm":oe[13]||(oe[13]=re=>m("update:supplementForm",re))},null,8,["supplement","supplement-form","loading","editing","saving","has-data"]),xr(s2t,{"issue-iid":A(_r)(a.issue),"plan-docs":A(p)(a.issue),"is-editable-doc":A(j),"detail-version":a.detailVersion},null,8,["issue-iid","plan-docs","is-editable-doc","detail-version"]),xr(o2t,{"issue-iid":A(_r)(a.issue)},null,8,["issue-iid"]),xr(r2t,{logs:a.agentLogs,"issue-state":a.issue.state,"current-phase":a.issue.currentPhase,"auto-scroll":a.agentAutoScroll,"debug-mode":a.agentDebugMode,"onUpdate:autoScroll":oe[14]||(oe[14]=re=>m("update:agentAutoScroll",re)),"onUpdate:debugMode":oe[15]||(oe[15]=re=>m("update:agentDebugMode",re)),onClear:oe[16]||(oe[16]=re=>m("clearLogs"))},null,8,["logs","issue-state","current-phase","auto-scroll","debug-mode"]),E("div",Uvn,[a.issue.state==="skipped"?(R(),J("button",{key:0,class:"px-4 py-2 bg-green-500 text-white text-sm rounded-lg hover:bg-green-600",onClick:oe[17]||(oe[17]=re=>m("start",A(_r)(a.issue)))},M(ue.$t("detail.start")),1)):Ae("",!0),a.issue.state==="failed"?(R(),J("button",{key:1,class:"px-4 py-2 bg-blue-500 text-white text-sm rounded-lg hover:bg-blue-600",onClick:oe[18]||(oe[18]=re=>m("retry",A(_r)(a.issue)))},M(ue.$t("detail.retry")),1)):Ae("",!0),a.issue.state==="completed"?(R(),J("button",{key:2,class:"px-4 py-2 bg-purple-500 text-white text-sm rounded-lg hover:bg-purple-600",onClick:oe[19]||(oe[19]=re=>m("markDeployed",A(_r)(a.issue)))},M(ue.$t("detail.markDeployed")),1)):Ae("",!0),a.issue.state==="completed"&&a.issue.preview?.running?(R(),J("button",{key:3,class:"px-4 py-2 bg-orange-100 text-orange-700 text-sm rounded-lg hover:bg-orange-200",onClick:oe[20]||(oe[20]=re=>m("stopPreview",A(_r)(a.issue)))},M(ue.$t("detail.stopPreview")),1)):Ae("",!0),a.issue.state==="completed"&&!a.issue.preview?.running?(R(),J("button",{key:4,class:"px-4 py-2 bg-indigo-100 text-indigo-700 text-sm rounded-lg hover:bg-indigo-200",onClick:oe[21]||(oe[21]=re=>m("restartPreview",A(_r)(a.issue)))},M(ue.$t("detail.restartPreview")),1)):Ae("",!0),a.issue.state!=="skipped"?(R(),J("button",{key:5,class:"px-4 py-2 bg-yellow-100 text-yellow-700 text-sm rounded-lg hover:bg-yellow-200",onClick:oe[22]||(oe[22]=re=>m("restart",A(_r)(a.issue)))},M(ue.$t("detail.restart")),1)):Ae("",!0),E("button",{class:"px-4 py-2 bg-red-100 text-red-600 text-sm rounded-lg hover:bg-red-200",onClick:oe[23]||(oe[23]=re=>m("cancel",A(_r)(a.issue)))},M(ue.$t("detail.cancelTrack")),1)])])])]))}}),qvn={key:0,class:"min-h-screen bg-gray-50 flex flex-col"},Vvn={class:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between sticky top-0 z-10"},Kvn={class:"flex items-center gap-3 min-w-0"},Wvn={href:"/",class:"text-sm text-blue-600 hover:text-blue-800 flex-shrink-0"},Xvn={class:"text-lg font-bold text-gray-800 truncate"},Yvn={class:"text-gray-500 truncate hidden sm:inline"},Qvn={class:"flex items-center gap-3 flex-shrink-0"},Zvn={key:0,class:"w-2 h-2 rounded-full bg-green-500",title:"SSE connected"},e2n={key:1,class:"w-2 h-2 rounded-full bg-red-400",title:"SSE disconnected"},t2n=["href"],n2n={class:"flex flex-1 overflow-hidden"},i2n={class:"w-80 flex-shrink-0 border-r border-gray-200 bg-white overflow-y-auto"},r2n={class:"p-4 border-b border-gray-100"},s2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},o2n={class:"p-4 border-b border-gray-100"},c2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},u2n={class:"space-y-2 text-sm"},l2n={class:"flex justify-between"},a2n={class:"text-gray-400"},f2n={class:"text-xs bg-gray-100 px-1.5 py-0.5 rounded truncate max-w-[180px]"},d2n={class:"flex justify-between"},h2n={class:"text-gray-400"},g2n={class:"flex justify-between"},b2n={class:"text-gray-400"},p2n={class:"flex justify-between"},w2n={class:"text-gray-400"},v2n={class:"p-4 border-b border-gray-100"},m2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},y2n={class:"space-y-2"},k2n={class:"flex items-center justify-between text-sm"},x2n={class:"text-gray-600"},$2n=["disabled"],E2n={class:"flex items-center justify-between text-sm"},C2n={class:"text-gray-600"},S2n=["disabled"],_2n={key:0,class:"p-4 border-b border-gray-100"},j2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},I2n=["href"],A2n={key:1,class:"space-y-1 mt-1"},T2n={class:"text-xs text-gray-500 font-mono flex-shrink-0"},M2n=["href"],P2n={key:1,class:"p-4 border-b border-gray-100"},D2n={class:"bg-red-50 border border-red-200 rounded-lg p-3"},O2n={class:"text-xs font-semibold text-red-700 mb-1"},L2n={class:"text-xs text-red-600 whitespace-pre-wrap break-words"},N2n={class:"p-4"},R2n={class:"flex flex-wrap gap-2"},F2n={class:"flex-1 flex flex-col min-w-0"},B2n={class:"flex gap-0 border-b border-gray-200 bg-white px-4"},H2n=["onClick"],G2n={class:"flex-1 overflow-y-auto p-5"},J2n={key:1,class:"min-h-screen bg-gray-50 flex items-center justify-center"},U2n={class:"text-center"},z2n={class:"text-gray-400 text-lg mb-2"},q2n={href:"/",class:"text-sm text-blue-600 hover:text-blue-800"},V2n=wr({__name:"IssueDetailPage",setup(a){const d=Ye(null),b=Ye("docs"),m=Ye(!1),w=Ye(!1),{pipelineMode:$,stateLabel:p,stateClass:j,getPlanDocs:I,isEditableDoc:N}=r_(),P=_wt(),U=JX(),V=En(()=>P.selectedIssue.value?_r(P.selectedIssue.value):void 0),X=En(()=>{const le=V.value;return le!=null?U.getVerifyFixLoop(le):void 0}),ee=En(()=>{if(!P.selectedIssue.value)return"system";const le=P.selectedIssue.value.issueNoteSyncEnabled;return le===!0?"on":le===!1?"off":"system"}),K=En(()=>{if(!P.selectedIssue.value)return"system";const le=P.selectedIssue.value.e2eEnabled;return le===!0?"on":le===!1?"off":"system"});function he(){if(!P.selectedIssue.value||!d.value)return"#";const le=d.value.config.gongfengBaseUrl,Ce=d.value.config.projectPath;return`${le}/${Ce}/issues/${_r(P.selectedIssue.value)}`}function ke(){const Ce=new URLSearchParams(window.location.search).get("issue");if(!Ce)return;const Se=Number(Ce);return Number.isFinite(Se)&&Se>0?Se:void 0}async function ue(le){try{const Ce=await dX(le);P.selectIssue(Ce,U.agentLogs)}catch{console.warn(`Issue #${le} not found`)}}async function oe(){}async function re(){if(!P.selectedIssue.value)return;const le=P.selectedIssue.value.issueNoteSyncEnabled,Ce=le===!0?!1:le===!1?void 0:!0;m.value=!0;try{await xwt(_r(P.selectedIssue.value),Ce===void 0?null:Ce),await P.refreshDetail()}catch(Se){console.error("Failed to toggle note sync",Se)}finally{m.value=!1}}async function ye(){if(!P.selectedIssue.value)return;const le=P.selectedIssue.value.e2eEnabled,Ce=le===!0?!1:le===!1?void 0:!0;w.value=!0;try{await $wt(_r(P.selectedIssue.value),Ce===void 0?null:Ce),await P.refreshDetail()}catch(Se){console.error("Failed to toggle e2e",Se)}finally{w.value=!1}}const{connected:pe}=Swt((le,Ce)=>{const Se=Ce;if(le.startsWith("issue:")||le.startsWith("review:")){const te=Se.data;te?.issueIid&&P.selectedIssue.value&&_r(P.selectedIssue.value)===te.issueIid&&P.refreshDetail()}if(le==="agent:output"){const te=Se.data;te?.event&&U.pushAgentStreamEvent(te.issueIid,V,te.phase,te.event)}if(le==="pipeline:progress"){const te=Se.data;te&&P.selectedIssue.value&&_r(P.selectedIssue.value)===te.issueIid&&U.pushSystemLog(te.issueIid,V,te.step,te.message??"",Se.timestamp)}if(le.startsWith("verify:")){const te=Se.data,q=te?.issueIid;if(q&&(U.updateVerifyFixLoop(q,le,te),P.selectedIssue.value&&_r(P.selectedIssue.value)===q)){let He="";le==="verify:loopStarted"?He=Cs("verify.loopStarted",{max:te.maxIterations}):le==="verify:iterationComplete"?He=te.passed?Cs("verify.iterationPassed",{n:te.iteration}):Cs("verify.iterationFailed",{n:te.iteration,reasons:(te.failures??[]).join("; ")}):le==="verify:loopExhausted"&&(He=Cs("verify.loopExhausted",{n:te.totalIterations})),He&&U.pushSystemLog(q,V,"verify",He,Se.timestamp)}}});async function be(){try{d.value=await kwt(),d.value?.config?.pipelineMode&&($.value=d.value.config.pipelineMode)}catch(le){console.error("Fetch status failed",le)}}let se=null;return gl(async()=>{Cwt(),be(),se=setInterval(be,1e4);const le=ke();le&&await ue(le)}),dp(()=>{se&&clearInterval(se)}),(le,Ce)=>A(P).selectedIssue.value?(R(),J("div",qvn,[E("div",Vvn,[E("div",Kvn,[E("a",Wvn,M(le.$t("detail.backToList")),1),Ce[21]||(Ce[21]=E("span",{class:"text-gray-300"},"|",-1)),E("h1",Xvn,"Issue #"+M(A(_r)(A(P).selectedIssue.value)),1),E("span",Yvn,M(A(ywt)(A(P).selectedIssue.value)),1),E("span",{class:wn(["px-2.5 py-0.5 rounded-full text-xs font-medium flex-shrink-0",A(j)(A(P).selectedIssue.value.state)])},M(A(p)(A(P).selectedIssue.value.state,A(P).selectedIssue.value.currentPhase)),3)]),E("div",Qvn,[A(pe)?(R(),J("span",Zvn)):(R(),J("span",e2n)),E("a",{href:he(),target:"_blank",rel:"noopener",class:"text-sm text-gray-500 hover:text-blue-600"},M(le.$t("detail.viewInGongfeng"))+" ↗",9,t2n)])]),E("div",n2n,[E("aside",i2n,[E("div",r2n,[E("div",s2n,M(le.$t("pipeline.title")),1),xr(t2t,{issue:A(P).selectedIssue.value,progress:A(P).detailProgress.value,"verify-fix-loop":X.value,vertical:"",onRetryFromPhase:Ce[0]||(Ce[0]=Se=>A(P).doRetryFromPhase(A(_r)(A(P).selectedIssue.value),Se,Se,oe))},null,8,["issue","progress","verify-fix-loop"])]),E("div",o2n,[E("div",c2n,M(le.$t("detail.basicInfo")),1),E("div",u2n,[E("div",l2n,[E("span",a2n,M(le.$t("detail.branch")),1),E("code",f2n,M(A(P).selectedIssue.value.branchName),1)]),E("div",d2n,[E("span",h2n,M(le.$t("detail.retries")),1),E("span",null,M(A(P).selectedIssue.value.attempts),1)]),E("div",g2n,[E("span",b2n,M(le.$t("detail.createdAt")),1),E("span",null,M(A(YS)(A(P).selectedIssue.value.createdAt)),1)]),E("div",p2n,[E("span",w2n,M(le.$t("detail.updatedAt")),1),E("span",null,M(A(YS)(A(P).selectedIssue.value.updatedAt)),1)])])]),E("div",v2n,[E("div",m2n,M(le.$t("detail.settings")),1),E("div",y2n,[E("div",k2n,[E("span",x2n,M(le.$t("detail.noteSync")),1),E("button",{class:wn(["px-2.5 py-0.5 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":ee.value==="on","bg-red-100 text-red-600 hover:bg-red-200":ee.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":ee.value==="system"}]),disabled:m.value,onClick:Ce[1]||(Ce[1]=Se=>re())},M(ee.value==="on"?le.$t("detail.enabled"):ee.value==="off"?le.$t("detail.disabled"):le.$t("detail.followSystem")),11,$2n)]),E("div",E2n,[E("span",C2n,M(le.$t("detail.e2eTitle")),1),E("button",{class:wn(["px-2.5 py-0.5 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":K.value==="on","bg-red-100 text-red-600 hover:bg-red-200":K.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":K.value==="system"}]),disabled:w.value,onClick:Ce[2]||(Ce[2]=Se=>ye())},M(K.value==="on"?le.$t("detail.enabled"):K.value==="off"?le.$t("detail.disabled"):le.$t("detail.followSystem")),11,S2n)])])]),A(P).selectedIssue.value.mrUrl||A(P).selectedIssue.value.linkedMrUrls&&Object.keys(A(P).selectedIssue.value.linkedMrUrls).length>0?(R(),J("div",_2n,[E("div",j2n,M(le.$t("detail.mergeRequest")),1),A(P).selectedIssue.value.mrUrl?(R(),J("a",{key:0,href:A(P).selectedIssue.value.mrUrl,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(A(P).selectedIssue.value.mrUrl),9,I2n)):Ae("",!0),A(P).selectedIssue.value.linkedMrUrls?(R(),J("div",A2n,[(R(!0),J(sn,null,bi(A(P).selectedIssue.value.linkedMrUrls,(Se,te)=>(R(),J("div",{key:te,class:"flex items-start gap-2"},[E("span",T2n,M(te)+":",1),E("a",{href:Se,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(Se),9,M2n)]))),128))])):Ae("",!0)])):Ae("",!0),A(P).selectedIssue.value.lastError?(R(),J("div",P2n,[E("div",D2n,[E("div",O2n,M(le.$t("detail.errorInfo")),1),E("p",L2n,M(A(P).selectedIssue.value.lastError),1)])])):Ae("",!0),E("div",N2n,[E("div",R2n,[A(P).selectedIssue.value.state==="skipped"?(R(),J("button",{key:0,class:"px-3 py-1.5 bg-green-500 text-white text-xs rounded-lg hover:bg-green-600",onClick:Ce[3]||(Ce[3]=Se=>A(P).doStartIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.start")),1)):Ae("",!0),A(P).selectedIssue.value.state==="failed"?(R(),J("button",{key:1,class:"px-3 py-1.5 bg-blue-500 text-white text-xs rounded-lg hover:bg-blue-600",onClick:Ce[4]||(Ce[4]=Se=>A(P).doRetryIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.retry")),1)):Ae("",!0),A(P).selectedIssue.value.state==="completed"?(R(),J("button",{key:2,class:"px-3 py-1.5 bg-purple-500 text-white text-xs rounded-lg hover:bg-purple-600",onClick:Ce[5]||(Ce[5]=Se=>A(P).doMarkDeployed(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.markDeployed")),1)):Ae("",!0),A(P).selectedIssue.value.state==="completed"&&A(P).selectedIssue.value.preview?.running?(R(),J("button",{key:3,class:"px-3 py-1.5 bg-orange-100 text-orange-700 text-xs rounded-lg hover:bg-orange-200",onClick:Ce[6]||(Ce[6]=Se=>A(P).doStopPreview(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.stopPreview")),1)):Ae("",!0),A(P).selectedIssue.value.state==="completed"&&!A(P).selectedIssue.value.preview?.running?(R(),J("button",{key:4,class:"px-3 py-1.5 bg-indigo-100 text-indigo-700 text-xs rounded-lg hover:bg-indigo-200",onClick:Ce[7]||(Ce[7]=Se=>A(P).doRestartPreview(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.restartPreview")),1)):Ae("",!0),A(P).selectedIssue.value.state!=="skipped"?(R(),J("button",{key:5,class:"px-3 py-1.5 bg-yellow-100 text-yellow-700 text-xs rounded-lg hover:bg-yellow-200",onClick:Ce[8]||(Ce[8]=Se=>A(P).doRestartIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.restart")),1)):Ae("",!0),E("button",{class:"px-3 py-1.5 bg-red-100 text-red-600 text-xs rounded-lg hover:bg-red-200",onClick:Ce[9]||(Ce[9]=Se=>A(P).doCancelIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.cancelTrack")),1)])])]),E("div",F2n,[E("div",B2n,[(R(),J(sn,null,bi(["docs","review","supplement","logs","e2e"],Se=>E("button",{key:Se,class:wn(["px-4 py-2.5 text-sm font-medium border-b-2 transition-colors",b.value===Se?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"]),onClick:te=>b.value=Se},M(le.$t(`detail.tab.${Se}`)),11,H2n)),64))]),E("div",G2n,[b.value==="docs"?(R(),Ts(s2t,{key:0,"issue-iid":A(_r)(A(P).selectedIssue.value),"plan-docs":A(I)(A(P).selectedIssue.value),"is-editable-doc":A(N),"detail-version":A(P).detailVersion.value},null,8,["issue-iid","plan-docs","is-editable-doc","detail-version"])):Ae("",!0),b.value==="review"?(R(),Ts(n2t,{key:1,"review-submitting":A(P).reviewSubmitting.value,"review-feedback":A(P).reviewFeedback.value,"review-history":A(P).reviewHistory.value,"onUpdate:reviewFeedback":Ce[10]||(Ce[10]=Se=>A(P).reviewFeedback.value=Se),onApprove:Ce[11]||(Ce[11]=Se=>A(P).doApprovePlan(A(_r)(A(P).selectedIssue.value),oe)),onReject:Ce[12]||(Ce[12]=Se=>A(P).doRejectPlan(A(_r)(A(P).selectedIssue.value),oe)),onSkip:Ce[13]||(Ce[13]=Se=>A(P).doSkipReview(A(_r)(A(P).selectedIssue.value),oe))},null,8,["review-submitting","review-feedback","review-history"])):Ae("",!0),b.value==="supplement"?(R(),Ts(i2t,{key:2,supplement:A(P).detailSupplement.value,"supplement-form":A(P).detailSupplementForm.value,loading:A(P).detailSupplementLoading.value,editing:A(P).detailSupplementEditing.value,saving:A(P).detailSupplementSaving.value,"has-data":A(P).hasSupplementData(A(P).detailSupplement.value),onEdit:Ce[14]||(Ce[14]=Se=>A(P).enterSupplementEdit()),onSave:Ce[15]||(Ce[15]=Se=>A(P).saveDetailSupplement(oe)),onCancel:Ce[16]||(Ce[16]=Se=>A(P).detailSupplementEditing.value=!1),"onUpdate:supplementForm":Ce[17]||(Ce[17]=Se=>A(P).detailSupplementForm.value=Se)},null,8,["supplement","supplement-form","loading","editing","saving","has-data"])):Ae("",!0),b.value==="logs"?(R(),Ts(r2t,{key:3,logs:A(U).filteredLogs.value,"issue-state":A(P).selectedIssue.value.state,"current-phase":A(P).selectedIssue.value.currentPhase,"auto-scroll":A(U).agentAutoScroll.value,"debug-mode":A(U).debugMode.value,"onUpdate:autoScroll":Ce[18]||(Ce[18]=Se=>A(U).agentAutoScroll.value=Se),"onUpdate:debugMode":Ce[19]||(Ce[19]=Se=>A(U).debugMode.value=Se),onClear:Ce[20]||(Ce[20]=Se=>A(U).clear())},null,8,["logs","issue-state","current-phase","auto-scroll","debug-mode"])):Ae("",!0),b.value==="e2e"?(R(),Ts(o2t,{key:4,"issue-iid":A(_r)(A(P).selectedIssue.value)},null,8,["issue-iid"])):Ae("",!0)])])])])):(R(),J("div",J2n,[E("div",U2n,[E("div",z2n,M(le.$t("detail.loading")),1),E("a",q2n,M(le.$t("detail.backToList")),1)])]))}});async function Vbt(a,d){const b=a.body?.getReader();if(!b)return{receivedAny:!1};const m=new TextDecoder;let w="",$=!1;for(;;){const{done:p,value:j}=await b.read();if(p)break;w+=m.decode(j,{stream:!0});const I=w.split(`
|
|
123
|
+
`).filter(Ce=>Ce.trim())})}function ue(Ce){j.value[Ce]=!j.value[Ce]}const oe=En(()=>b.selectedUseCaseId?b.model.relationships.filter(Ce=>Ce.sourceId===b.selectedUseCaseId||Ce.targetId===b.selectedUseCaseId):[]);function re(Ce){const Se=b.model.useCases.find(te=>te.id===Ce);return Se?.displayName||Se?.name||Ce}const ye=Ye(!1),pe=Ye({sourceId:"",targetId:"",type:"include",label:""});function be(){const Ce="ucrel-"+Date.now().toString(36);m("add-relationship",{id:Ce,type:pe.value.type,sourceId:pe.value.sourceId,targetId:pe.value.targetId,label:pe.value.label||void 0}),pe.value={sourceId:"",targetId:"",type:"include",label:""},ye.value=!1}const se=Object.entries(qO).map(([Ce,Se])=>({value:Ce,label:Se.label})),le=Object.entries(x3).map(([Ce,Se])=>({value:Ce,label:Se.label}));return(Ce,Se)=>(R(),J("div",jdn,[E("div",Idn,[E("button",{class:wn(["flex-1 px-3 py-2 text-xs font-medium",w.value==="list"?"text-blue-600 border-b-2 border-blue-600":"text-gray-500 hover:text-gray-700"]),onClick:Se[0]||(Se[0]=te=>w.value="list")},"用例列表",2),E("button",{class:wn(["flex-1 px-3 py-2 text-xs font-medium",w.value==="detail"?"text-blue-600 border-b-2 border-blue-600":"text-gray-500 hover:text-gray-700"]),disabled:!I.value,onClick:Se[1]||(Se[1]=te=>w.value="detail")},"详情",10,Adn)]),E("div",Tdn,[w.value==="list"?(R(),J(sn,{key:0},[E("div",Mdn,[Nn(E("input",{"onUpdate:modelValue":Se[2]||(Se[2]=te=>$.value=te),class:"w-full px-2 py-1 border rounded text-xs",placeholder:"搜索用例..."},null,512),[[Ci,$.value]]),E("div",Pdn,[(R(!0),J(sn,null,bi([{value:"all",label:"全部"},...A(le)],te=>(R(),J("button",{key:te.value,class:wn(["px-2 py-0.5 text-[10px] rounded-full border",p.value===te.value?"bg-blue-600 text-white border-blue-600":"text-gray-500 border-gray-300 hover:border-gray-400"]),onClick:q=>p.value=te.value},M(te.label),11,Ddn))),128))])]),E("div",Odn,M(N.value.length)+"/"+M(a.model.useCases.length)+" 用例 · "+M(a.model.relationships.length)+" 关系 ",1),(R(!0),J(sn,null,bi(N.value,te=>(R(),J("div",{key:te.id,class:wn(["flex items-center gap-2 px-2 py-1.5 rounded text-xs cursor-pointer hover:bg-gray-50 group",{"bg-blue-50":a.selectedUseCaseId===te.id}]),onClick:q=>m("select-usecase",te.id)},[E("span",{class:"w-2 h-2 rounded-full flex-shrink-0",style:_c({backgroundColor:A(x3)[te.importance]?.color})},null,4),E("span",Ndn,M(te.displayName||te.name),1),E("span",Rdn,M(te.mainPath.length)+"步",1),E("button",{class:"text-red-400 hover:text-red-600 opacity-0 group-hover:opacity-100",title:"删除",onClick:Ah(q=>m("remove-usecase",te.id),["stop"])},"×",8,Fdn)],10,Ldn))),128)),E("div",Bdn,[E("div",Hdn,[Se[27]||(Se[27]=E("span",{class:"text-xs font-semibold text-gray-600"},"关系",-1)),E("button",{class:"text-xs text-blue-600 hover:text-blue-800",onClick:Se[3]||(Se[3]=te=>ye.value=!0)},"+ 添加")]),(R(!0),J(sn,null,bi(a.model.relationships,te=>(R(),J("div",{key:te.id,class:"flex items-center gap-1 px-2 py-1 text-[10px] text-gray-500 hover:bg-gray-50 rounded"},[E("span",Gdn,M(re(te.sourceId))+" → "+M(re(te.targetId)),1),E("span",Jdn,M(A(qO)[te.type]?.label),1),E("button",{class:"text-red-400 hover:text-red-600",onClick:q=>m("remove-relationship",te.id)},"×",8,Udn)]))),128))])],64)):Ae("",!0),w.value==="detail"&&I.value?(R(),J("div",zdn,[E("div",qdn,[E("span",{class:"text-[10px] font-medium px-1.5 py-0.5 rounded-full",style:_c({color:A(x3)[I.value.importance]?.color,backgroundColor:A(x3)[I.value.importance]?.bgColor,border:"1px solid "+A(x3)[I.value.importance]?.color})},M(A(x3)[I.value.importance]?.label),5),E("span",Vdn,M(I.value.status),1)]),E("div",Kdn,M(I.value.displayName||I.value.name),1),E("div",Wdn,M(I.value.description),1),E("div",null,[Se[28]||(Se[28]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"参与者",-1)),E("div",Xdn,[ci(" 主: "+M(I.value.primaryActor)+" ",1),I.value.auxiliaryActors.length?(R(),J("span",Ydn," · 辅: "+M(I.value.auxiliaryActors.join(", ")),1)):Ae("",!0)])]),I.value.preconditions.length?(R(),J("div",Qdn,[Se[29]||(Se[29]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"前置条件",-1)),E("ul",Zdn,[(R(!0),J(sn,null,bi(I.value.preconditions,(te,q)=>(R(),J("li",{key:q},M(te),1))),128))])])):Ae("",!0),E("div",null,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[4]||(Se[4]=te=>ue("mainPath"))},[E("span",null,"主路径 ("+M(I.value.mainPath.length)+"步)",1),E("span",null,M(j.value.mainPath?"▼":"▶"),1)]),j.value.mainPath?(R(),J("div",ehn,[(R(!0),J(sn,null,bi(I.value.mainPath,te=>(R(),J("div",{key:te.number,class:"flex gap-2 text-xs py-0.5"},[E("span",thn,M(te.number),1),E("span",{class:wn(["text-[10px] font-medium px-1 rounded flex-shrink-0",{"bg-blue-100 text-blue-700":te.type==="request","bg-yellow-100 text-yellow-700":te.type==="validate","bg-green-100 text-green-700":te.type==="change","bg-purple-100 text-purple-700":te.type==="feedback","bg-orange-100 text-orange-700":te.type==="request-auxiliary","bg-teal-100 text-teal-700":te.type==="validate-auxiliary"}])},M(A(ydn)[te.type]),3),E("span",nhn,M(te.description),1)]))),128))])):Ae("",!0)]),I.value.extensions.length?(R(),J("div",ihn,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[5]||(Se[5]=te=>ue("extensions"))},[E("span",null,"扩展路径 ("+M(I.value.extensions.length)+")",1),E("span",null,M(j.value.extensions?"▼":"▶"),1)]),j.value.extensions?(R(),J("div",rhn,[(R(!0),J(sn,null,bi(I.value.extensions,te=>(R(),J("div",{key:te.id,class:"border-l-2 border-orange-200 pl-2"},[E("div",shn,M(te.condition),1),(R(!0),J(sn,null,bi(te.steps,q=>(R(),J("div",{key:q.number,class:"flex gap-2 text-xs py-0.5"},[E("span",ohn,M(q.number),1),E("span",chn,M(q.description),1)]))),128))]))),128))])):Ae("",!0)])):Ae("",!0),I.value.constraints.length?(R(),J("div",uhn,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[6]||(Se[6]=te=>ue("constraints"))},[E("span",null,"补充约束 ("+M(I.value.constraints.length)+")",1),E("span",null,M(j.value.constraints?"▼":"▶"),1)]),j.value.constraints?(R(),J("div",lhn,[(R(!0),J(sn,null,bi(I.value.constraints,te=>(R(),J("div",{key:te.id,class:"text-xs"},[E("div",ahn,[E("span",{class:wn(["text-[10px] font-medium px-1 rounded",{"bg-blue-100 text-blue-700":te.type==="field-list","bg-yellow-100 text-yellow-700":te.type==="business-rule","bg-green-100 text-green-700":te.type==="quality","bg-purple-100 text-purple-700":te.type==="design"}])},M({"field-list":"字段","business-rule":"规则",quality:"质量",design:"设计"}[te.type]),3),E("span",fhn,M(te.name),1)]),E("div",dhn,M(te.content),1)]))),128))])):Ae("",!0)])):Ae("",!0),I.value.postconditions.length?(R(),J("div",hhn,[Se[30]||(Se[30]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"后置条件",-1)),E("ul",ghn,[(R(!0),J(sn,null,bi(I.value.postconditions,(te,q)=>(R(),J("li",{key:q},M(te),1))),128))])])):Ae("",!0),oe.value.length?(R(),J("div",bhn,[E("label",phn,"关系 ("+M(oe.value.length)+")",1),(R(!0),J(sn,null,bi(oe.value,te=>(R(),J("div",{key:te.id,class:"text-xs text-gray-600 pl-2 py-0.5"},[te.sourceId===a.selectedUseCaseId?(R(),J("span",whn,"→ "+M(re(te.targetId)),1)):(R(),J("span",vhn,"← "+M(re(te.sourceId)),1)),E("span",mhn,"("+M(A(qO)[te.type]?.label)+")",1)]))),128))])):Ae("",!0),E("div",yhn,[E("button",{class:"w-full flex items-center justify-between text-xs font-semibold text-gray-600 py-1",onClick:Se[7]||(Se[7]=te=>ue("edit"))},[Se[31]||(Se[31]=E("span",null,"编辑",-1)),E("span",null,M(j.value.edit?"▼":"▶"),1)]),j.value.edit?(R(),J("div",khn,[E("div",null,[Se[32]||(Se[32]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"名称",-1)),Nn(E("input",{"onUpdate:modelValue":Se[8]||(Se[8]=te=>P.value=te),class:"w-full px-2 py-1 border rounded text-xs",onBlur:Se[9]||(Se[9]=te=>ke())},null,544),[[Ci,P.value]])]),E("div",null,[Se[33]||(Se[33]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"中文名",-1)),Nn(E("input",{"onUpdate:modelValue":Se[10]||(Se[10]=te=>U.value=te),class:"w-full px-2 py-1 border rounded text-xs",onBlur:Se[11]||(Se[11]=te=>ke())},null,544),[[Ci,U.value]])]),E("div",null,[Se[34]||(Se[34]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"描述",-1)),Nn(E("textarea",{"onUpdate:modelValue":Se[12]||(Se[12]=te=>V.value=te),class:"w-full px-2 py-1 border rounded text-xs",rows:"2",onBlur:Se[13]||(Se[13]=te=>ke())},null,544),[[Ci,V.value]])]),E("div",null,[Se[35]||(Se[35]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"重要性",-1)),Nn(E("select",{"onUpdate:modelValue":Se[14]||(Se[14]=te=>X.value=te),class:"w-full px-2 py-1 border rounded text-xs",onChange:Se[15]||(Se[15]=te=>ke())},[(R(!0),J(sn,null,bi(A(le),te=>(R(),J("option",{key:te.value,value:te.value},M(te.label),9,xhn))),128))],544),[[Rd,X.value]])]),E("div",null,[Se[36]||(Se[36]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"前置条件(每行一条)",-1)),Nn(E("textarea",{"onUpdate:modelValue":Se[16]||(Se[16]=te=>ee.value=te),class:"w-full px-2 py-1 border rounded text-xs",rows:"2",onBlur:Se[17]||(Se[17]=te=>ke())},null,544),[[Ci,ee.value]])]),E("div",null,[Se[37]||(Se[37]=E("label",{class:"text-[10px] text-gray-500 uppercase"},"后置条件(每行一条)",-1)),Nn(E("textarea",{"onUpdate:modelValue":Se[18]||(Se[18]=te=>K.value=te),class:"w-full px-2 py-1 border rounded text-xs",rows:"2",onBlur:Se[19]||(Se[19]=te=>ke())},null,544),[[Ci,K.value]])]),E("button",{class:"w-full px-3 py-1.5 text-xs bg-red-50 text-red-600 rounded hover:bg-red-100",onClick:Se[20]||(Se[20]=te=>{m("remove-usecase",I.value.id),w.value="list"})},"删除此用例")])):Ae("",!0)])])):w.value==="detail"?(R(),J("div",$hn,"点击画布上的节点查看详情")):Ae("",!0)]),ye.value?(R(),J("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:Se[26]||(Se[26]=Ah(te=>ye.value=!1,["self"]))},[E("div",Ehn,[Se[41]||(Se[41]=E("h4",{class:"text-sm font-semibold"},"添加用例关系",-1)),E("div",null,[Se[38]||(Se[38]=E("label",{class:"text-[10px] text-gray-500"},"源用例",-1)),Nn(E("select",{"onUpdate:modelValue":Se[21]||(Se[21]=te=>pe.value.sourceId=te),class:"w-full px-2 py-1 border rounded text-xs"},[(R(!0),J(sn,null,bi(a.model.useCases,te=>(R(),J("option",{key:te.id,value:te.id},M(te.displayName||te.name),9,Chn))),128))],512),[[Rd,pe.value.sourceId]])]),E("div",null,[Se[39]||(Se[39]=E("label",{class:"text-[10px] text-gray-500"},"目标用例",-1)),Nn(E("select",{"onUpdate:modelValue":Se[22]||(Se[22]=te=>pe.value.targetId=te),class:"w-full px-2 py-1 border rounded text-xs"},[(R(!0),J(sn,null,bi(a.model.useCases,te=>(R(),J("option",{key:te.id,value:te.id},M(te.displayName||te.name),9,Shn))),128))],512),[[Rd,pe.value.targetId]])]),E("div",null,[Se[40]||(Se[40]=E("label",{class:"text-[10px] text-gray-500"},"关系类型",-1)),Nn(E("select",{"onUpdate:modelValue":Se[23]||(Se[23]=te=>pe.value.type=te),class:"w-full px-2 py-1 border rounded text-xs"},[(R(!0),J(sn,null,bi(A(se),te=>(R(),J("option",{key:te.value,value:te.value},M(te.label),9,_hn))),128))],512),[[Rd,pe.value.type]])]),E("div",jhn,[E("button",{class:"px-3 py-1 text-xs bg-gray-200 rounded hover:bg-gray-300",onClick:Se[24]||(Se[24]=te=>ye.value=!1)},"取消"),E("button",{class:"px-3 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50",disabled:!pe.value.sourceId||!pe.value.targetId,onClick:Se[25]||(Se[25]=te=>be())},"添加",8,Ihn)])])])):Ae("",!0)]))}}),Thn={class:"space-y-3"},Mhn={class:"flex items-center justify-between"},Phn={class:"text-[10px] text-gray-500 uppercase font-semibold"},Dhn={key:0,class:"space-y-1"},Ohn={class:"text-[10px] text-indigo-500 font-mono"},Lhn={class:"flex-1 truncate text-gray-700"},Nhn=["onClick"],Rhn={key:1,class:"text-[10px] text-gray-400"},Fhn={class:"max-h-32 overflow-y-auto space-y-0.5"},Bhn=["onClick"],Hhn={class:"text-[10px] text-gray-400 font-mono"},Ghn={class:"flex-1 truncate text-gray-600"},Jhn=wr({__name:"DomainLinkPanel",props:{useCase:{},availableElements:{}},emits:["update-links","suggest"],setup(a,{emit:d}){const b=a,m=d,w=Ye(""),$=En(()=>b.availableElements.filter(N=>b.useCase.domainElementIds.includes(N.id))),p=En(()=>{const N=w.value.toLowerCase();return b.availableElements.filter(P=>!b.useCase.domainElementIds.includes(P.id)).filter(P=>!N||P.name.toLowerCase().includes(N)||P.displayName.toLowerCase().includes(N))});function j(N){m("update-links",[...b.useCase.domainElementIds,N])}function I(N){m("update-links",b.useCase.domainElementIds.filter(P=>P!==N))}return(N,P)=>(R(),J("div",Thn,[E("div",Mhn,[E("label",Phn,"领域关联 ("+M($.value.length)+")",1),E("button",{class:"text-[10px] text-indigo-600 hover:text-indigo-800",onClick:P[0]||(P[0]=U=>m("suggest"))},"AI 推荐")]),$.value.length?(R(),J("div",Dhn,[(R(!0),J(sn,null,bi($.value,U=>(R(),J("div",{key:U.id,class:"flex items-center gap-2 px-2 py-1 bg-indigo-50 rounded text-xs"},[E("span",Ohn,M(U.type),1),E("span",Lhn,M(U.displayName||U.name),1),E("button",{class:"text-red-400 hover:text-red-600 text-xs",onClick:V=>I(U.id)},"×",8,Nhn)]))),128))])):(R(),J("div",Rhn,"暂无关联的领域元素")),E("div",null,[Nn(E("input",{"onUpdate:modelValue":P[1]||(P[1]=U=>w.value=U),class:"w-full px-2 py-1 border rounded text-xs mb-1",placeholder:"搜索领域元素..."},null,512),[[Ci,w.value]]),E("div",Fhn,[(R(!0),J(sn,null,bi(p.value,U=>(R(),J("div",{key:U.id,class:"flex items-center gap-2 px-2 py-1 hover:bg-gray-50 rounded text-xs cursor-pointer",onClick:V=>j(U.id)},[E("span",Hhn,M(U.type),1),E("span",Ghn,M(U.displayName||U.name),1),P[2]||(P[2]=E("span",{class:"text-blue-500 text-[10px]"},"+ 添加",-1))],8,Bhn))),128))])])]))}}),Uhn={class:"flex flex-col",style:{height:"calc(100vh - 220px)"}},zhn={class:"flex items-center gap-2 px-4 py-2 bg-white border-b border-gray-200"},qhn=["disabled"],Vhn=["disabled"],Khn=["disabled"],Whn=["disabled"],Xhn=["disabled"],Yhn={key:1,class:"text-xs text-gray-400"},Qhn={key:0},Zhn={key:0,class:"bg-red-50 border-b border-red-200 text-red-700 px-4 py-2 text-sm"},e1n={key:1,class:"bg-blue-50 border-b border-blue-200 px-4 py-2"},t1n={class:"flex items-center gap-2 text-sm"},n1n={class:"text-blue-700"},i1n={key:2,class:"border-b border-gray-200 bg-white"},r1n={class:"px-4 py-1.5 flex items-center justify-between bg-gray-50 border-b border-gray-100"},s1n={class:"text-xs font-medium text-gray-600"},o1n={class:"overflow-y-auto",style:{"max-height":"12rem"}},c1n={class:"text-gray-400 mr-2"},u1n={class:"flex-1 flex overflow-hidden"},l1n={key:0,class:"flex-1 relative"},a1n={key:1,class:"flex-1 flex items-center justify-center bg-gray-50"},f1n={class:"text-center"},d1n={class:"text-gray-500 mb-2"},h1n={key:2,class:"w-64 border-l border-gray-200 bg-white overflow-auto p-3"},g1n={key:3,class:"flex items-center gap-4 px-4 py-1.5 bg-gray-50 border-t border-gray-200 text-[10px] text-gray-500 overflow-x-auto"},b1n=wr({__name:"SystemUseCasePanel",setup(a){const{model:d,analyzing:b,analyzeProgress:m,loading:w,error:$,selectedUseCaseId:p,selectedUseCase:j,dirty:I,agentLogs:N,suggestingAssociations:P,loadModel:U,saveModel:V,runAnalysis:X,confirmAndPersist:ee,updateUseCase:K,removeUseCase:he,addRelationship:ke,removeRelationship:ue,suggestDomainAssociations:oe,updateDomainLinks:re}=mdn(),ye=Ye(!1),pe=Ye(!0),be=Ye(!1),se=Ye([]);async function le(){try{const gt=await Ewt();gt.model&&(se.value=gt.model.elements.map(ze=>({id:ze.id,name:ze.name,displayName:ze.displayName,type:ze.type})))}catch{}}const Ce={usecase:I3(Cdn),actor:I3(_dn)},Se=En(()=>{if(!d.value)return[];const gt=[],ze=new Set;for(const Jt of d.value.useCases){ze.add(Jt.primaryActor);for(const xe of Jt.auxiliaryActors)ze.add(xe)}for(const Jt of d.value.actors)ze.add(Jt);let jt=50;for(const Jt of ze)gt.push({id:`actor-${Jt}`,type:"actor",position:{x:50,y:jt},data:{name:Jt}}),jt+=120;for(const[Jt,xe]of d.value.useCases.entries())gt.push({id:xe.id,type:"usecase",position:xe.position??{x:300+Jt%3*250,y:50+Math.floor(Jt/3)*160},data:xe});return gt}),te=En(()=>{if(!d.value)return[];const gt=[];for(const ze of d.value.useCases){gt.push({id:`edge-actor-${ze.primaryActor}-${ze.id}`,source:`actor-${ze.primaryActor}`,target:ze.id,type:"default",style:{stroke:"#94A3B8"}});for(const jt of ze.auxiliaryActors)gt.push({id:`edge-actor-${jt}-${ze.id}`,source:`actor-${jt}`,target:ze.id,type:"default",style:{stroke:"#94A3B8",strokeDasharray:"4 3"}})}for(const ze of d.value.relationships){const jt=qO[ze.type];gt.push({id:ze.id,source:ze.sourceId,target:ze.targetId,label:ze.label||jt?.label||"",type:"default",style:{stroke:jt?.color||"#94A3B8",...jt?.style==="dashed"?{strokeDasharray:"6 3"}:{}},markerEnd:sL.ArrowClosed,data:ze})}return gt});function q(gt){gt.node.type==="usecase"&&(p.value=gt.node.id)}function He(){p.value=null}return gl(async()=>{await U(),await le()}),Jr(()=>b.value,async(gt,ze)=>{ze&&!gt&&await le()}),(gt,ze)=>(R(),J("div",Uhn,[E("div",zhn,[E("button",{class:"px-3 py-1.5 text-sm bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50",disabled:A(b),onClick:ze[0]||(ze[0]=jt=>A(X)(!1))},M(A(b)?"分析中...":"分析系统用例"),9,qhn),E("button",{class:"px-3 py-1.5 text-sm bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50",disabled:A(b),onClick:ze[1]||(ze[1]=jt=>A(X)(!0))},"精炼分析",8,Vhn),E("button",{class:"px-3 py-1.5 text-sm bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50",disabled:!A(d)||A(w),onClick:ze[2]||(ze[2]=jt=>A(V)())}," 保存"+M(A(I)?" *":""),9,Khn),E("button",{class:"px-3 py-1.5 text-sm bg-purple-600 text-white rounded hover:bg-purple-700 disabled:opacity-50",disabled:!A(d)||A(w),onClick:ze[3]||(ze[3]=jt=>A(ee)())},"确认入库",8,Whn),E("button",{class:"px-3 py-1.5 text-sm bg-indigo-600 text-white rounded hover:bg-indigo-700 disabled:opacity-50",disabled:!A(d)||A(P),onClick:ze[4]||(ze[4]=jt=>A(oe)())},M(A(P)?"推荐中...":"推荐关联"),9,Xhn),ze[12]||(ze[12]=E("div",{class:"flex-1"},null,-1)),A(b)?(R(),J("button",{key:0,class:"px-2 py-1 text-xs text-gray-600 border rounded hover:bg-gray-50",onClick:ze[5]||(ze[5]=jt=>ye.value=!ye.value)},M(ye.value?"隐藏日志":"显示日志"),1)):Ae("",!0),E("button",{class:"px-2 py-1 text-xs text-gray-600 border rounded hover:bg-gray-50",onClick:ze[6]||(ze[6]=jt=>be.value=!be.value)},M(be.value?"隐藏关联":"领域关联"),1),E("button",{class:"px-2 py-1 text-xs text-gray-600 border rounded hover:bg-gray-50",onClick:ze[7]||(ze[7]=jt=>pe.value=!pe.value)},M(pe.value?"隐藏面板":"显示面板"),1),A(d)?(R(),J("div",Yhn,[ci(M(A(d).useCases.length)+" 用例 · "+M(A(d).relationships.length)+" 关系 ",1),A(d).analyzedAt?(R(),J("span",Qhn," · 分析于 "+M(new Date(A(d).analyzedAt).toLocaleString("zh-CN")),1)):Ae("",!0)])):Ae("",!0)]),A($)?(R(),J("div",Zhn,M(A($)),1)):Ae("",!0),A(b)&&A(m)?(R(),J("div",e1n,[E("div",t1n,[ze[13]||(ze[13]=E("svg",{class:"animate-spin h-4 w-4 text-blue-600",viewBox:"0 0 24 24",fill:"none"},[E("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),E("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),E("span",n1n,M(A(m).message),1)])])):Ae("",!0),A(b)&&ye.value&&A(N).length>0?(R(),J("div",i1n,[E("div",r1n,[E("span",s1n,"AI 实时日志 ("+M(A(N).length)+")",1)]),E("div",o1n,[(R(!0),J(sn,null,bi(A(N),(jt,Jt)=>(R(),J("div",{key:Jt,class:"px-4 py-1 text-xs text-gray-600 border-b border-gray-50"},[E("span",c1n,M(jt.type),1),E("span",null,M(jt.content),1)]))),128))])])):Ae("",!0),E("div",u1n,[A(d)&&A(d).useCases.length>0?(R(),J("div",l1n,[xr(A(Xvt),{nodes:Se.value,edges:te.value,"node-types":Ce,"default-viewport":{x:0,y:0,zoom:.8},"fit-view-on-init":"",onNodeClick:q,onPaneClick:He},{default:zg(()=>[xr(A(Zvt)),xr(A(e2t))]),_:1},8,["nodes","edges"])])):(R(),J("div",a1n,[E("div",f1n,[ze[14]||(ze[14]=E("div",{class:"text-6xl text-gray-300 mb-4"},"⚙",-1)),E("div",d1n,[A(w)?(R(),J(sn,{key:0},[ci("加载中...")],64)):A(b)?(R(),J(sn,{key:1},[ci("正在分析系统用例...")],64)):(R(),J(sn,{key:2},[ci("暂无系统用例数据")],64))]),!A(w)&&!A(b)?(R(),J("button",{key:0,class:"px-4 py-2 text-sm bg-blue-600 text-white rounded hover:bg-blue-700",onClick:ze[8]||(ze[8]=jt=>A(X)(!1))},"开始分析")):Ae("",!0)])])),be.value&&A(j)?(R(),J("div",h1n,[xr(Jhn,{"use-case":A(j),"available-elements":se.value,onUpdateLinks:ze[9]||(ze[9]=jt=>A(re)(A(p),jt)),onSuggest:ze[10]||(ze[10]=jt=>A(oe)())},null,8,["use-case","available-elements"])])):Ae("",!0),pe.value&&A(d)?(R(),Ts(Ahn,{key:3,model:A(d),"selected-use-case-id":A(p),onSelectUsecase:ze[11]||(ze[11]=jt=>p.value=jt),onUpdateUsecase:A(K),onRemoveUsecase:A(he),onAddRelationship:A(ke),onRemoveRelationship:A(ue)},null,8,["model","selected-use-case-id","onUpdateUsecase","onRemoveUsecase","onAddRelationship","onRemoveRelationship"])):Ae("",!0)]),A(d)?(R(),J("div",g1n,[ze[15]||(ze[15]=E("span",{class:"font-semibold text-gray-600"},"图例:",-1)),(R(!0),J(sn,null,bi(A(x3),(jt,Jt)=>(R(),J("span",{key:Jt,class:"flex items-center gap-1 whitespace-nowrap"},[E("span",{class:"inline-block w-3 h-3 rounded-full border",style:_c({backgroundColor:jt.bgColor,borderColor:jt.color})},null,4),ci(" "+M(jt.label),1)]))),128)),ze[16]||(ze[16]=E("span",{class:"text-gray-400"},"|",-1)),(R(!0),J(sn,null,bi(A(qO),(jt,Jt)=>(R(),J("span",{key:Jt,class:"whitespace-nowrap"},[E("span",{style:_c({color:jt.color})},M(jt.label),5)]))),128))])):Ae("",!0)]))}}),p1n={key:0,class:"fixed inset-0 z-50 flex items-center justify-center"},w1n={class:"relative bg-white rounded-xl shadow-2xl w-full max-w-xl max-h-[90vh] overflow-y-auto"},v1n={class:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between z-10 rounded-t-xl"},m1n={class:"text-lg font-bold text-gray-800"},y1n={class:"px-6 py-4 space-y-4"},k1n={class:"text-sm text-gray-500 mb-1"},x1n={class:"text-sm font-medium text-gray-800"},$1n={key:0},E1n={class:"text-sm text-gray-500 mb-1"},C1n={class:"text-sm text-gray-600 bg-gray-50 rounded-lg p-3 max-h-32 overflow-y-auto whitespace-pre-wrap"},S1n={class:"border-t border-gray-200 pt-4"},_1n={class:"text-sm font-semibold text-gray-700 mb-3"},j1n={class:"space-y-3"},I1n={class:"block text-xs font-medium text-gray-600 mb-1"},A1n=["value","placeholder"],T1n={class:"block text-xs font-medium text-gray-600 mb-1"},M1n=["value","placeholder"],P1n={class:"block text-xs font-medium text-gray-600 mb-1"},D1n=["value","placeholder"],O1n={class:"block text-xs font-medium text-gray-600 mb-1"},L1n=["value","placeholder"],N1n={class:"block text-xs font-medium text-gray-600 mb-1"},R1n=["value","placeholder"],F1n={class:"block text-xs font-medium text-gray-600 mb-1"},B1n=["value","placeholder"],H1n={class:"block text-xs font-medium text-gray-600 mb-1"},G1n=["value","placeholder"],J1n={class:"sticky bottom-0 bg-white border-t border-gray-200 px-6 py-4 flex justify-end space-x-3 rounded-b-xl"},U1n=["disabled"],z1n=wr({__name:"StartDialog",props:{issue:{},supplement:{},processing:{type:Boolean}},emits:["close","start","update:supplement"],setup(a,{emit:d}){const b=a,m=d;function w($,p){m("update:supplement",{...b.supplement,[$]:p})}return($,p)=>(R(),Ts(wwt,{name:"fade"},{default:zg(()=>[a.issue?(R(),J("div",p1n,[E("div",{class:"absolute inset-0 bg-black/30",onClick:p[0]||(p[0]=j=>m("close"))}),E("div",w1n,[E("div",v1n,[E("h2",m1n,M($.$t("start.title",{iid:a.issue.iid})),1),E("button",{class:"text-gray-400 hover:text-gray-600 text-2xl leading-none",onClick:p[1]||(p[1]=j=>m("close"))},"×")]),E("div",y1n,[E("div",null,[E("div",k1n,M($.$t("start.issueTitle")),1),E("div",x1n,M(a.issue.title),1)]),a.issue.description?(R(),J("div",$1n,[E("div",E1n,M($.$t("start.descPreview")),1),E("div",C1n,M(a.issue.description?.slice(0,500))+M((a.issue.description?.length||0)>500?"...":""),1)])):Ae("",!0),E("div",S1n,[E("h3",_1n,M($.$t("start.supplement")),1),E("div",j1n,[E("div",null,[E("label",I1n,M($.$t("start.requirements")),1),E("textarea",{value:a.supplement.requirements,onInput:p[2]||(p[2]=j=>w("requirements",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.requirementsPlaceholder")},null,40,A1n)]),E("div",null,[E("label",T1n,M($.$t("start.acceptance")),1),E("textarea",{value:a.supplement.acceptanceCriteria,onInput:p[3]||(p[3]=j=>w("acceptanceCriteria",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.acceptancePlaceholder")},null,40,M1n)]),E("div",null,[E("label",P1n,M($.$t("start.scope")),1),E("input",{value:a.supplement.scope,onInput:p[4]||(p[4]=j=>w("scope",j.target.value)),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.scopePlaceholder")},null,40,D1n)]),E("div",null,[E("label",O1n,M($.$t("start.constraints")),1),E("textarea",{value:a.supplement.constraints,onInput:p[5]||(p[5]=j=>w("constraints",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.constraintsPlaceholder")},null,40,L1n)]),E("div",null,[E("label",N1n,M($.$t("start.references")),1),E("textarea",{value:a.supplement.references,onInput:p[6]||(p[6]=j=>w("references",j.target.value)),rows:"1",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.referencesPlaceholder")},null,40,R1n)]),E("div",null,[E("label",F1n,M($.$t("start.freeText")),1),E("textarea",{value:a.supplement.freeText,onInput:p[7]||(p[7]=j=>w("freeText",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.freeTextPlaceholder")},null,40,B1n)]),E("div",null,[E("label",H1n,M($.$t("start.tapdId")),1),E("input",{value:a.supplement.tapdId,onInput:p[8]||(p[8]=j=>w("tapdId",j.target.value)),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:$.$t("start.tapdIdPlaceholder")},null,40,G1n)])])])]),E("div",J1n,[E("button",{class:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200",onClick:p[9]||(p[9]=j=>m("close"))},M($.$t("start.cancel")),1),E("button",{class:"px-4 py-2 text-sm text-white bg-green-500 rounded-lg hover:bg-green-600 font-medium disabled:opacity-50",disabled:a.processing,onClick:p[10]||(p[10]=j=>m("start"))},M(a.processing?$.$t("start.processing"):$.$t("start.submit")),9,U1n)])])])):Ae("",!0)]),_:1}))}}),q1n={key:0,class:"text-base font-semibold text-gray-700 mb-3"},V1n={key:1,class:"flex flex-col gap-1"},K1n={class:"flex items-center gap-3"},W1n={key:0},X1n={key:1,class:"pulse-dot"},Y1n={key:2},Q1n={key:3},Z1n={class:"flex-1 min-w-0"},e0n={class:"flex items-center gap-2"},t0n={key:0,class:"text-xs text-gray-400"},n0n=["onClick"],i0n={key:0,class:"ml-3.5 relative"},r0n={key:2,class:"flex items-center justify-between"},s0n={class:"flex flex-col items-center space-y-1"},o0n={key:0},c0n={key:1,class:"pulse-dot"},u0n={key:2},l0n={key:3},a0n={class:"text-xs text-gray-600"},f0n={key:0,class:"text-xs text-gray-400"},d0n=["onClick"],h0n={key:0,class:"flex-1 relative mx-2"},g0n=["title"],t2t=wr({__name:"PipelineProgress",props:{issue:{},progress:{},verifyFixLoop:{},vertical:{type:Boolean}},emits:["retryFromPhase"],setup(a,{emit:d}){const b=a,m=d,{getPhaseNames:w,phaseLabel:$,phaseNodeClass:p,phaseStatus:j}=r_();function I(P){return b.progress?.phases?.[P]?b.progress.phases[P].status:j(b.issue,P)}function N(P){if(!b.progress?.phases)return"";const U=b.progress.phases[P];if(!U?.startedAt)return"";const V=new Date(U.startedAt),X=U.completedAt?new Date(U.completedAt):new Date;return Awt(X.getTime()-V.getTime())}return(P,U)=>(R(),J("div",null,[a.vertical?Ae("",!0):(R(),J("h3",q1n,M(P.$t("pipeline.title")),1)),a.vertical?(R(),J("div",V1n,[(R(!0),J(sn,null,bi(A(w)(a.issue),(V,X)=>(R(),J(sn,{key:V},[E("div",K1n,[E("div",{class:wn(["w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0",A(p)(I(V))])},[I(V)==="completed"?(R(),J("span",W1n,"✓")):I(V)==="in_progress"?(R(),J("span",X1n,"●")):I(V)==="failed"?(R(),J("span",Y1n,"✗")):(R(),J("span",Q1n,M(X+1),1))],2),E("div",Z1n,[E("div",e0n,[E("span",{class:wn(["text-sm font-medium",I(V)==="in_progress"?"text-blue-600":"text-gray-700"])},M(A($)(V)),3),N(V)?(R(),J("span",t0n,M(N(V)),1)):Ae("",!0)])]),E("button",{class:"text-xs text-gray-400 hover:text-blue-600 hover:underline flex-shrink-0",onClick:ee=>m("retryFromPhase",V)},M(P.$t("pipeline.retryFrom")),9,n0n)]),X<A(w)(a.issue).length-1?(R(),J("div",i0n,[E("div",{class:wn(["w-px h-3",I(V)==="completed"?"bg-green-400":"bg-gray-200"])},null,2),a.verifyFixLoop&&a.verifyFixLoop.iteration>0&&V==="build"?(R(),J("span",{key:0,class:wn(["absolute -left-1 top-0 text-xs rounded-full px-1.5 py-0.5 font-medium whitespace-nowrap border",a.verifyFixLoop.active?"bg-amber-100 text-amber-700 border-amber-300":a.verifyFixLoop.lastPassed?"bg-green-100 text-green-700 border-green-300":"bg-red-100 text-red-700 border-red-300"]),style:{"margin-left":"24px"}},"⟲ "+M(a.verifyFixLoop.iteration)+"/"+M(a.verifyFixLoop.maxIterations),3)):Ae("",!0)])):Ae("",!0)],64))),128))])):(R(),J("div",r0n,[(R(!0),J(sn,null,bi(A(w)(a.issue),(V,X)=>(R(),J(sn,{key:V},[E("div",s0n,[E("div",{class:wn(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-bold",A(p)(I(V))])},[I(V)==="completed"?(R(),J("span",o0n,"✓")):I(V)==="in_progress"?(R(),J("span",c0n,"●")):I(V)==="failed"?(R(),J("span",u0n,"✗")):(R(),J("span",l0n,M(X+1),1))],2),E("span",a0n,M(A($)(V)),1),N(V)?(R(),J("span",f0n,M(N(V)),1)):Ae("",!0),E("button",{class:"text-xs text-blue-500 hover:text-blue-700 hover:underline mt-0.5",onClick:ee=>m("retryFromPhase",V)},M(P.$t("pipeline.retryFrom")),9,d0n)]),X<A(w)(a.issue).length-1?(R(),J("div",h0n,[E("div",{class:wn(["h-0.5",I(A(w)(a.issue)[X])==="completed"?"bg-green-400":"bg-gray-200"])},null,2),a.verifyFixLoop&&a.verifyFixLoop.iteration>0&&V==="build"?(R(),J("span",{key:0,class:wn(["absolute -top-3.5 left-1/2 -translate-x-1/2 text-xs rounded-full px-1.5 py-0.5 font-medium whitespace-nowrap border",a.verifyFixLoop.active?"bg-amber-100 text-amber-700 border-amber-300":a.verifyFixLoop.lastPassed?"bg-green-100 text-green-700 border-green-300":"bg-red-100 text-red-700 border-red-300"]),title:P.$t("verify.loopBadgeTooltip",{n:a.verifyFixLoop.iteration,max:a.verifyFixLoop.maxIterations})},"⟲ "+M(a.verifyFixLoop.iteration)+"/"+M(a.verifyFixLoop.maxIterations),11,g0n)):Ae("",!0)])):Ae("",!0)],64))),128))]))]))}}),b0n={class:"bg-yellow-50 border-2 border-yellow-300 rounded-lg p-4"},p0n={class:"text-base font-semibold text-yellow-800 mb-3"},w0n={class:"text-sm text-yellow-700 mb-3"},v0n={key:0,class:"text-yellow-600 font-medium"},m0n={key:0,class:"mb-4"},y0n={class:"flex items-center mb-2"},k0n={class:"text-xs font-semibold text-yellow-700"},x0n={class:"ml-2 px-1.5 py-0.5 text-xs bg-yellow-200 text-yellow-800 rounded-full"},$0n={class:"space-y-2 max-h-48 overflow-y-auto border border-yellow-200 rounded-lg bg-white/60 p-3"},E0n={class:"flex items-baseline space-x-2 mb-0.5"},C0n={class:"text-xs font-semibold text-yellow-700"},S0n={class:"text-xs text-gray-400"},_0n={class:"text-sm text-gray-700 whitespace-pre-wrap break-words"},j0n={class:"flex items-center space-x-3 mb-3"},I0n=["disabled"],A0n=["disabled"],T0n={class:"space-y-2"},M0n={class:"block text-xs font-medium text-yellow-700"},P0n=["placeholder"],D0n=["disabled"],n2t=wr({__name:"ReviewGatePanel",props:cX({reviewSubmitting:{type:Boolean},reviewHistory:{}},{reviewFeedback:{required:!0},reviewFeedbackModifiers:{}}),emits:cX(["approve","reject","skip"],["update:reviewFeedback"]),setup(a,{emit:d}){const b=ime(a,"reviewFeedback"),m=d;function w($){try{return new Date($).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return $}}return($,p)=>(R(),J("div",b0n,[E("h3",p0n,M($.$t("review.title")),1),E("p",w0n,[ci(M($.$t("review.description"))+" ",1),a.reviewHistory.length>0?(R(),J("span",v0n,M($.$t("review.currentRound",{round:a.reviewHistory.length+1})),1)):Ae("",!0)]),a.reviewHistory.length>0?(R(),J("div",m0n,[E("div",y0n,[E("span",k0n,M($.$t("review.history")),1),E("span",x0n,M($.$t("review.roundLabel",{n:a.reviewHistory.length})),1)]),E("div",$0n,[(R(!0),J(sn,null,bi(a.reviewHistory,j=>(R(),J("div",{key:j.round,class:wn(["relative pl-5 pb-2 border-l-2",j.round===a.reviewHistory.length?"border-yellow-500":"border-yellow-200"])},[E("div",{class:wn(["absolute left-[-5px] top-1 w-2 h-2 rounded-full",j.round===a.reviewHistory.length?"bg-yellow-500":"bg-yellow-300"])},null,2),E("div",E0n,[E("span",C0n,M($.$t("review.roundPrefix",{round:j.round})),1),E("span",S0n,M(w(j.timestamp)),1)]),E("p",_0n,M(j.feedback),1)],2))),128))])])):Ae("",!0),E("div",j0n,[E("button",{class:"px-4 py-2 bg-green-500 text-white text-sm rounded-lg hover:bg-green-600 font-medium disabled:opacity-50",disabled:a.reviewSubmitting,onClick:p[0]||(p[0]=j=>m("approve"))},M(a.reviewSubmitting?$.$t("review.submitting"):$.$t("review.approve")),9,I0n),E("button",{class:"px-4 py-2 bg-gray-400 text-white text-sm rounded-lg hover:bg-gray-500 font-medium disabled:opacity-50",disabled:a.reviewSubmitting,onClick:p[1]||(p[1]=j=>m("skip"))},M($.$t("review.skip")),9,A0n)]),E("div",T0n,[E("label",M0n,M($.$t("review.feedbackLabel")),1),Nn(E("textarea",{"onUpdate:modelValue":p[2]||(p[2]=j=>b.value=j),rows:"3",class:"w-full border border-yellow-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-yellow-400",placeholder:$.$t("review.feedbackPlaceholder")},null,8,P0n),[[Ci,b.value]]),E("button",{class:"px-4 py-2 bg-red-500 text-white text-sm rounded-lg hover:bg-red-600 font-medium disabled:opacity-50",disabled:a.reviewSubmitting||!b.value.trim(),onClick:p[3]||(p[3]=j=>m("reject"))},M($.$t("review.reject")),9,D0n)])]))}}),O0n={class:"flex items-center justify-between mb-2"},L0n={class:"text-base font-semibold text-gray-700"},N0n={class:"flex items-center space-x-2"},R0n=["disabled"],F0n={key:0,class:"py-4 text-center text-gray-400 text-sm"},B0n={key:1},H0n={key:0,class:"space-y-2 text-sm"},G0n={key:0},J0n={class:"text-gray-500 font-medium"},U0n={class:"text-gray-700"},z0n={key:1},q0n={class:"text-gray-500 font-medium"},V0n={class:"text-gray-700"},K0n={key:2},W0n={class:"text-gray-500 font-medium"},X0n={class:"text-gray-700"},Y0n={key:3},Q0n={class:"text-gray-500 font-medium"},Z0n={class:"text-gray-700"},egn={key:4},tgn={class:"text-gray-500 font-medium"},ngn={class:"text-gray-700"},ign={key:5},rgn={class:"text-gray-500 font-medium"},sgn={class:"text-gray-700"},ogn={key:6},cgn={class:"text-gray-500 font-medium"},ugn={class:"text-gray-700"},lgn={key:1,class:"py-4 text-center text-gray-400 text-sm"},agn={key:2,class:"space-y-3"},fgn={class:"block text-xs font-medium text-gray-600 mb-1"},dgn=["value"],hgn={class:"block text-xs font-medium text-gray-600 mb-1"},ggn=["value"],bgn={class:"block text-xs font-medium text-gray-600 mb-1"},pgn=["value"],wgn={class:"block text-xs font-medium text-gray-600 mb-1"},vgn=["value"],mgn={class:"block text-xs font-medium text-gray-600 mb-1"},ygn=["value"],kgn={class:"block text-xs font-medium text-gray-600 mb-1"},xgn=["value"],$gn={class:"block text-xs font-medium text-gray-600 mb-1"},Egn=["value","placeholder"],i2t=wr({__name:"SupplementEditor",props:{supplement:{},supplementForm:{},loading:{type:Boolean},editing:{type:Boolean},saving:{type:Boolean},hasData:{type:Boolean}},emits:["edit","save","cancel","update:supplementForm"],setup(a,{emit:d}){const b=a,m=d;function w($,p){m("update:supplementForm",{...b.supplementForm,[$]:p})}return($,p)=>(R(),J("div",null,[E("div",O0n,[E("h3",L0n,M($.$t("supplement.title")),1),E("div",N0n,[a.editing?(R(),J(sn,{key:1},[E("button",{class:"px-2 py-1 text-xs bg-green-500 text-white rounded hover:bg-green-600",disabled:a.saving,onClick:p[1]||(p[1]=j=>m("save"))},M(a.saving?$.$t("supplement.saving"):$.$t("supplement.save")),9,R0n),E("button",{class:"px-2 py-1 text-xs bg-gray-200 text-gray-600 rounded hover:bg-gray-300",onClick:p[2]||(p[2]=j=>m("cancel"))},M($.$t("supplement.cancel")),1)],64)):(R(),J("button",{key:0,class:"px-2 py-1 text-xs bg-blue-100 text-blue-600 rounded hover:bg-blue-200",onClick:p[0]||(p[0]=j=>m("edit"))},M($.$t("supplement.edit")),1))])]),a.loading?(R(),J("div",F0n,M($.$t("supplement.loading")),1)):a.editing?(R(),J("div",agn,[E("div",null,[E("label",fgn,M($.$t("supplement.requirementsLabel")),1),E("textarea",{value:a.supplementForm.requirements,onInput:p[3]||(p[3]=j=>w("requirements",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,dgn)]),E("div",null,[E("label",hgn,M($.$t("supplement.acceptanceLabel")),1),E("textarea",{value:a.supplementForm.acceptanceCriteria,onInput:p[4]||(p[4]=j=>w("acceptanceCriteria",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,ggn)]),E("div",null,[E("label",bgn,M($.$t("supplement.scopeLabel")),1),E("input",{value:a.supplementForm.scope,onInput:p[5]||(p[5]=j=>w("scope",j.target.value)),type:"text",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,pgn)]),E("div",null,[E("label",wgn,M($.$t("supplement.constraintsLabel")),1),E("textarea",{value:a.supplementForm.constraints,onInput:p[6]||(p[6]=j=>w("constraints",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,vgn)]),E("div",null,[E("label",mgn,M($.$t("supplement.referencesLabel")),1),E("textarea",{value:a.supplementForm.references,onInput:p[7]||(p[7]=j=>w("references",j.target.value)),rows:"1",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,ygn)]),E("div",null,[E("label",kgn,M($.$t("supplement.freeTextLabel")),1),E("textarea",{value:a.supplementForm.freeText,onInput:p[8]||(p[8]=j=>w("freeText",j.target.value)),rows:"2",class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,xgn)]),E("div",null,[E("label",$gn,M($.$t("supplement.tapdIdLabel")),1),E("input",{value:a.supplementForm.tapdId,onInput:p[9]||(p[9]=j=>w("tapdId",j.target.value)),type:"text",placeholder:$.$t("supplement.tapdIdPlaceholder"),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"},null,40,Egn)])])):(R(),J("div",B0n,[a.hasData?(R(),J("div",H0n,[a.supplement.requirements?(R(),J("div",G0n,[E("span",J0n,M($.$t("supplement.requirements")),1),p[10]||(p[10]=ci()),E("span",U0n,M(a.supplement.requirements),1)])):Ae("",!0),a.supplement.acceptanceCriteria?(R(),J("div",z0n,[E("span",q0n,M($.$t("supplement.acceptance")),1),p[11]||(p[11]=ci()),E("span",V0n,M(a.supplement.acceptanceCriteria),1)])):Ae("",!0),a.supplement.scope?(R(),J("div",K0n,[E("span",W0n,M($.$t("supplement.scope")),1),p[12]||(p[12]=ci()),E("span",X0n,M(a.supplement.scope),1)])):Ae("",!0),a.supplement.constraints?(R(),J("div",Y0n,[E("span",Q0n,M($.$t("supplement.constraints")),1),p[13]||(p[13]=ci()),E("span",Z0n,M(a.supplement.constraints),1)])):Ae("",!0),a.supplement.references?(R(),J("div",egn,[E("span",tgn,M($.$t("supplement.references")),1),p[14]||(p[14]=ci()),E("span",ngn,M(a.supplement.references),1)])):Ae("",!0),a.supplement.freeText?(R(),J("div",ign,[E("span",rgn,M($.$t("supplement.freeText")),1),p[15]||(p[15]=ci()),E("span",sgn,M(a.supplement.freeText),1)])):Ae("",!0),a.supplement.tapdId?(R(),J("div",ogn,[E("span",cgn,M($.$t("supplement.tapdId")),1),p[16]||(p[16]=ci()),E("span",ugn,M(a.supplement.tapdId),1)])):Ae("",!0)])):(R(),J("div",lgn,M($.$t("supplement.empty")),1))]))]))}}),Cgn={class:"flex items-center justify-between mb-2"},Sgn={class:"text-base font-semibold text-gray-700"},_gn={class:"flex items-center space-x-2"},jgn={class:"flex items-center space-x-1 text-xs text-gray-500 cursor-pointer"},Ign={class:"flex items-center space-x-1 text-xs text-gray-500 cursor-pointer"},Agn={key:0,class:"border border-gray-200 rounded-lg p-6 text-center text-gray-400 text-sm"},Tgn={class:"text-xs mt-1"},Mgn={key:0,class:"text-xs mt-1"},Pgn={class:"log-badge"},Dgn={class:"text-gray-400 text-xs mr-1"},Ogn={key:0,class:"text-gray-400 text-xs mr-1"},Lgn={class:"text-gray-700 break-all"},Ngn={key:2,class:"text-xs text-gray-400 mt-1 text-right"},r2t=wr({__name:"AgentLogViewer",props:cX({logs:{},issueState:{},currentPhase:{}},{autoScroll:{type:Boolean,default:!0},autoScrollModifiers:{},debugMode:{type:Boolean,default:!1},debugModeModifiers:{}}),emits:cX(["clear"],["update:autoScroll","update:debugMode"]),setup(a,{emit:d}){const b=d,m=ime(a,"autoScroll"),w=ime(a,"debugMode"),{stateLabel:$,isTerminalState:p}=r_(),{agentLogContainer:j,agentLogLabel:I}=JX();return(N,P)=>(R(),J("div",null,[E("div",Cgn,[E("h3",Sgn,M(N.$t("agentLog.title")),1),E("div",_gn,[E("label",jgn,[Nn(E("input",{type:"checkbox","onUpdate:modelValue":P[0]||(P[0]=U=>m.value=U),class:"rounded"},null,512),[[a9,m.value]]),E("span",null,M(N.$t("agentLog.autoScroll")),1)]),E("label",Ign,[Nn(E("input",{type:"checkbox","onUpdate:modelValue":P[1]||(P[1]=U=>w.value=U),class:"rounded"},null,512),[[a9,w.value]]),P[3]||(P[3]=E("span",null,"Debug",-1))]),E("button",{class:"px-2 py-0.5 text-xs bg-gray-200 text-gray-600 rounded hover:bg-gray-300",onClick:P[2]||(P[2]=U=>b("clear"))},M(N.$t("agentLog.clear")),1)])]),a.logs.length===0?(R(),J("div",Agn,[a.issueState&&A(p)(a.issueState)?(R(),J(sn,{key:0},[P[4]||(P[4]=E("svg",{class:"h-5 w-5 mx-auto mb-2 text-gray-300",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-3-3v6m-7 4h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)),E("div",null,M(N.$t("agentLog.ended")),1),E("div",Tgn,[ci(M(N.$t("agentLog.finalState"))+" ",1),E("span",{class:wn(a.issueState==="completed"?"text-green-500":"text-red-500")},M(A($)(a.issueState,a.currentPhase)),3)])],64)):(R(),J(sn,{key:1},[P[5]||(P[5]=E("svg",{class:"animate-spin h-5 w-5 mx-auto mb-2 text-blue-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[E("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),E("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),E("div",null,M(N.$t("agentLog.waiting")),1),a.issueState?(R(),J("div",Mgn,M(N.$t("agentLog.currentState"))+" "+M(A($)(a.issueState,a.currentPhase)),1)):Ae("",!0)],64))])):(R(),J("div",{key:1,ref_key:"agentLogContainer",ref:j,class:"agent-log border border-gray-200 rounded-lg overflow-y-auto bg-white",style:{"max-height":"20rem"}},[(R(!0),J(sn,null,bi(a.logs,(U,V)=>(R(),J("div",{key:V,class:wn(["agent-log-item","log-"+U.type])},[E("span",Pgn,M(A(I)(U.type)),1),E("span",Dgn,M(A(Twt)(U.timestamp)),1),U.phase?(R(),J("span",Ogn,"["+M(U.phase)+"]",1)):Ae("",!0),E("span",Lgn,M(U.summary),1)],2))),128))],512)),a.logs.length>0?(R(),J("div",Ngn,M(N.$t("agentLog.count",{count:a.logs.length})),1)):Ae("",!0)]))}}),Rgn={class:"flex items-center justify-between mb-2"},Fgn={class:"text-base font-semibold text-gray-700"},Bgn={class:"flex items-center space-x-2"},Hgn=["disabled"],Ggn=["title"],Jgn={class:"flex space-x-1 mb-3 border-b border-gray-200"},Ugn=["onClick"],zgn={key:0,class:"py-8 text-center text-gray-400"},qgn={key:1,class:"py-8 text-center text-gray-400"},Vgn={key:2},Kgn=["placeholder"],Wgn=["innerHTML"],Xgn={key:4,class:"py-8 text-center text-gray-400"},Ygn={key:0,class:"fullscreen-doc-overlay"},Qgn={class:"fullscreen-doc-container"},Zgn={class:"flex items-center justify-between px-6 py-4 border-b border-gray-200 shrink-0"},ebn={class:"flex items-center space-x-3"},tbn={class:"text-lg font-bold text-gray-800"},nbn={class:"text-sm text-gray-400"},ibn={class:"flex items-center space-x-2"},rbn=["disabled"],sbn=["title"],obn={class:"flex space-x-1 px-6 pt-3 border-b border-gray-200 shrink-0"},cbn=["onClick"],ubn={class:"flex-1 overflow-y-auto min-h-0"},lbn={key:0,class:"flex items-center justify-center h-full text-gray-400"},abn={class:"text-base"},fbn={key:1,class:"flex items-center justify-center h-full text-gray-400"},dbn={class:"text-base"},hbn={key:2,class:"h-full p-4"},gbn=["placeholder"],bbn=["innerHTML"],pbn={key:4,class:"flex items-center justify-center h-full text-gray-400"},wbn={class:"text-base"},s2t=wr({__name:"PlanDocViewer",props:{issueIid:{},planDocs:{},isEditableDoc:{type:Function},detailVersion:{}},setup(a,{expose:d}){const b=a;Jr(()=>b.detailVersion,()=>{m.value&&ee(m.value)});const m=Ye(null),w=Ye(""),$=Ye(!1),p=Ye(""),j=Ye(!1),I=Ye(""),N=Ye(!1),P=Ye(!1),U=Ye(!1),{t:V}=Kg(),X={"review-feedback.md":()=>V("planDoc.noReviewFeedback"),"02-verify-report.md":()=>V("planDoc.verifyNotGenerated"),"04-verify-report.md":()=>V("planDoc.verifyNotGenerated")};async function ee(ye){m.value=ye,j.value=!1,I.value="",$.value=!0,w.value="",p.value="",P.value=!1;try{w.value=await Rgt(b.issueIid,ye,"html")}catch(pe){const be=pe.message;be.includes("not found")&&ye in X?(P.value=!0,p.value=X[ye]()):p.value=be}finally{$.value=!1}}async function K(){if(m.value)try{I.value=await Rgt(b.issueIid,m.value,"raw"),j.value=!0}catch(ye){alert(V("planDoc.fetchFailed")+" "+ye.message)}}function he(){j.value=!1,I.value="",m.value&&ee(m.value)}async function ke(){if(m.value){N.value=!0;try{await TKt(b.issueIid,m.value,I.value),j.value=!1,I.value="",await ee(m.value)}catch(ye){alert(V("planDoc.saveFailed")+" "+ye.message)}finally{N.value=!1}}}function ue(){U.value=!0,document.body.style.overflow="hidden",!m.value&&b.planDocs.length>0&&ee(b.planDocs[0].file)}function oe(){U.value=!1,document.body.style.overflow=""}function re(ye){ye.key==="Escape"&&U.value&&oe()}return gl(()=>{document.addEventListener("keydown",re),b.planDocs.length>0&&ee(b.planDocs[0].file)}),dp(()=>{document.removeEventListener("keydown",re),document.body.style.overflow=""}),d({activeDoc:m}),(ye,pe)=>(R(),J("div",null,[E("div",Rgn,[E("h3",Fgn,M(ye.$t("planDoc.title")),1),E("div",Bgn,[m.value&&a.isEditableDoc(m.value)&&!U.value?(R(),J(sn,{key:0},[j.value?(R(),J(sn,{key:1},[E("button",{class:"px-2 py-1 text-xs bg-green-500 text-white rounded hover:bg-green-600",disabled:N.value,onClick:pe[1]||(pe[1]=be=>ke())},M(N.value?ye.$t("planDoc.saving"):ye.$t("planDoc.save")),9,Hgn),E("button",{class:"px-2 py-1 text-xs bg-gray-200 text-gray-600 rounded hover:bg-gray-300",onClick:pe[2]||(pe[2]=be=>he())},M(ye.$t("planDoc.cancel")),1)],64)):(R(),J("button",{key:0,class:"px-2 py-1 text-xs bg-blue-100 text-blue-600 rounded hover:bg-blue-200",onClick:pe[0]||(pe[0]=be=>K())},M(ye.$t("planDoc.edit")),1))],64)):Ae("",!0),E("button",{class:"px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded hover:bg-gray-200 inline-flex items-center space-x-1",title:ye.$t("planDoc.fullscreen"),onClick:pe[3]||(pe[3]=be=>ue())},[pe[10]||(pe[10]=E("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})],-1)),E("span",null,M(ye.$t("planDoc.expand")),1)],8,Ggn)])]),E("div",Jgn,[(R(!0),J(sn,null,bi(a.planDocs,be=>(R(),J("button",{key:be.file,class:wn(["px-3 py-2 text-sm font-medium border-b-2 transition-colors",m.value===be.file?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"]),onClick:se=>ee(be.file)},M(be.label),11,Ugn))),128))]),$.value?(R(),J("div",zgn,M(ye.$t("planDoc.loading")),1)):p.value?(R(),J("div",qgn,M(p.value),1)):j.value&&!U.value?(R(),J("div",Vgn,[Nn(E("textarea",{"onUpdate:modelValue":pe[4]||(pe[4]=be=>I.value=be),class:"w-full h-96 border border-gray-300 rounded-lg p-3 text-sm font-mono text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:ye.$t("planDoc.editPlaceholder")},null,8,Kgn),[[Ci,I.value]])])):w.value&&!U.value?(R(),J("div",{key:3,class:"plan-doc text-sm text-gray-700 max-h-96 overflow-y-auto border border-gray-100 rounded-lg p-4",innerHTML:w.value},null,8,Wgn)):U.value?Ae("",!0):(R(),J("div",Xgn,M(ye.$t("planDoc.selectTab")),1)),(R(),Ts(Lme,{to:"body"},[xr(wwt,{name:"fullscreen-fade"},{default:zg(()=>[U.value?(R(),J("div",Ygn,[E("div",Qgn,[E("div",Zgn,[E("div",ebn,[E("h2",tbn,M(ye.$t("planDoc.title")),1),E("span",nbn,"Issue #"+M(a.issueIid),1)]),E("div",ibn,[m.value&&a.isEditableDoc(m.value)?(R(),J(sn,{key:0},[j.value?(R(),J(sn,{key:1},[E("button",{class:"px-3 py-1.5 text-sm bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors",disabled:N.value,onClick:pe[6]||(pe[6]=be=>ke())},M(N.value?ye.$t("planDoc.saving"):ye.$t("planDoc.save")),9,rbn),E("button",{class:"px-3 py-1.5 text-sm bg-gray-200 text-gray-600 rounded-lg hover:bg-gray-300 transition-colors",onClick:pe[7]||(pe[7]=be=>he())},M(ye.$t("planDoc.cancel")),1)],64)):(R(),J("button",{key:0,class:"px-3 py-1.5 text-sm bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors",onClick:pe[5]||(pe[5]=be=>K())},M(ye.$t("planDoc.edit")),1))],64)):Ae("",!0),E("button",{class:"ml-2 p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",title:ye.$t("planDoc.closeFullscreen"),onClick:pe[8]||(pe[8]=be=>oe())},[...pe[11]||(pe[11]=[E("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,sbn)])]),E("div",obn,[(R(!0),J(sn,null,bi(a.planDocs,be=>(R(),J("button",{key:"fs-"+be.file,class:wn(["px-4 py-2.5 text-sm font-medium border-b-2 transition-colors",m.value===be.file?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"]),onClick:se=>ee(be.file)},M(be.label),11,cbn))),128))]),E("div",ubn,[$.value?(R(),J("div",lbn,[E("span",abn,M(ye.$t("planDoc.loading")),1)])):p.value?(R(),J("div",fbn,[E("span",dbn,M(p.value),1)])):j.value?(R(),J("div",hbn,[Nn(E("textarea",{"onUpdate:modelValue":pe[9]||(pe[9]=be=>I.value=be),class:"w-full h-full border border-gray-300 rounded-lg p-4 text-sm font-mono text-gray-700 resize-none focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:ye.$t("planDoc.editPlaceholder")},null,8,gbn),[[Ci,I.value]])])):w.value?(R(),J("div",{key:3,class:"plan-doc text-sm text-gray-700 p-6",innerHTML:w.value},null,8,bbn)):(R(),J("div",pbn,[E("span",wbn,M(ye.$t("planDoc.selectTab")),1)]))])])])):Ae("",!0)]),_:1})]))]))}}),vbn={class:"bg-white rounded-xl shadow-2xl w-[90vw] max-w-5xl max-h-[90vh] flex flex-col overflow-hidden"},mbn={class:"flex items-center justify-between px-6 py-4 border-b border-gray-200 bg-gray-50"},ybn={class:"text-lg font-bold text-gray-800"},kbn={key:0,class:"text-sm text-gray-500 mt-0.5"},xbn={class:"text-xs text-gray-400 ml-2"},$bn={key:0,class:"flex-1 flex items-center justify-center py-12"},Ebn={class:"text-sm text-gray-400"},Cbn={key:1,class:"flex-1 flex items-center justify-center py-12"},Sbn={class:"text-sm text-red-500"},_bn={class:"flex border-b border-gray-200 px-6 bg-white"},jbn=["onClick"],Ibn={class:"flex-1 overflow-y-auto px-6 py-4"},Abn={key:0,class:"space-y-4"},Tbn={class:"grid grid-cols-4 gap-3"},Mbn={class:"bg-blue-50 rounded-lg p-4 text-center"},Pbn={class:"text-2xl font-bold text-blue-600"},Dbn={class:"text-xs text-blue-500 mt-1"},Obn={class:"bg-amber-50 rounded-lg p-4 text-center"},Lbn={class:"text-2xl font-bold text-amber-600"},Nbn={class:"text-xs text-amber-500 mt-1"},Rbn={class:"bg-purple-50 rounded-lg p-4 text-center"},Fbn={class:"text-2xl font-bold text-purple-600"},Bbn={class:"text-xs text-purple-500 mt-1"},Hbn={class:"bg-green-50 rounded-lg p-4 text-center"},Gbn={class:"text-2xl font-bold text-green-600"},Jbn={class:"text-xs text-green-500 mt-1"},Ubn={class:"bg-gray-50 rounded-lg p-4"},zbn={class:"flex items-center justify-between mb-2"},qbn={class:"text-sm font-medium text-gray-700"},Vbn={class:"text-sm text-gray-500"},Kbn={class:"w-full bg-gray-200 rounded-full h-2.5"},Wbn={class:"text-sm font-semibold text-gray-700 mb-2"},Xbn={class:"space-y-1.5"},Ybn=["onClick"],Qbn={class:"text-sm text-gray-700 flex-1 truncate"},Zbn={key:0,class:"text-xs text-green-600 bg-green-50 px-1.5 py-0.5 rounded"},epn={class:"text-xs text-gray-400"},tpn={key:1,class:"space-y-3"},npn={key:0,class:"text-sm text-gray-400 text-center py-8"},ipn=["onClick"],rpn={class:"text-sm font-medium text-gray-800 flex-1"},spn={key:0,class:"text-xs text-green-600 bg-green-50 px-1.5 py-0.5 rounded"},opn={class:"text-xs text-gray-400 font-mono"},cpn={key:0,class:"px-4 py-3 space-y-3 border-t border-gray-100"},upn={key:0},lpn={class:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1"},apn={class:"list-decimal list-inside text-sm text-gray-600 space-y-0.5 pl-1"},fpn={key:1},dpn={class:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1"},hpn={class:"list-decimal list-inside text-sm text-gray-600 space-y-0.5 pl-1"},gpn={key:2},bpn={class:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1"},ppn={class:"list-decimal list-inside text-sm text-gray-600 space-y-0.5 pl-1"},wpn={class:"text-xs text-gray-400 pt-1 border-t border-gray-100 font-mono"},vpn={key:2,class:"space-y-4"},mpn={class:"text-sm font-semibold text-gray-700 mb-2"},ypn={class:"text-xs font-normal text-gray-400 ml-1"},kpn={key:0,class:"grid grid-cols-2 gap-1.5"},xpn={class:"flex-shrink-0"},$pn={class:"font-mono text-xs flex-shrink-0"},Epn={class:"truncate"},Cpn={key:1,class:"text-sm text-gray-400 py-2"},Spn={class:"text-sm font-semibold text-gray-700 mb-2"},_pn={class:"text-xs font-normal text-gray-400 ml-1"},jpn={key:0,class:"grid grid-cols-2 gap-1.5"},Ipn={class:"flex-shrink-0"},Apn={class:"truncate"},Tpn={key:1,class:"text-sm text-gray-400 py-2"},Mpn=wr({__name:"ScenarioViewer",props:{url:{}},emits:["close"],setup(a,{emit:d}){const b=a,m=d,{t:w}=Kg(),$=Ye(null),p=Ye(!0),j=Ye(""),I=Ye("overview"),N=Ye(null),P=En(()=>{if(!$.value)return[];const ue=$.value.test_scenarios;return[...ue.main_path_scenarios.map(oe=>({...oe,_class:"main"})),...ue.verify_behavior_scenarios.map(oe=>({...oe,_class:"behavior"})),...ue.verify_rule_scenarios.map(oe=>({...oe,_class:"rule"}))]}),U=En(()=>{if(!$.value)return[];const ue=$.value.test_scenarios;switch(I.value){case"main":return ue.main_path_scenarios;case"behavior":return ue.verify_behavior_scenarios;case"rule":return ue.verify_rule_scenarios;default:return[]}}),V=En(()=>$.value?.result_report?Math.round($.value.result_report.rule_column_covered_ratio*100):0),X=En(()=>{if(!$.value?.coverage_report?.node_info_list)return{covered:0,total:0};const ue=$.value.coverage_report.node_info_list;return{covered:ue.filter(oe=>oe.isCovered).length,total:ue.length}}),ee=En(()=>{if(!$.value?.coverage_report?.rule_column_info_list)return{covered:0,total:0};const ue=$.value.coverage_report.rule_column_info_list;return{covered:ue.filter(oe=>oe.isCovered).length,total:ue.length}});function K(ue){N.value=N.value===ue?null:ue}function he(ue){return{main:"主路径",behavior:"验证行为",rule:"验证规则"}[ue]||ue}function ke(ue){return{main:"bg-blue-100 text-blue-700",behavior:"bg-amber-100 text-amber-700",rule:"bg-purple-100 text-purple-700"}[ue]||"bg-gray-100 text-gray-700"}return gl(async()=>{try{const ue=await fetch(b.url);if(!ue.ok)throw new Error(`HTTP ${ue.status}`);$.value=await ue.json()}catch(ue){j.value=ue.message}finally{p.value=!1}}),(ue,oe)=>(R(),Ts(Lme,{to:"body"},[E("div",{class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60",onClick:oe[1]||(oe[1]=Ah(re=>m("close"),["self"]))},[E("div",vbn,[E("div",mbn,[E("div",null,[E("h2",ybn,M(A(w)("detail.scenarioViewer")),1),$.value?.result_report?.uc_fullname?(R(),J("p",kbn,[ci(M($.value.result_report.uc_fullname)+" ",1),E("span",xbn,"v"+M($.value.result_report.uc_version),1)])):Ae("",!0)]),E("button",{class:"text-gray-400 hover:text-gray-600 text-2xl leading-none",onClick:oe[0]||(oe[0]=re=>m("close"))},"×")]),p.value?(R(),J("div",$bn,[E("span",Ebn,M(A(w)("detail.loading")),1)])):j.value?(R(),J("div",Cbn,[E("span",Sbn,M(j.value),1)])):$.value?(R(),J(sn,{key:2},[E("div",_bn,[(R(!0),J(sn,null,bi([{key:"overview",label:A(w)("detail.scenarioOverview")},{key:"main",label:`${A(w)("detail.scenarioMainPath")} (${$.value.test_scenarios.main_path_scenarios.length})`},{key:"behavior",label:`${A(w)("detail.scenarioVerifyBehavior")} (${$.value.test_scenarios.verify_behavior_scenarios.length})`},{key:"rule",label:`${A(w)("detail.scenarioVerifyRule")} (${$.value.test_scenarios.verify_rule_scenarios.length})`},{key:"coverage",label:A(w)("detail.scenarioCoverage")}],re=>(R(),J("button",{key:re.key,class:wn(["px-4 py-2.5 text-sm font-medium border-b-2 transition-colors -mb-px",I.value===re.key?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"]),onClick:ye=>I.value=re.key},M(re.label),11,jbn))),128))]),E("div",Ibn,[I.value==="overview"?(R(),J("div",Abn,[E("div",Tbn,[E("div",Mbn,[E("div",Pbn,M($.value.test_scenarios.main_path_scenarios.length),1),E("div",Dbn,M(A(w)("detail.scenarioMainPath")),1)]),E("div",Obn,[E("div",Lbn,M($.value.test_scenarios.verify_behavior_scenarios.length),1),E("div",Nbn,M(A(w)("detail.scenarioVerifyBehavior")),1)]),E("div",Rbn,[E("div",Fbn,M($.value.test_scenarios.verify_rule_scenarios.length),1),E("div",Bbn,M(A(w)("detail.scenarioVerifyRule")),1)]),E("div",Hbn,[E("div",Gbn,M(V.value)+"%",1),E("div",Jbn,M(A(w)("detail.scenarioRuleCoverage")),1)])]),E("div",Ubn,[E("div",zbn,[E("span",qbn,M(A(w)("detail.scenarioRuleCoverage")),1),E("span",Vbn,M($.value.result_report.scenario_covered_rule_column_num)+" / "+M($.value.result_report.total_rule_column_num),1)]),E("div",Kbn,[E("div",{class:"bg-green-500 h-2.5 rounded-full transition-all",style:_c({width:V.value+"%"})},null,4)])]),E("div",null,[E("h3",Wbn,M(A(w)("detail.scenarioAllList"))+" ("+M(P.value.length)+")",1),E("div",Xbn,[(R(!0),J(sn,null,bi(P.value,(re,ye)=>(R(),J("div",{key:re.scenario_scene_id||ye,class:"flex items-center gap-2 px-3 py-2 bg-white border border-gray-200 rounded-lg hover:border-gray-300 cursor-pointer",onClick:pe=>{I.value=re._class,N.value=re.scenario_scene_id}},[E("span",{class:wn(["text-xs px-1.5 py-0.5 rounded font-medium",ke(re._class)])},M(he(re._class)),3),E("span",Qbn,M(re.scenario_name),1),re.is_inherit?(R(),J("span",Zbn,M(A(w)("detail.scenarioInherited")),1)):Ae("",!0),E("span",epn,M(re.key_node_num),1)],8,Ybn))),128))])])])):I.value==="main"||I.value==="behavior"||I.value==="rule"?(R(),J("div",tpn,[U.value.length===0?(R(),J("div",npn,M(A(w)("detail.scenarioEmpty")),1)):Ae("",!0),(R(!0),J(sn,null,bi(U.value,(re,ye)=>(R(),J("div",{key:re.scenario_scene_id||ye,class:"border border-gray-200 rounded-lg overflow-hidden"},[E("div",{class:"flex items-center gap-2 px-4 py-3 bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors",onClick:pe=>K(re.scenario_scene_id||String(ye))},[(R(),J("svg",{class:wn(["w-4 h-4 text-gray-400 transition-transform flex-shrink-0",{"rotate-90":N.value===(re.scenario_scene_id||String(ye))}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...oe[2]||(oe[2]=[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),E("span",rpn,M(re.scenario_name),1),re.is_inherit?(R(),J("span",spn,M(A(w)("detail.scenarioInherited")),1)):Ae("",!0),E("span",opn,M(re.key_node_num),1)],8,ipn),N.value===(re.scenario_scene_id||String(ye))?(R(),J("div",cpn,[re.precondition_list?.length?(R(),J("div",upn,[E("h5",lpn,M(A(w)("detail.scenarioPreconditions")),1),E("ol",apn,[(R(!0),J(sn,null,bi(re.precondition_list,(pe,be)=>(R(),J("li",{key:be},M(pe),1))),128))])])):Ae("",!0),re.operating_procedure_list?.length?(R(),J("div",fpn,[E("h5",dpn,M(A(w)("detail.scenarioSteps")),1),E("ol",hpn,[(R(!0),J(sn,null,bi(re.operating_procedure_list,(pe,be)=>(R(),J("li",{key:be},M(pe),1))),128))])])):Ae("",!0),re.predicated_result_list?.length?(R(),J("div",gpn,[E("h5",bpn,M(A(w)("detail.scenarioExpectedResults")),1),E("ol",ppn,[(R(!0),J(sn,null,bi(re.predicated_result_list,(pe,be)=>(R(),J("li",{key:be},M(pe),1))),128))])])):Ae("",!0),E("div",wpn," ID: "+M(re.scenario_scene_id),1)])):Ae("",!0)]))),128))])):I.value==="coverage"?(R(),J("div",vpn,[E("div",null,[E("h3",mpn,[ci(M(A(w)("detail.scenarioNodeCoverage"))+" ",1),E("span",ypn,"("+M(X.value.covered)+"/"+M(X.value.total)+")",1)]),$.value.coverage_report?.node_info_list?.length?(R(),J("div",kpn,[(R(!0),J(sn,null,bi($.value.coverage_report.node_info_list,(re,ye)=>(R(),J("div",{key:ye,class:wn(["flex items-center gap-2 px-3 py-1.5 rounded text-sm",re.isCovered?"bg-green-50 text-green-700":"bg-red-50 text-red-600"])},[E("span",xpn,M(re.isCovered?"✓":"✗"),1),E("span",$pn,M(re.nodeNum),1),E("span",Epn,M(re.nodeDesc),1)],2))),128))])):(R(),J("div",Cpn,M(A(w)("detail.scenarioEmpty")),1))]),E("div",null,[E("h3",Spn,[ci(M(A(w)("detail.scenarioRuleColumnCoverage"))+" ",1),E("span",_pn,"("+M(ee.value.covered)+"/"+M(ee.value.total)+")",1)]),$.value.coverage_report?.rule_column_info_list?.length?(R(),J("div",jpn,[(R(!0),J(sn,null,bi($.value.coverage_report.rule_column_info_list,(re,ye)=>(R(),J("div",{key:ye,class:wn(["flex items-center gap-2 px-3 py-1.5 rounded text-sm",re.isCovered?"bg-green-50 text-green-700":"bg-red-50 text-red-600"])},[E("span",Ipn,M(re.isCovered?"✓":"✗"),1),E("span",Apn,M(re.ruleColumnName),1)],2))),128))])):(R(),J("div",Tpn,M(A(w)("detail.scenarioEmpty")),1))])])):Ae("",!0)])],64)):Ae("",!0)])])]))}}),Ppn={class:"text-base font-semibold text-gray-700 mb-3 flex items-center gap-2"},Dpn={key:0,class:"text-xs font-normal text-gray-400"},Opn={key:0,class:"text-sm text-gray-400 py-4 text-center"},Lpn={key:1,class:"bg-gray-50 border border-gray-200 rounded-lg px-4 py-6 text-center"},Npn={class:"text-sm text-gray-500"},Rpn={class:"text-xs text-gray-400 mt-1"},Fpn={key:2,class:"bg-gray-50 border border-gray-200 rounded-lg px-4 py-6 text-center"},Bpn={class:"text-sm text-gray-500"},Hpn={class:"text-xs text-gray-400 mt-1"},Gpn={key:0,class:"mb-4"},Jpn={class:"text-sm font-medium text-gray-600 mb-2"},Upn={class:"text-xs font-normal text-gray-400 ml-1"},zpn={class:"space-y-1"},qpn=["onClick"],Vpn={class:"text-base flex-shrink-0"},Kpn={class:"text-sm text-gray-700 truncate flex-1 group-hover:text-blue-600"},Wpn={key:0,class:"text-xs text-indigo-600 bg-indigo-100 px-1.5 py-0.5 rounded flex-shrink-0"},Xpn={class:"text-xs text-gray-400 flex-shrink-0"},Ypn={key:0,class:"mt-3 border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},Qpn={class:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200"},Zpn={class:"flex items-center gap-2 min-w-0"},ewn={class:"text-base flex-shrink-0"},twn={class:"text-sm font-medium text-gray-700 truncate"},nwn={class:"text-xs text-gray-400 flex-shrink-0"},iwn={class:"flex items-center gap-1 flex-shrink-0"},rwn=["href"],swn={key:0,class:"px-4 py-8 text-center text-sm text-gray-400"},own={key:1,class:"relative"},cwn={class:"px-4 py-3 text-sm leading-relaxed overflow-auto max-h-[60vh] bg-gray-50 m-0"},uwn={key:1,class:"mb-4"},lwn={class:"text-sm font-medium text-gray-600 mb-2"},awn={class:"text-xs font-normal text-gray-400 ml-1"},fwn={class:"space-y-1"},dwn=["onClick"],hwn={class:"text-base flex-shrink-0"},gwn={class:"text-sm text-gray-700 truncate flex-1 group-hover:text-blue-600"},bwn={class:"text-xs text-gray-400 flex-shrink-0"},pwn={key:0,class:"mt-3 border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},wwn={class:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200"},vwn={class:"flex items-center gap-2 min-w-0"},mwn={class:"text-base flex-shrink-0"},ywn={class:"text-sm font-medium text-gray-700 truncate"},kwn={class:"text-xs text-gray-400 flex-shrink-0"},xwn={class:"flex items-center gap-1 flex-shrink-0"},$wn=["href"],Ewn={key:0,class:"px-4 py-8 text-center text-sm text-gray-400"},Cwn={key:1,class:"relative"},Swn={class:"px-4 py-3 text-sm leading-relaxed overflow-auto max-h-[60vh] bg-gray-50 m-0"},_wn={class:"mb-3"},jwn=["value"],Iwn={key:0,class:"text-sm text-gray-400 py-4 text-center"},Awn={key:1,class:"mb-4"},Twn={class:"text-sm font-medium text-gray-600 mb-2"},Mwn={class:"grid grid-cols-3 gap-2"},Pwn=["onClick"],Dwn=["src","alt"],Own={class:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-end"},Lwn={class:"w-full px-2 py-1.5 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},Nwn={class:"text-xs text-white truncate"},Rwn={class:"text-[10px] text-white/70"},Fwn={key:2,class:"mb-4"},Bwn={class:"text-sm font-medium text-gray-600 mb-2"},Hwn={class:"space-y-3"},Gwn=["src"],Jwn={class:"px-3 py-2 bg-gray-50 flex items-center justify-between text-xs text-gray-500"},Uwn={key:3,class:"mb-4"},zwn={class:"text-sm font-medium text-gray-600 mb-2"},qwn={class:"space-y-1"},Vwn=["onClick"],Kwn={class:"text-base flex-shrink-0"},Wwn={class:"text-sm text-gray-700 truncate flex-1 group-hover:text-blue-600"},Xwn={class:"text-xs text-gray-400 flex-shrink-0"},Ywn={key:0,class:"mt-3 border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},Qwn={class:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200"},Zwn={class:"flex items-center gap-2 min-w-0"},evn={class:"text-base flex-shrink-0"},tvn={class:"text-sm font-medium text-gray-700 truncate"},nvn={class:"text-xs text-gray-400 flex-shrink-0"},ivn={class:"flex items-center gap-1 flex-shrink-0"},rvn=["href"],svn={key:0,class:"px-4 py-8 text-center text-sm text-gray-400"},ovn={key:1,class:"relative"},cvn={class:"px-4 py-3 text-sm leading-relaxed overflow-auto max-h-[60vh] bg-gray-50 m-0"},uvn={key:4,class:"text-sm text-gray-400 text-center py-4"},lvn=["src"],avn=["src"],o2t=wr({__name:"E2eArtifactsViewer",props:{issueIid:{}},setup(a){const d=a,{t:b}=Kg(),m=Ye(!1),w=Ye([]),$=Ye([]),p=Ye(null),j=Ye([]),I=Ye(!1),N=Ye(!1),P=Ye(null),U=Ye("image"),V=En(()=>j.value.filter(xe=>xe.type==="image")),X=En(()=>j.value.filter(xe=>xe.type==="video")),ee=En(()=>j.value.filter(xe=>xe.type==="document")),K={".md":"📝",".py":"🐍",".json":"📋",".jsonl":"📋",".log":"📄",".html":"🌐",".har":"🔍",".txt":"📄"};function he(xe){const Pe=xe.slice(xe.lastIndexOf(".")).toLowerCase();return K[Pe]||"📄"}const ke=Ye(null),ue=Ye(null);function oe(xe){return xe.name.endsWith(".py")}const re=En(()=>$.value.filter(xe=>!oe(xe))),ye=En(()=>$.value.filter(xe=>oe(xe)));function pe(xe){const Pe=xe.slice(xe.lastIndexOf(".")).toLowerCase();return{".py":"python",".js":"javascript",".ts":"typescript",".json":"json",".jsonl":"json",".md":"markdown",".html":"html",".log":"log",".txt":"plaintext",".har":"json",".yaml":"yaml",".yml":"yaml"}[Pe]||"plaintext"}function be(xe){const Pe=Hgt(xe.relativePath,d.issueIid);xe.name==="result.json"?ke.value=Pe:le(xe,Pe)}function se(xe){const Pe=Hgt(xe.relativePath,d.issueIid);le(xe,Pe)}async function le(xe,Pe){ue.value={file:xe,url:Pe,content:"",loading:!0};try{const Je=await fetch(Pe);if(!Je.ok)throw new Error(`HTTP ${Je.status}`);ue.value={file:xe,url:Pe,content:await Je.text(),loading:!1}}catch(Je){ue.value={file:xe,url:Pe,content:`Failed to load: ${Je.message}`,loading:!1}}}function Ce(xe){const Pe=_W(p.value,xe.relativePath,d.issueIid);le(xe,Pe)}function Se(){ue.value=null}const te=En(()=>w.value.length>0||$.value.length>0);async function q(){I.value=!0;try{const xe=await oWt(d.issueIid);m.value=xe.configured,w.value=xe.runs,$.value=xe.scenarios??[],xe.runs.length>0&&!p.value&&(p.value=xe.runs[0].runId)}catch(xe){console.error("Failed to load E2E runs",xe)}finally{I.value=!1}}async function He(xe){N.value=!0,j.value=[];try{const Pe=await cWt(xe,d.issueIid);j.value=Pe.files}catch(Pe){console.error("Failed to load E2E run files",Pe)}finally{N.value=!1}}Jr(p,xe=>{xe&&He(xe)}),Jr(()=>d.issueIid,()=>{p.value=null,j.value=[],$.value=[],ue.value=null,q()});function gt(xe){P.value=_W(p.value,xe.relativePath,d.issueIid),U.value=xe.type}function ze(){P.value=null}function jt(xe){return xe<1024?`${xe} B`:xe<1024*1024?`${(xe/1024).toFixed(1)} KB`:`${(xe/(1024*1024)).toFixed(1)} MB`}function Jt(xe){const Pe=xe.match(/^(\d{4})(\d{2})(\d{2})-(\d{2})(\d{2})(\d{2})/);return Pe?`${Pe[1]}-${Pe[2]}-${Pe[3]} ${Pe[4]}:${Pe[5]}:${Pe[6]}`:xe}return gl(q),(xe,Pe)=>(R(),J("div",null,[E("h3",Ppn,[ci(M(A(b)("detail.e2eArtifacts"))+" ",1),w.value.length>0?(R(),J("span",Dpn,"("+M(w.value.length)+" "+M(A(b)("detail.e2eRuns"))+")",1)):Ae("",!0)]),I.value?(R(),J("div",Opn,M(A(b)("detail.loading")),1)):m.value?te.value?(R(),J(sn,{key:3},[re.value.length>0?(R(),J("div",Gpn,[E("h4",Jpn,[ci(M(A(b)("detail.e2eScenariosLabel"))+" ",1),E("span",Upn,"("+M(re.value.length)+")",1)]),E("div",zpn,[(R(!0),J(sn,null,bi(re.value,Je=>(R(),J("div",{key:"sc-"+Je.relativePath,class:wn(["flex items-center gap-2 px-3 py-2 border rounded-lg cursor-pointer transition-colors group",Je.name==="result.json"?"border-indigo-200 bg-indigo-50/50 hover:border-indigo-400 hover:bg-indigo-50":ue.value?.file===Je?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50 hover:border-blue-300 hover:bg-blue-50"]),onClick:Bt=>be(Je)},[E("span",Vpn,M(he(Je.name)),1),E("span",Kpn,M(Je.name),1),Je.name==="result.json"?(R(),J("span",Wpn,M(A(b)("detail.scenarioViewer")),1)):Ae("",!0),E("span",Xpn,M(jt(Je.size)),1)],10,qpn))),128))]),ue.value&&re.value.some(Je=>Je===ue.value.file)?(R(),J("div",Ypn,[E("div",Qpn,[E("div",Zpn,[E("span",ewn,M(he(ue.value.file.name)),1),E("span",twn,M(ue.value.file.name),1),E("span",nwn,M(jt(ue.value.file.size)),1)]),E("div",iwn,[E("a",{href:ue.value.url,target:"_blank",class:"p-1 text-gray-400 hover:text-blue-500 rounded",title:"Open in new tab"},[...Pe[4]||(Pe[4]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,rwn),E("button",{class:"p-1 text-gray-400 hover:text-gray-600 rounded",onClick:Se},[...Pe[5]||(Pe[5]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),ue.value.loading?(R(),J("div",swn,M(A(b)("detail.loading")),1)):(R(),J("div",own,[E("pre",cwn,[E("code",{class:wn("language-"+pe(ue.value.file.name))},M(ue.value.content),3)])]))])):Ae("",!0)])):Ae("",!0),ye.value.length>0?(R(),J("div",uwn,[E("h4",lwn,[ci(M(A(b)("detail.e2eScriptsLabel"))+" ",1),E("span",awn,"("+M(ye.value.length)+")",1)]),E("div",fwn,[(R(!0),J(sn,null,bi(ye.value,Je=>(R(),J("div",{key:"ss-"+Je.relativePath,class:wn(["flex items-center gap-2 px-3 py-2 border rounded-lg cursor-pointer transition-colors group",ue.value?.file===Je?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50 hover:border-blue-300 hover:bg-blue-50"]),onClick:Bt=>se(Je)},[E("span",hwn,M(he(Je.name)),1),E("span",gwn,M(Je.name),1),E("span",bwn,M(jt(Je.size)),1)],10,dwn))),128))]),ue.value&&ye.value.some(Je=>Je===ue.value.file)?(R(),J("div",pwn,[E("div",wwn,[E("div",vwn,[E("span",mwn,M(he(ue.value.file.name)),1),E("span",ywn,M(ue.value.file.name),1),E("span",kwn,M(jt(ue.value.file.size)),1)]),E("div",xwn,[E("a",{href:ue.value.url,target:"_blank",class:"p-1 text-gray-400 hover:text-blue-500 rounded",title:"Open in new tab"},[...Pe[6]||(Pe[6]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,$wn),E("button",{class:"p-1 text-gray-400 hover:text-gray-600 rounded",onClick:Se},[...Pe[7]||(Pe[7]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),ue.value.loading?(R(),J("div",Ewn,M(A(b)("detail.loading")),1)):(R(),J("div",Cwn,[E("pre",Swn,[E("code",{class:wn("language-"+pe(ue.value.file.name))},M(ue.value.content),3)])]))])):Ae("",!0)])):Ae("",!0),w.value.length>0?(R(),J(sn,{key:2},[E("div",_wn,[Nn(E("select",{"onUpdate:modelValue":Pe[0]||(Pe[0]=Je=>p.value=Je),class:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500"},[(R(!0),J(sn,null,bi(w.value,Je=>(R(),J("option",{key:Je.runId,value:Je.runId},[ci(M(Jt(Je.runId))+" — "+M(Je.imageCount)+" "+M(A(b)("detail.e2eImages"))+", "+M(Je.videoCount)+" "+M(A(b)("detail.e2eVideos")),1),Je.documentCount?(R(),J(sn,{key:0},[ci(", "+M(Je.documentCount)+" "+M(A(b)("detail.e2eDocuments")),1)],64)):Ae("",!0)],8,jwn))),128))],512),[[Rd,p.value]])]),N.value?(R(),J("div",Iwn,M(A(b)("detail.loading")),1)):Ae("",!0),!N.value&&V.value.length>0?(R(),J("div",Awn,[E("h4",Twn,M(A(b)("detail.e2eScreenshots")),1),E("div",Mwn,[(R(!0),J(sn,null,bi(V.value,Je=>(R(),J("div",{key:Je.relativePath,class:"relative group cursor-pointer rounded-lg overflow-hidden border border-gray-200 hover:border-blue-400 hover:shadow-md transition-all",onClick:Bt=>gt(Je)},[E("img",{src:_W(p.value,Je.relativePath,d.issueIid),alt:Je.name,class:"w-full h-32 object-cover bg-gray-100",loading:"lazy"},null,8,Dwn),E("div",Own,[E("div",Lwn,[E("p",Nwn,M(Je.name),1),E("p",Rwn,M(jt(Je.size)),1)])])],8,Pwn))),128))])])):Ae("",!0),!N.value&&X.value.length>0?(R(),J("div",Fwn,[E("h4",Bwn,M(A(b)("detail.e2eVideoRecordings")),1),E("div",Hwn,[(R(!0),J(sn,null,bi(X.value,Je=>(R(),J("div",{key:Je.relativePath,class:"border border-gray-200 rounded-lg overflow-hidden"},[E("video",{src:_W(p.value,Je.relativePath,d.issueIid),controls:"",preload:"metadata",class:"w-full max-h-80 bg-black"},null,8,Gwn),E("div",Jwn,[E("span",null,M(Je.name),1),E("span",null,M(jt(Je.size)),1)])]))),128))])])):Ae("",!0),!N.value&&ee.value.length>0?(R(),J("div",Uwn,[E("h4",zwn,M(A(b)("detail.e2eRunDocuments")),1),E("div",qwn,[(R(!0),J(sn,null,bi(ee.value,Je=>(R(),J("div",{key:Je.relativePath,class:wn(["flex items-center gap-2 px-3 py-2 border rounded-lg cursor-pointer transition-colors group",ue.value?.file.relativePath===Je.relativePath&&!ue.value?.url.includes("e2e-scenarios")?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50 hover:border-blue-300 hover:bg-blue-50"]),onClick:Bt=>Ce(Je)},[E("span",Kwn,M(he(Je.name)),1),E("span",Wwn,M(Je.relativePath),1),E("span",Xwn,M(jt(Je.size)),1),Pe[8]||(Pe[8]=E("svg",{class:"w-4 h-4 text-gray-300 group-hover:text-blue-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1))],10,Vwn))),128))]),ue.value&&!ue.value.url.includes("e2e-scenarios")?(R(),J("div",Ywn,[E("div",Qwn,[E("div",Zwn,[E("span",evn,M(he(ue.value.file.name)),1),E("span",tvn,M(ue.value.file.relativePath),1),E("span",nvn,M(jt(ue.value.file.size)),1)]),E("div",ivn,[E("a",{href:ue.value.url,target:"_blank",class:"p-1 text-gray-400 hover:text-blue-500 rounded",title:"Open in new tab"},[...Pe[9]||(Pe[9]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,rvn),E("button",{class:"p-1 text-gray-400 hover:text-gray-600 rounded",onClick:Se},[...Pe[10]||(Pe[10]=[E("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),ue.value.loading?(R(),J("div",svn,M(A(b)("detail.loading")),1)):(R(),J("div",ovn,[E("pre",cvn,[E("code",{class:wn("language-"+pe(ue.value.file.name))},M(ue.value.content),3)])]))])):Ae("",!0)])):Ae("",!0),!N.value&&V.value.length===0&&X.value.length===0&&ee.value.length===0&&p.value?(R(),J("div",uvn,M(A(b)("detail.e2eNoMedia")),1)):Ae("",!0)],64)):Ae("",!0)],64)):(R(),J("div",Fpn,[Pe[3]||(Pe[3]=E("svg",{class:"mx-auto h-10 w-10 text-gray-300 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),E("p",Bpn,M(A(b)("detail.e2eNoRuns")),1),E("p",Hpn,M(A(b)("detail.e2eNoRunsHint")),1)])):(R(),J("div",Lpn,[Pe[2]||(Pe[2]=E("svg",{class:"mx-auto h-10 w-10 text-gray-300 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)),E("p",Npn,M(A(b)("detail.e2eNotConfigured")),1),E("p",Rpn,M(A(b)("detail.e2eNotConfiguredHint")),1)])),(R(),Ts(Lme,{to:"body"},[P.value?(R(),J("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80",onClick:Ah(ze,["self"])},[E("button",{class:"absolute top-4 right-4 text-white/80 hover:text-white text-3xl leading-none z-10",onClick:ze},"×"),U.value==="image"?(R(),J("img",{key:0,src:P.value,class:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg shadow-2xl"},null,8,lvn)):(R(),J("video",{key:1,src:P.value,controls:"",autoplay:"",class:"max-w-[90vw] max-h-[90vh] rounded-lg shadow-2xl"},null,8,avn))])):Ae("",!0)])),ke.value?(R(),Ts(Mpn,{key:4,url:ke.value,onClose:Pe[1]||(Pe[1]=Je=>ke.value=null)},null,8,["url"])):Ae("",!0)]))}}),fvn={class:"fixed inset-0 z-50 flex"},dvn={class:"relative ml-auto w-full max-w-2xl bg-white shadow-xl overflow-y-auto"},hvn={class:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between z-10"},gvn={class:"flex items-center space-x-2"},bvn={class:"text-lg font-bold text-gray-800"},pvn=["href"],wvn={class:"px-6 py-4 space-y-6"},vvn={class:"text-base font-semibold text-gray-700 mb-2"},mvn={class:"grid grid-cols-2 gap-3 text-sm"},yvn={class:"text-gray-500"},kvn={class:"text-gray-800"},xvn={class:"text-gray-500"},$vn={class:"text-xs bg-gray-100 px-1 py-0.5 rounded"},Evn={class:"text-gray-500"},Cvn={class:"text-gray-500"},Svn={class:"text-gray-500"},_vn={class:"text-gray-500"},jvn={class:"flex items-center justify-between text-sm bg-gray-50 rounded-lg px-4 py-2.5 border border-gray-200"},Ivn={class:"text-gray-600"},Avn=["disabled"],Tvn={class:"flex items-center justify-between text-sm bg-gray-50 rounded-lg px-4 py-2.5 border border-gray-200"},Mvn={class:"text-gray-600"},Pvn=["disabled"],Dvn={key:0,class:"bg-green-50 border border-green-200 rounded-lg p-4 flex items-center space-x-2"},Ovn={class:"text-sm text-green-700 font-medium"},Lvn=["href"],Nvn={key:1,class:"bg-green-50 border border-green-200 rounded-lg p-4 space-y-2"},Rvn={class:"text-sm text-green-700 font-medium"},Fvn={class:"text-xs text-green-600 font-mono"},Bvn=["href"],Hvn={key:2,class:"bg-red-50 border border-red-200 rounded-lg p-4"},Gvn={class:"text-sm font-semibold text-red-700 mb-1"},Jvn={class:"text-sm text-red-600 whitespace-pre-wrap break-words"},Uvn={class:"flex flex-wrap gap-3 pt-2 border-t border-gray-200"},zvn=wr({__name:"DetailModal",props:{issue:{},progress:{},systemStatus:{},verifyFixLoop:{},agentLogs:{},agentAutoScroll:{type:Boolean},agentDebugMode:{type:Boolean},supplement:{},supplementForm:{},supplementLoading:{type:Boolean},supplementEditing:{type:Boolean},supplementSaving:{type:Boolean},hasSupplementData:{type:Boolean},detailVersion:{},reviewFeedback:{},reviewSubmitting:{type:Boolean},reviewHistory:{}},emits:["close","start","retry","restart","cancel","markDeployed","stopPreview","restartPreview","retryFromPhase","approve","reject","skip","update:reviewFeedback","supplementEdit","supplementSave","supplementCancel","update:supplementForm","update:agentAutoScroll","update:agentDebugMode","clearLogs"],setup(a,{emit:d}){const b=a,m=d,{stateLabel:w,stateClass:$,getPlanDocs:p,isEditableDoc:j}=r_();function I(){if(!b.systemStatus)return"#";const ue=b.systemStatus.config.gongfengBaseUrl,oe=b.systemStatus.config.projectPath;return`${ue}/${oe}/issues/${_r(b.issue)}`}const N=Ye(b.issue.issueNoteSyncEnabled),P=Ye(!1),U=En(()=>N.value===!0?"on":N.value===!1?"off":"system");async function V(){const ue=[void 0,!0,!1],oe=ue.indexOf(N.value),re=ue[(oe+1)%ue.length];N.value=re,P.value=!0;try{await xwt(_r(b.issue),re===void 0?null:re)}catch(ye){console.error("Failed to toggle note sync",ye)}finally{P.value=!1}}const X=Ye(b.issue.e2eEnabled),ee=Ye(!1),K=En(()=>X.value===!0?"on":X.value===!1?"off":"system");async function he(){const ue=[void 0,!0,!1],oe=ue.indexOf(X.value),re=ue[(oe+1)%ue.length];X.value=re,ee.value=!0;try{await $wt(_r(b.issue),re===void 0?null:re)}catch(ye){console.error("Failed to toggle e2e",ye)}finally{ee.value=!1}}function ke(){window.open(`/detail?issue=${_r(b.issue)}`,"_blank")}return(ue,oe)=>(R(),J("div",fvn,[E("div",{class:"absolute inset-0 bg-black/30",onClick:oe[0]||(oe[0]=re=>m("close"))}),E("div",dvn,[E("div",hvn,[E("div",gvn,[E("h2",bvn,"Issue #"+M(A(_r)(a.issue)),1),E("a",{href:I(),target:"_blank",rel:"noopener",class:"inline-flex items-center px-2 py-0.5 text-xs font-medium text-blue-600 bg-blue-50 rounded hover:bg-blue-100 hover:text-blue-800 transition-colors"},[ci(M(ue.$t("detail.viewInGongfeng"))+" ",1),oe[24]||(oe[24]=E("svg",{class:"w-3 h-3 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1))],8,pvn),E("button",{class:"inline-flex items-center px-2 py-0.5 text-xs font-medium text-gray-600 bg-gray-100 rounded hover:bg-gray-200 hover:text-gray-800 transition-colors",onClick:oe[1]||(oe[1]=re=>ke())},[ci(M(ue.$t("detail.openFullPage"))+" ",1),oe[25]||(oe[25]=E("svg",{class:"w-3 h-3 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m7-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m7 5v-4m0 4h-4m4 0l-5-5"})],-1))])]),E("button",{class:"text-gray-400 hover:text-gray-600 text-2xl leading-none",onClick:oe[2]||(oe[2]=re=>m("close"))},"×")]),E("div",wvn,[E("div",null,[E("h3",vvn,M(ue.$t("detail.basicInfo")),1),E("div",mvn,[E("div",null,[E("span",yvn,M(ue.$t("detail.title")),1),oe[26]||(oe[26]=ci()),E("span",kvn,M(A(ywt)(a.issue)),1)]),E("div",null,[E("span",xvn,M(ue.$t("detail.branch")),1),oe[27]||(oe[27]=ci()),E("code",$vn,M(a.issue.branchName),1)]),E("div",null,[E("span",Evn,M(ue.$t("detail.state")),1),E("span",{class:wn(["px-2 py-0.5 rounded-full text-xs font-medium",A($)(a.issue.state)])},M(A(w)(a.issue.state,a.issue.currentPhase)),3)]),E("div",null,[E("span",Cvn,M(ue.$t("detail.createdAt")),1),ci(" "+M(A(YS)(a.issue.createdAt)),1)]),E("div",null,[E("span",Svn,M(ue.$t("detail.retries")),1),ci(" "+M(a.issue.attempts),1)]),E("div",null,[E("span",_vn,M(ue.$t("detail.updatedAt")),1),ci(" "+M(A(YS)(a.issue.updatedAt)),1)])])]),E("div",jvn,[E("span",Ivn,M(ue.$t("detail.noteSync")),1),E("button",{class:wn(["px-3 py-1 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":U.value==="on","bg-red-100 text-red-600 hover:bg-red-200":U.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":U.value==="system"}]),disabled:P.value,onClick:oe[3]||(oe[3]=re=>V())},M(U.value==="on"?ue.$t("detail.enabled"):U.value==="off"?ue.$t("detail.disabled"):ue.$t("detail.followSystem")),11,Avn)]),E("div",Tvn,[E("span",Mvn,M(ue.$t("detail.e2eTitle")),1),E("button",{class:wn(["px-3 py-1 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":K.value==="on","bg-red-100 text-red-600 hover:bg-red-200":K.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":K.value==="system"}]),disabled:ee.value,onClick:oe[4]||(oe[4]=re=>he())},M(K.value==="on"?ue.$t("detail.enabled"):K.value==="off"?ue.$t("detail.disabled"):ue.$t("detail.followSystem")),11,Pvn)]),a.issue.mrUrl?(R(),J("div",Dvn,[E("span",Ovn,M(ue.$t("detail.mrLabel")),1),E("a",{href:a.issue.mrUrl,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(a.issue.mrUrl),9,Lvn)])):Ae("",!0),a.issue.linkedMrUrls&&Object.keys(a.issue.linkedMrUrls).length>0?(R(),J("div",Nvn,[E("span",Rvn,M(ue.$t("detail.linkedMrLabel")),1),(R(!0),J(sn,null,bi(a.issue.linkedMrUrls,(re,ye)=>(R(),J("div",{key:ye,class:"flex items-center space-x-2 ml-2"},[E("span",Fvn,M(ye)+":",1),E("a",{href:re,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(re),9,Bvn)]))),128))])):Ae("",!0),a.issue.lastError?(R(),J("div",Hvn,[E("h3",Gvn,M(ue.$t("detail.errorInfo")),1),E("p",Jvn,M(a.issue.lastError),1)])):Ae("",!0),xr(t2t,{issue:a.issue,progress:a.progress,"verify-fix-loop":a.verifyFixLoop,onRetryFromPhase:oe[5]||(oe[5]=re=>m("retryFromPhase",A(_r)(a.issue),re))},null,8,["issue","progress","verify-fix-loop"]),a.issue.state==="phase_waiting"?(R(),Ts(n2t,{key:3,"review-submitting":a.reviewSubmitting,"review-feedback":a.reviewFeedback,"review-history":a.reviewHistory,"onUpdate:reviewFeedback":oe[6]||(oe[6]=re=>m("update:reviewFeedback",re)),onApprove:oe[7]||(oe[7]=re=>m("approve",A(_r)(a.issue))),onReject:oe[8]||(oe[8]=re=>m("reject",A(_r)(a.issue))),onSkip:oe[9]||(oe[9]=re=>m("skip",A(_r)(a.issue)))},null,8,["review-submitting","review-feedback","review-history"])):Ae("",!0),xr(i2t,{supplement:a.supplement,"supplement-form":a.supplementForm,loading:a.supplementLoading,editing:a.supplementEditing,saving:a.supplementSaving,"has-data":a.hasSupplementData,onEdit:oe[10]||(oe[10]=re=>m("supplementEdit")),onSave:oe[11]||(oe[11]=re=>m("supplementSave")),onCancel:oe[12]||(oe[12]=re=>m("supplementCancel")),"onUpdate:supplementForm":oe[13]||(oe[13]=re=>m("update:supplementForm",re))},null,8,["supplement","supplement-form","loading","editing","saving","has-data"]),xr(s2t,{"issue-iid":A(_r)(a.issue),"plan-docs":A(p)(a.issue),"is-editable-doc":A(j),"detail-version":a.detailVersion},null,8,["issue-iid","plan-docs","is-editable-doc","detail-version"]),xr(o2t,{"issue-iid":A(_r)(a.issue)},null,8,["issue-iid"]),xr(r2t,{logs:a.agentLogs,"issue-state":a.issue.state,"current-phase":a.issue.currentPhase,"auto-scroll":a.agentAutoScroll,"debug-mode":a.agentDebugMode,"onUpdate:autoScroll":oe[14]||(oe[14]=re=>m("update:agentAutoScroll",re)),"onUpdate:debugMode":oe[15]||(oe[15]=re=>m("update:agentDebugMode",re)),onClear:oe[16]||(oe[16]=re=>m("clearLogs"))},null,8,["logs","issue-state","current-phase","auto-scroll","debug-mode"]),E("div",Uvn,[a.issue.state==="skipped"?(R(),J("button",{key:0,class:"px-4 py-2 bg-green-500 text-white text-sm rounded-lg hover:bg-green-600",onClick:oe[17]||(oe[17]=re=>m("start",A(_r)(a.issue)))},M(ue.$t("detail.start")),1)):Ae("",!0),a.issue.state==="failed"?(R(),J("button",{key:1,class:"px-4 py-2 bg-blue-500 text-white text-sm rounded-lg hover:bg-blue-600",onClick:oe[18]||(oe[18]=re=>m("retry",A(_r)(a.issue)))},M(ue.$t("detail.retry")),1)):Ae("",!0),a.issue.state==="completed"?(R(),J("button",{key:2,class:"px-4 py-2 bg-purple-500 text-white text-sm rounded-lg hover:bg-purple-600",onClick:oe[19]||(oe[19]=re=>m("markDeployed",A(_r)(a.issue)))},M(ue.$t("detail.markDeployed")),1)):Ae("",!0),a.issue.preview?.running?(R(),J("button",{key:3,class:"px-4 py-2 bg-orange-100 text-orange-700 text-sm rounded-lg hover:bg-orange-200",onClick:oe[20]||(oe[20]=re=>m("stopPreview",A(_r)(a.issue)))},M(ue.$t("detail.stopPreview")),1)):Ae("",!0),!["pending","skipped","deployed"].includes(a.issue.state)&&!a.issue.preview?.running?(R(),J("button",{key:4,class:"px-4 py-2 bg-indigo-100 text-indigo-700 text-sm rounded-lg hover:bg-indigo-200",onClick:oe[21]||(oe[21]=re=>m("restartPreview",A(_r)(a.issue)))},M(ue.$t("detail.restartPreview")),1)):Ae("",!0),a.issue.state!=="skipped"?(R(),J("button",{key:5,class:"px-4 py-2 bg-yellow-100 text-yellow-700 text-sm rounded-lg hover:bg-yellow-200",onClick:oe[22]||(oe[22]=re=>m("restart",A(_r)(a.issue)))},M(ue.$t("detail.restart")),1)):Ae("",!0),E("button",{class:"px-4 py-2 bg-red-100 text-red-600 text-sm rounded-lg hover:bg-red-200",onClick:oe[23]||(oe[23]=re=>m("cancel",A(_r)(a.issue)))},M(ue.$t("detail.cancelTrack")),1)])])])]))}}),qvn={key:0,class:"min-h-screen bg-gray-50 flex flex-col"},Vvn={class:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between sticky top-0 z-10"},Kvn={class:"flex items-center gap-3 min-w-0"},Wvn={href:"/",class:"text-sm text-blue-600 hover:text-blue-800 flex-shrink-0"},Xvn={class:"text-lg font-bold text-gray-800 truncate"},Yvn={class:"text-gray-500 truncate hidden sm:inline"},Qvn={class:"flex items-center gap-3 flex-shrink-0"},Zvn={key:0,class:"w-2 h-2 rounded-full bg-green-500",title:"SSE connected"},e2n={key:1,class:"w-2 h-2 rounded-full bg-red-400",title:"SSE disconnected"},t2n=["href"],n2n={class:"flex flex-1 overflow-hidden"},i2n={class:"w-80 flex-shrink-0 border-r border-gray-200 bg-white overflow-y-auto"},r2n={class:"p-4 border-b border-gray-100"},s2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},o2n={class:"p-4 border-b border-gray-100"},c2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},u2n={class:"space-y-2 text-sm"},l2n={class:"flex justify-between"},a2n={class:"text-gray-400"},f2n={class:"text-xs bg-gray-100 px-1.5 py-0.5 rounded truncate max-w-[180px]"},d2n={class:"flex justify-between"},h2n={class:"text-gray-400"},g2n={class:"flex justify-between"},b2n={class:"text-gray-400"},p2n={class:"flex justify-between"},w2n={class:"text-gray-400"},v2n={class:"p-4 border-b border-gray-100"},m2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},y2n={class:"space-y-2"},k2n={class:"flex items-center justify-between text-sm"},x2n={class:"text-gray-600"},$2n=["disabled"],E2n={class:"flex items-center justify-between text-sm"},C2n={class:"text-gray-600"},S2n=["disabled"],_2n={key:0,class:"p-4 border-b border-gray-100"},j2n={class:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-3"},I2n=["href"],A2n={key:1,class:"space-y-1 mt-1"},T2n={class:"text-xs text-gray-500 font-mono flex-shrink-0"},M2n=["href"],P2n={key:1,class:"p-4 border-b border-gray-100"},D2n={class:"bg-red-50 border border-red-200 rounded-lg p-3"},O2n={class:"text-xs font-semibold text-red-700 mb-1"},L2n={class:"text-xs text-red-600 whitespace-pre-wrap break-words"},N2n={class:"p-4"},R2n={class:"flex flex-wrap gap-2"},F2n={class:"flex-1 flex flex-col min-w-0"},B2n={class:"flex gap-0 border-b border-gray-200 bg-white px-4"},H2n=["onClick"],G2n={class:"flex-1 overflow-y-auto p-5"},J2n={key:1,class:"min-h-screen bg-gray-50 flex items-center justify-center"},U2n={class:"text-center"},z2n={class:"text-gray-400 text-lg mb-2"},q2n={href:"/",class:"text-sm text-blue-600 hover:text-blue-800"},V2n=wr({__name:"IssueDetailPage",setup(a){const d=Ye(null),b=Ye("docs"),m=Ye(!1),w=Ye(!1),{pipelineMode:$,stateLabel:p,stateClass:j,getPlanDocs:I,isEditableDoc:N}=r_(),P=_wt(),U=JX(),V=En(()=>P.selectedIssue.value?_r(P.selectedIssue.value):void 0),X=En(()=>{const le=V.value;return le!=null?U.getVerifyFixLoop(le):void 0}),ee=En(()=>{if(!P.selectedIssue.value)return"system";const le=P.selectedIssue.value.issueNoteSyncEnabled;return le===!0?"on":le===!1?"off":"system"}),K=En(()=>{if(!P.selectedIssue.value)return"system";const le=P.selectedIssue.value.e2eEnabled;return le===!0?"on":le===!1?"off":"system"});function he(){if(!P.selectedIssue.value||!d.value)return"#";const le=d.value.config.gongfengBaseUrl,Ce=d.value.config.projectPath;return`${le}/${Ce}/issues/${_r(P.selectedIssue.value)}`}function ke(){const Ce=new URLSearchParams(window.location.search).get("issue");if(!Ce)return;const Se=Number(Ce);return Number.isFinite(Se)&&Se>0?Se:void 0}async function ue(le){try{const Ce=await dX(le);P.selectIssue(Ce,U.agentLogs)}catch{console.warn(`Issue #${le} not found`)}}async function oe(){}async function re(){if(!P.selectedIssue.value)return;const le=P.selectedIssue.value.issueNoteSyncEnabled,Ce=le===!0?!1:le===!1?void 0:!0;m.value=!0;try{await xwt(_r(P.selectedIssue.value),Ce===void 0?null:Ce),await P.refreshDetail()}catch(Se){console.error("Failed to toggle note sync",Se)}finally{m.value=!1}}async function ye(){if(!P.selectedIssue.value)return;const le=P.selectedIssue.value.e2eEnabled,Ce=le===!0?!1:le===!1?void 0:!0;w.value=!0;try{await $wt(_r(P.selectedIssue.value),Ce===void 0?null:Ce),await P.refreshDetail()}catch(Se){console.error("Failed to toggle e2e",Se)}finally{w.value=!1}}const{connected:pe}=Swt((le,Ce)=>{const Se=Ce;if(le.startsWith("issue:")||le.startsWith("review:")){const te=Se.data;te?.issueIid&&P.selectedIssue.value&&_r(P.selectedIssue.value)===te.issueIid&&P.refreshDetail()}if(le==="agent:output"){const te=Se.data;te?.event&&U.pushAgentStreamEvent(te.issueIid,V,te.phase,te.event)}if(le==="pipeline:progress"){const te=Se.data;te&&P.selectedIssue.value&&_r(P.selectedIssue.value)===te.issueIid&&U.pushSystemLog(te.issueIid,V,te.step,te.message??"",Se.timestamp)}if(le.startsWith("verify:")){const te=Se.data,q=te?.issueIid;if(q&&(U.updateVerifyFixLoop(q,le,te),P.selectedIssue.value&&_r(P.selectedIssue.value)===q)){let He="";le==="verify:loopStarted"?He=Cs("verify.loopStarted",{max:te.maxIterations}):le==="verify:iterationComplete"?He=te.passed?Cs("verify.iterationPassed",{n:te.iteration}):Cs("verify.iterationFailed",{n:te.iteration,reasons:(te.failures??[]).join("; ")}):le==="verify:loopExhausted"&&(He=Cs("verify.loopExhausted",{n:te.totalIterations})),He&&U.pushSystemLog(q,V,"verify",He,Se.timestamp)}}});async function be(){try{d.value=await kwt(),d.value?.config?.pipelineMode&&($.value=d.value.config.pipelineMode)}catch(le){console.error("Fetch status failed",le)}}let se=null;return gl(async()=>{Cwt(),be(),se=setInterval(be,1e4);const le=ke();le&&await ue(le)}),dp(()=>{se&&clearInterval(se)}),(le,Ce)=>A(P).selectedIssue.value?(R(),J("div",qvn,[E("div",Vvn,[E("div",Kvn,[E("a",Wvn,M(le.$t("detail.backToList")),1),Ce[21]||(Ce[21]=E("span",{class:"text-gray-300"},"|",-1)),E("h1",Xvn,"Issue #"+M(A(_r)(A(P).selectedIssue.value)),1),E("span",Yvn,M(A(ywt)(A(P).selectedIssue.value)),1),E("span",{class:wn(["px-2.5 py-0.5 rounded-full text-xs font-medium flex-shrink-0",A(j)(A(P).selectedIssue.value.state)])},M(A(p)(A(P).selectedIssue.value.state,A(P).selectedIssue.value.currentPhase)),3)]),E("div",Qvn,[A(pe)?(R(),J("span",Zvn)):(R(),J("span",e2n)),E("a",{href:he(),target:"_blank",rel:"noopener",class:"text-sm text-gray-500 hover:text-blue-600"},M(le.$t("detail.viewInGongfeng"))+" ↗",9,t2n)])]),E("div",n2n,[E("aside",i2n,[E("div",r2n,[E("div",s2n,M(le.$t("pipeline.title")),1),xr(t2t,{issue:A(P).selectedIssue.value,progress:A(P).detailProgress.value,"verify-fix-loop":X.value,vertical:"",onRetryFromPhase:Ce[0]||(Ce[0]=Se=>A(P).doRetryFromPhase(A(_r)(A(P).selectedIssue.value),Se,Se,oe))},null,8,["issue","progress","verify-fix-loop"])]),E("div",o2n,[E("div",c2n,M(le.$t("detail.basicInfo")),1),E("div",u2n,[E("div",l2n,[E("span",a2n,M(le.$t("detail.branch")),1),E("code",f2n,M(A(P).selectedIssue.value.branchName),1)]),E("div",d2n,[E("span",h2n,M(le.$t("detail.retries")),1),E("span",null,M(A(P).selectedIssue.value.attempts),1)]),E("div",g2n,[E("span",b2n,M(le.$t("detail.createdAt")),1),E("span",null,M(A(YS)(A(P).selectedIssue.value.createdAt)),1)]),E("div",p2n,[E("span",w2n,M(le.$t("detail.updatedAt")),1),E("span",null,M(A(YS)(A(P).selectedIssue.value.updatedAt)),1)])])]),E("div",v2n,[E("div",m2n,M(le.$t("detail.settings")),1),E("div",y2n,[E("div",k2n,[E("span",x2n,M(le.$t("detail.noteSync")),1),E("button",{class:wn(["px-2.5 py-0.5 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":ee.value==="on","bg-red-100 text-red-600 hover:bg-red-200":ee.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":ee.value==="system"}]),disabled:m.value,onClick:Ce[1]||(Ce[1]=Se=>re())},M(ee.value==="on"?le.$t("detail.enabled"):ee.value==="off"?le.$t("detail.disabled"):le.$t("detail.followSystem")),11,$2n)]),E("div",E2n,[E("span",C2n,M(le.$t("detail.e2eTitle")),1),E("button",{class:wn(["px-2.5 py-0.5 rounded text-xs font-medium transition-colors",{"bg-green-100 text-green-700 hover:bg-green-200":K.value==="on","bg-red-100 text-red-600 hover:bg-red-200":K.value==="off","bg-gray-200 text-gray-600 hover:bg-gray-300":K.value==="system"}]),disabled:w.value,onClick:Ce[2]||(Ce[2]=Se=>ye())},M(K.value==="on"?le.$t("detail.enabled"):K.value==="off"?le.$t("detail.disabled"):le.$t("detail.followSystem")),11,S2n)])])]),A(P).selectedIssue.value.mrUrl||A(P).selectedIssue.value.linkedMrUrls&&Object.keys(A(P).selectedIssue.value.linkedMrUrls).length>0?(R(),J("div",_2n,[E("div",j2n,M(le.$t("detail.mergeRequest")),1),A(P).selectedIssue.value.mrUrl?(R(),J("a",{key:0,href:A(P).selectedIssue.value.mrUrl,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(A(P).selectedIssue.value.mrUrl),9,I2n)):Ae("",!0),A(P).selectedIssue.value.linkedMrUrls?(R(),J("div",A2n,[(R(!0),J(sn,null,bi(A(P).selectedIssue.value.linkedMrUrls,(Se,te)=>(R(),J("div",{key:te,class:"flex items-start gap-2"},[E("span",T2n,M(te)+":",1),E("a",{href:Se,target:"_blank",rel:"noopener",class:"text-sm text-green-600 hover:text-green-800 underline break-all"},M(Se),9,M2n)]))),128))])):Ae("",!0)])):Ae("",!0),A(P).selectedIssue.value.lastError?(R(),J("div",P2n,[E("div",D2n,[E("div",O2n,M(le.$t("detail.errorInfo")),1),E("p",L2n,M(A(P).selectedIssue.value.lastError),1)])])):Ae("",!0),E("div",N2n,[E("div",R2n,[A(P).selectedIssue.value.state==="skipped"?(R(),J("button",{key:0,class:"px-3 py-1.5 bg-green-500 text-white text-xs rounded-lg hover:bg-green-600",onClick:Ce[3]||(Ce[3]=Se=>A(P).doStartIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.start")),1)):Ae("",!0),A(P).selectedIssue.value.state==="failed"?(R(),J("button",{key:1,class:"px-3 py-1.5 bg-blue-500 text-white text-xs rounded-lg hover:bg-blue-600",onClick:Ce[4]||(Ce[4]=Se=>A(P).doRetryIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.retry")),1)):Ae("",!0),A(P).selectedIssue.value.state==="completed"?(R(),J("button",{key:2,class:"px-3 py-1.5 bg-purple-500 text-white text-xs rounded-lg hover:bg-purple-600",onClick:Ce[5]||(Ce[5]=Se=>A(P).doMarkDeployed(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.markDeployed")),1)):Ae("",!0),A(P).selectedIssue.value.preview?.running?(R(),J("button",{key:3,class:"px-3 py-1.5 bg-orange-100 text-orange-700 text-xs rounded-lg hover:bg-orange-200",onClick:Ce[6]||(Ce[6]=Se=>A(P).doStopPreview(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.stopPreview")),1)):Ae("",!0),!["pending","skipped","deployed"].includes(A(P).selectedIssue.value.state)&&!A(P).selectedIssue.value.preview?.running?(R(),J("button",{key:4,class:"px-3 py-1.5 bg-indigo-100 text-indigo-700 text-xs rounded-lg hover:bg-indigo-200",onClick:Ce[7]||(Ce[7]=Se=>A(P).doRestartPreview(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.restartPreview")),1)):Ae("",!0),A(P).selectedIssue.value.state!=="skipped"?(R(),J("button",{key:5,class:"px-3 py-1.5 bg-yellow-100 text-yellow-700 text-xs rounded-lg hover:bg-yellow-200",onClick:Ce[8]||(Ce[8]=Se=>A(P).doRestartIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.restart")),1)):Ae("",!0),E("button",{class:"px-3 py-1.5 bg-red-100 text-red-600 text-xs rounded-lg hover:bg-red-200",onClick:Ce[9]||(Ce[9]=Se=>A(P).doCancelIssue(A(_r)(A(P).selectedIssue.value),oe))},M(le.$t("detail.cancelTrack")),1)])])]),E("div",F2n,[E("div",B2n,[(R(),J(sn,null,bi(["docs","review","supplement","logs","e2e"],Se=>E("button",{key:Se,class:wn(["px-4 py-2.5 text-sm font-medium border-b-2 transition-colors",b.value===Se?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"]),onClick:te=>b.value=Se},M(le.$t(`detail.tab.${Se}`)),11,H2n)),64))]),E("div",G2n,[b.value==="docs"?(R(),Ts(s2t,{key:0,"issue-iid":A(_r)(A(P).selectedIssue.value),"plan-docs":A(I)(A(P).selectedIssue.value),"is-editable-doc":A(N),"detail-version":A(P).detailVersion.value},null,8,["issue-iid","plan-docs","is-editable-doc","detail-version"])):Ae("",!0),b.value==="review"?(R(),Ts(n2t,{key:1,"review-submitting":A(P).reviewSubmitting.value,"review-feedback":A(P).reviewFeedback.value,"review-history":A(P).reviewHistory.value,"onUpdate:reviewFeedback":Ce[10]||(Ce[10]=Se=>A(P).reviewFeedback.value=Se),onApprove:Ce[11]||(Ce[11]=Se=>A(P).doApprovePlan(A(_r)(A(P).selectedIssue.value),oe)),onReject:Ce[12]||(Ce[12]=Se=>A(P).doRejectPlan(A(_r)(A(P).selectedIssue.value),oe)),onSkip:Ce[13]||(Ce[13]=Se=>A(P).doSkipReview(A(_r)(A(P).selectedIssue.value),oe))},null,8,["review-submitting","review-feedback","review-history"])):Ae("",!0),b.value==="supplement"?(R(),Ts(i2t,{key:2,supplement:A(P).detailSupplement.value,"supplement-form":A(P).detailSupplementForm.value,loading:A(P).detailSupplementLoading.value,editing:A(P).detailSupplementEditing.value,saving:A(P).detailSupplementSaving.value,"has-data":A(P).hasSupplementData(A(P).detailSupplement.value),onEdit:Ce[14]||(Ce[14]=Se=>A(P).enterSupplementEdit()),onSave:Ce[15]||(Ce[15]=Se=>A(P).saveDetailSupplement(oe)),onCancel:Ce[16]||(Ce[16]=Se=>A(P).detailSupplementEditing.value=!1),"onUpdate:supplementForm":Ce[17]||(Ce[17]=Se=>A(P).detailSupplementForm.value=Se)},null,8,["supplement","supplement-form","loading","editing","saving","has-data"])):Ae("",!0),b.value==="logs"?(R(),Ts(r2t,{key:3,logs:A(U).filteredLogs.value,"issue-state":A(P).selectedIssue.value.state,"current-phase":A(P).selectedIssue.value.currentPhase,"auto-scroll":A(U).agentAutoScroll.value,"debug-mode":A(U).debugMode.value,"onUpdate:autoScroll":Ce[18]||(Ce[18]=Se=>A(U).agentAutoScroll.value=Se),"onUpdate:debugMode":Ce[19]||(Ce[19]=Se=>A(U).debugMode.value=Se),onClear:Ce[20]||(Ce[20]=Se=>A(U).clear())},null,8,["logs","issue-state","current-phase","auto-scroll","debug-mode"])):Ae("",!0),b.value==="e2e"?(R(),Ts(o2t,{key:4,"issue-iid":A(_r)(A(P).selectedIssue.value)},null,8,["issue-iid"])):Ae("",!0)])])])])):(R(),J("div",J2n,[E("div",U2n,[E("div",z2n,M(le.$t("detail.loading")),1),E("a",q2n,M(le.$t("detail.backToList")),1)])]))}});async function Vbt(a,d){const b=a.body?.getReader();if(!b)return{receivedAny:!1};const m=new TextDecoder;let w="",$=!1;for(;;){const{done:p,value:j}=await b.read();if(p)break;w+=m.decode(j,{stream:!0});const I=w.split(`
|
|
124
124
|
|
|
125
125
|
`);w=I.pop()??"";for(const N of I)if(N.startsWith("data: "))try{const P=JSON.parse(N.slice(6));$=!0,await d(P)}catch{}}return{receivedAny:$}}function c2t(){const{t:a}=Kg(),d=Ye(0),b=6,m=Ye(!1),w=Ye(""),$=Ye([]),p=Ye(null),j=Ye(null),I=Ye(null),N=Ye(null),P=Ye(""),U=Ye([]),V=Ye(!1),X=Ye(""),ee=Ye(0);let K=null;const he=Ye(!1),ke=Ye(""),ue=Ye(!1),oe=Ye(new Map),re=Ye(""),ye=Ye(""),pe=i_({gongfeng:{apiUrl:"https://git.woa.com/",privateToken:"",projectPath:""},project:{workDir:"",gitRootDir:"",baseBranch:"master",branchPrefix:"feat/issue",worktreeBaseDir:"",projectSubDir:""},ai:{mode:"claude-internal",model:"Claude-4.6-Opus",phaseTimeoutMs:18e5},poll:{discoveryIntervalMs:6e4,driveIntervalMs:15e3,maxRetries:3,maxConcurrent:3},web:{port:3e3},pipeline:{mode:"auto"},review:{enabled:!0},e2e:{uatVendorDir:"",uatConfigFile:"",pythonBin:"python3"},release:{enabled:!1}}),be=En(()=>{switch(d.value){case 0:{const Pt=$.value.filter(Mt=>Mt.required);return Pt.length>0&&Pt.every(Mt=>Mt.installed)}case 1:return pe.project.workDir.trim()!=="";case 2:return pe.gongfeng.apiUrl.trim()!==""&&pe.gongfeng.privateToken.trim()!==""&&pe.gongfeng.projectPath.trim()!==""&&p.value===!0&&I.value===!0;case 3:return $.value.filter(Pt=>Pt.name===pe.ai.mode.replace("-","-")).every(Pt=>Pt.installed||!Pt.required);case 4:return!0;case 5:return P.value!=="";default:return!1}});async function se(Pt=!1){Pt||(m.value=!0,w.value="");try{const Mt=await fetch(`/api/setup/check-env?aiMode=${pe.ai.mode}`);if(!Mt.ok){Pt||(w.value=`Failed to check environment: HTTP ${Mt.status}`);return}const ln=await Mt.json();$.value=ln.dependencies??[]}catch(Mt){Pt||(w.value=Mt.message)}finally{Pt||(m.value=!1)}}async function le(){if(p.value=null,j.value=null,!(!pe.gongfeng.apiUrl||!pe.gongfeng.privateToken))try{const Mt=await(await fetch("/api/setup/validate-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiUrl:pe.gongfeng.apiUrl,token:pe.gongfeng.privateToken})})).json();p.value=Mt.valid,j.value=Mt.user??null,Mt.valid||(w.value=Mt.error??"Token validation failed")}catch(Pt){p.value=!1,w.value=Pt.message}}async function Ce(){if(I.value=null,N.value=null,!(!pe.gongfeng.apiUrl||!pe.gongfeng.privateToken||!pe.gongfeng.projectPath))try{const Mt=await(await fetch("/api/setup/validate-repo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiUrl:pe.gongfeng.apiUrl,token:pe.gongfeng.privateToken,projectPath:pe.gongfeng.projectPath})})).json();I.value=Mt.valid,N.value=Mt.project??null,Mt.valid||(w.value=Mt.error??"Repository validation failed")}catch(Pt){I.value=!1,w.value=Pt.message}}function Se(){ee.value=0,K=setInterval(()=>{ee.value++},1e3)}function te(){K&&(clearInterval(K),K=null)}dp(()=>te());async function q(Pt){V.value=!0,X.value=Pt,U.value=[],re.value="",ue.value=!0,Se();let Mt=!1;try{const ln=await fetch("/api/setup/install-dep",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Pt})});if(!ln.ok){const Ir=`Server error: ${ln.status} ${ln.statusText}`;U.value.push(Ir),re.value=Ir,oe.value.set(Pt,"failed");return}const{receivedAny:wi}=await Vbt(ln,async Ir=>{if(Ir.line&&U.value.push(Ir.line),Ir.error&&(re.value=Ir.error,U.value.push(`Error: ${Ir.error}`)),Ir.done){Mt=!0,await se(!0);const Ht=$.value.find(on=>on.name===Pt)?.installed;oe.value.set(Pt,Ht?"success":"failed")}});wi||U.value.push(a("setup.env.emptyResponse")),Mt||(oe.value.set(Pt,"failed"),await se(!0))}catch(ln){const wi=ln.message;U.value.push(`Error: ${wi}`),re.value=wi,oe.value.set(Pt,"failed")}finally{te(),V.value=!1,X.value=""}}async function He(){V.value=!0,X.value="",ye.value="",U.value=[],re.value="",ue.value=!0,Se();try{const Pt=await fetch("/api/setup/install-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aiMode:pe.ai.mode})});if(!Pt.ok){let ln="";try{ln=await Pt.text()}catch{}const wi=`Server error: ${Pt.status} ${Pt.statusText}`;U.value.push(wi),ln&&U.value.push(ln),Pt.status===404&&U.value.push("Hint: The install-all API route may not be registered. Try upgrading the package or check /api/setup/health"),re.value=wi;return}const{receivedAny:Mt}=await Vbt(Pt,async ln=>{ln.phase&&ln.status==="start"&&(X.value=ln.dep??"",ye.value=ln.phase),ln.line&&U.value.push(ln.line),ln.phase&&ln.status==="done"&&(ln.installed?oe.value.set(ln.dep,"success"):ln.dep&&oe.value.set(ln.dep,"failed")),ln.error&&(re.value=ln.error,U.value.push(`Error: ${ln.error}`)),ln.done&&await se(!0)});Mt||(U.value.push(a("setup.env.emptyResponse")),await se(!0))}catch(Pt){const Mt=Pt.message;U.value.push(`Error: ${Mt}`),re.value=Mt}finally{te(),V.value=!1,X.value="",ye.value=""}}async function gt(){try{const Mt=await(await fetch("/api/setup/generate-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(pe)})).json();P.value=Mt.preview}catch(Pt){w.value=Pt.message}}async function ze(){m.value=!0,w.value="";try{const Mt=await(await fetch("/api/setup/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:pe})})).json();Mt.success?(he.value=!0,ke.value=Mt.configPath??""):w.value=Mt.error??"Setup failed"}catch(Pt){w.value=Pt.message}finally{m.value=!1}}async function jt(){m.value=!0,w.value="";try{const Pt=await fetch("/api/setup/current-config");if(!Pt.ok){w.value=`Failed to load config: HTTP ${Pt.status}`;return}const Mt=await Pt.json(),ln=Mt.config;pe.gongfeng.apiUrl=ln.gongfeng.apiUrl||pe.gongfeng.apiUrl,pe.gongfeng.privateToken=ln.gongfeng.privateToken||"",pe.gongfeng.projectPath=ln.gongfeng.projectPath||"",pe.project.workDir=ln.project.workDir||"",pe.project.gitRootDir=ln.project.gitRootDir??"",pe.project.baseBranch=ln.project.baseBranch??"master",pe.project.branchPrefix=ln.project.branchPrefix??"feat/issue",pe.project.worktreeBaseDir=ln.project.worktreeBaseDir??"",pe.project.projectSubDir=ln.project.projectSubDir??"",pe.ai.mode=ln.ai.mode||"claude-internal",pe.ai.model=ln.ai.model??"Claude-4.6-Opus",pe.ai.phaseTimeoutMs=ln.ai.phaseTimeoutMs??18e5,pe.poll.discoveryIntervalMs=ln.poll?.discoveryIntervalMs??6e4,pe.poll.driveIntervalMs=ln.poll?.driveIntervalMs??15e3,pe.poll.maxRetries=ln.poll?.maxRetries??3,pe.poll.maxConcurrent=ln.poll?.maxConcurrent??3,pe.web.port=ln.web?.port??3e3,pe.pipeline.mode=ln.pipeline?.mode??"auto",pe.review.enabled=ln.review?.enabled??!0,pe.e2e.uatVendorDir=ln.e2e?.uatVendorDir??"",pe.e2e.uatConfigFile=ln.e2e?.uatConfigFile??"",pe.e2e.pythonBin=ln.e2e?.pythonBin??"python3",pe.release.enabled=ln.release?.enabled??!1,ke.value=Mt.configPath}catch(Pt){w.value=Pt.message}finally{m.value=!1}}async function Jt(){m.value=!0,w.value="";try{const Mt=await(await fetch("/api/setup/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:pe})})).json();return Mt.success?(ke.value=Mt.configPath??"",!0):(w.value=Mt.error??"Save failed",!1)}catch(Pt){return w.value=Pt.message,!1}finally{m.value=!1}}function xe(){ue.value=!ue.value}function Pe(){ue.value=!1,V.value||(U.value=[])}function Je(){ue.value=!0}function Bt(){d.value<b-1&&(d.value++,w.value="",d.value===5&>())}function wt(){d.value>0&&(d.value--,w.value="")}return{currentStep:d,totalSteps:b,loading:m,error:w,form:pe,dependencies:$,tokenValid:p,tokenUser:j,repoValid:I,repoInfo:N,configPreview:P,installLogs:U,installing:V,installingDep:X,installElapsed:ee,setupComplete:he,savedConfigPath:ke,logPanelVisible:ue,installResult:oe,lastInstallError:re,installPhase:ye,canProceed:be,checkEnv:se,validateToken:le,validateRepo:Ce,installDep:q,installAll:He,generatePreview:gt,completeSetup:ze,loadCurrentConfig:jt,saveConfig:Jt,nextStep:Bt,prevStep:wt,toggleLogPanel:xe,closeLogPanel:Pe,openLogPanel:Je}}function GW(a=""){return{name:a,projectPath:"",localGitRoot:"",projectSubDir:"",baseBranch:"master",branchPrefix:"feat/issue",role:""}}function K2n(){const a=Ye(!1),d=Ye(!1),b=Ye(""),m=Ye(!1),w=Ye(null),$=Ye(void 0),p=Ye([]),j=i_({primary:GW("primary"),associates:[]}),I=En(()=>j.associates.length>0);async function N(){a.value=!0,b.value="";try{const X=await fetch("/api/setup/workspace-config");if(!X.ok){b.value=`Failed to load workspace config: HTTP ${X.status}`;return}const ee=await X.json();m.value=!!ee.configured,w.value=ee.configPath??null,ee.config&&(Object.assign(j.primary,ee.config.primary??GW("primary")),j.associates=(ee.config.associates??[]).map(K=>({...GW(),...K})))}catch(X){b.value=X.message}finally{a.value=!1}}async function P(){d.value=!0,b.value="";try{const X=await fetch("/api/setup/workspace-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:{primary:j.primary,associates:j.associates}})});if(!X.ok){const K=await X.json().catch(()=>({error:`HTTP ${X.status}`}));return b.value=K.error||`HTTP ${X.status}`,!1}const ee=await X.json();return w.value=ee.configPath??null,m.value=!0,!0}catch(X){return b.value=X.message,!1}finally{d.value=!1}}function U(){j.associates.push(GW(`associate-${j.associates.length+1}`))}function V(X){j.associates.splice(X,1)}return{loading:a,saving:d,error:b,configured:m,configPath:w,valid:$,validationErrors:p,workspace:j,hasAssociates:I,load:N,save:P,addAssociate:U,removeAssociate:V}}const Kbt=["clone","detect-python","install-playwright","install-chromium","configure","reload"];function W2n(){const a=Ye(!1),d=Ye([]),b=Ye(null),m=Ye(null),w=Ye(Kbt.map(P=>({name:P,status:"pending",message:""}))),$=En(()=>!a.value&&w.value.some(P=>P.status==="done"||P.status==="failed")),p=En(()=>$.value&&w.value.every(P=>P.status==="done"));function j(){a.value=!1,d.value=[],b.value=null,m.value=null,w.value=Kbt.map(P=>({name:P,status:"pending",message:""}))}async function I(){j(),a.value=!0;try{const P=await fetch("/api/setup/e2e-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!P.ok){b.value=`HTTP ${P.status}`,a.value=!1;return}const U=P.body?.getReader();if(!U){b.value="No response body",a.value=!1;return}const V=new TextDecoder;let X="";for(;;){const{done:ee,value:K}=await U.read();if(ee)break;X+=V.decode(K,{stream:!0});const he=X.split(`
|
|
126
126
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<link rel="icon" type="image/png" href="/favicon.png">
|
|
7
7
|
<title>Issue Auto-Finish Dashboard</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index
|
|
8
|
+
<script type="module" crossorigin src="/assets/index--KDAivOo.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-CPNbFsHB.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-gray-50 min-h-screen">
|