@knoflows/engine 0.1.0-alpha.0 → 0.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +2 -2
  2. package/dist/engine.js +33 -128
  3. package/dist/migrations/20260917165450_baseline/migration.sql +127 -0
  4. package/dist/migrations/20260917165450_baseline/snapshot.json +1212 -0
  5. package/dist/migrations/20260918025930_context_files/migration.sql +7 -0
  6. package/dist/migrations/20260918025930_context_files/snapshot.json +1275 -0
  7. package/dist/migrations/20260918074816_large_kate_bishop/migration.sql +8 -0
  8. package/dist/migrations/20260918074816_large_kate_bishop/snapshot.json +1338 -0
  9. package/package.json +19 -10
  10. package/static/assets/i18n/en.json +261 -14
  11. package/static/assets/i18n/es.json +261 -14
  12. package/static/{chunk-DLA1DsR_.js → chunk-2KSNHCgb.js} +1 -1
  13. package/static/chunk-3mppll1n.js +1 -0
  14. package/static/chunk-6BQlxALO.js +1 -0
  15. package/static/chunk-A4AkMf2s.js +1 -0
  16. package/static/chunk-B2hO-qT3.js +1 -0
  17. package/static/chunk-B8MrNxxk.js +1 -0
  18. package/static/chunk-BAc0DRm8.js +1 -0
  19. package/static/chunk-BFkZ796p.js +7 -0
  20. package/static/chunk-BNOYZq-b.js +1 -0
  21. package/static/chunk-BUuwGTt7.js +66 -0
  22. package/static/chunk-BVw7xkK9.js +1 -0
  23. package/static/chunk-BbcTWKT2.js +1 -0
  24. package/static/chunk-BhGgxvgu.js +1 -0
  25. package/static/chunk-BjZIiizu.js +1 -0
  26. package/static/chunk-CDWIMt6y.js +1 -0
  27. package/static/{chunk-B8aKNL-C.js → chunk-CEcbtdnK.js} +1 -1
  28. package/static/chunk-CJDp11v5.js +1 -0
  29. package/static/chunk-CJRNatUw.js +1 -0
  30. package/static/chunk-CWbxWv5I.js +1 -0
  31. package/static/chunk-Cd8F2jeN.js +1 -0
  32. package/static/chunk-Cf_xd8ER.js +1 -0
  33. package/static/chunk-CgqRVtSF.js +1 -0
  34. package/static/chunk-CxBYhrEj.js +1 -0
  35. package/static/chunk-D6YfO72h.js +1 -0
  36. package/static/chunk-DNOjVPY0.js +1 -0
  37. package/static/chunk-DQnMulwi.js +1 -0
  38. package/static/chunk-DblClAqu.js +1 -0
  39. package/static/chunk-DjibVmY7.js +1 -0
  40. package/static/chunk-DoXxOh8j.js +1 -0
  41. package/static/chunk-Ojn34cvU.js +1 -0
  42. package/static/chunk-W5GAgssE.js +1 -0
  43. package/static/chunk-XLpSkczx.js +1 -0
  44. package/static/chunk-cHfOiAJm.js +1 -0
  45. package/static/chunk-eSxb3-OU.js +1 -0
  46. package/static/chunk-hZzW00VR.js +1 -0
  47. package/static/chunk-jct1_zOr.js +1 -0
  48. package/static/chunk-mzyds3TS.js +1 -0
  49. package/static/chunk-tYnBYi0l.js +1 -0
  50. package/static/chunk-wbdetocK.js +5 -0
  51. package/static/index.html +6 -3
  52. package/static/main-MNK6ZYDO.js +249 -0
  53. package/static/styles-6MW3GE4V.css +1 -0
  54. package/static/chunk-8joH1h3C.js +0 -1
  55. package/static/chunk-B4A7hSM3.js +0 -1
  56. package/static/chunk-B5hULR_G.js +0 -1
  57. package/static/chunk-BNylhXVN.js +0 -1
  58. package/static/chunk-BV9svMMc.js +0 -1
  59. package/static/chunk-BX5sYPy1.js +0 -1
  60. package/static/chunk-Be6g3Cmv.js +0 -1
  61. package/static/chunk-Bgtkf8nM.js +0 -1
  62. package/static/chunk-Bl6kwpIK.js +0 -1
  63. package/static/chunk-BvDaTl4u.js +0 -1
  64. package/static/chunk-ByacugWF.js +0 -1
  65. package/static/chunk-CPYgCVHJ.js +0 -1
  66. package/static/chunk-CRPsjdw8.js +0 -1
  67. package/static/chunk-CZLubDvD.js +0 -1
  68. package/static/chunk-Cczqw9G5.js +0 -1
  69. package/static/chunk-CntkJjcW.js +0 -1
  70. package/static/chunk-Cuh7ppOq.js +0 -1
  71. package/static/chunk-Cv76Fxhr.js +0 -66
  72. package/static/chunk-D3rwM_uV.js +0 -7
  73. package/static/chunk-DHPxevqq.js +0 -1
  74. package/static/chunk-DYzjfNdD.js +0 -1
  75. package/static/chunk-DdSpqYCm.js +0 -5
  76. package/static/chunk-Di8Mt9Sl.js +0 -1
  77. package/static/chunk-Di_OsX8x.js +0 -1
  78. package/static/chunk-DlU8g0UO.js +0 -1
  79. package/static/chunk-DpU7iV6a.js +0 -1
  80. package/static/chunk-iJsU0w_6.js +0 -1
  81. package/static/chunk-mjUdDQQg.js +0 -1
  82. package/static/main-JSLBK4RN.js +0 -235
  83. package/static/styles-W2TNDHKW.css +0 -1
@@ -1,7 +0,0 @@
1
- import {G as Gn,u as un}from'./chunk-DpU7iV6a.js';import {U as U$1}from'./chunk-DLA1DsR_.js';import {f}from'./chunk-DHPxevqq.js';import {e as et,U as U$2,G,i as it,v as vt}from'./chunk-CPYgCVHJ.js';import {W as W$1,I}from'./chunk-Bgtkf8nM.js';import'./chunk-BvDaTl4u.js';import'./chunk-DlU8g0UO.js';import'./chunk-B8aKNL-C.js';import {C,Q as W,v as vr,a as at,G as Go,K as Kw,x as xt,T as sd,X as Jw,J as JE,j as jn,M as Mt,V as Vd,c as Fc,y as y7,Y as A7,f as fc,N as Ni,p as ND,k as tl,u as vI,D as xD,Z as q0,$ as U0,h as _w,U as Uw,w as Vh,W as Ww,E as zD,H as HD,l as yh,z as sl,a0 as Gw,a1 as Bw,A as uh,m as kD,O as OD,o as dh,I as Vu,L as Hu,a2 as Nh,a3 as lh,a4 as Hw,a5 as AD}from'./main-JSLBK4RN.js';import {U}from'./chunk-CZLubDvD.js';import {o}from'./chunk-Di_OsX8x.js';import'./chunk-B4A7hSM3.js';var de=t=>({index:t}),ce=()=>[],Ce=(t,s)=>s.definition.id,ge=(t,s)=>s.index;function be(t,s){if(t&1){let e=HD();Ni(0,"div",1)(1,"button",2),yh("click",function(){Vu(e);let o=zD();return Hu(o.closeIteration())}),_w(2),Uw(3,"transloco"),tl(),Ni(4,"p",3),_w(5),Uw(6,"transloco"),tl(),Ni(7,"app-job-step-workspace",4),yh("selectExecution",function(o){Vu(e);let m=zD();return Hu(m.onNestedSelect(o))}),tl()();}if(t&2){let e=s,i=zD();vI(2),sl(" ",Ww(3,9,"jobs.detail.loopBack")," "),vI(3),sl(" ",Gw(6,11,"jobs.detail.loopIteration",Bw(14,de,e.index+1))," "),vI(2),uh("definitions",i.nestedLoopDefinition().steps)("executions",e.stepExecutions)("job",i.job())("selectedExecutionId",i.nestedSelectedId())("currentExecutionId",null)("waitingEvent",null)("canResume",false);}}function he(t,s){if(t&1&&(Ni(0,"nz-tag"),_w(1),Uw(2,"transloco"),tl()),t&2){let e=zD().$implicit,i=zD(2);lh("data-testid","step-status-"+e.definition.id),vI(),Vh(Ww(2,2,i.stepStatusKey(s.status)));}}function ve(t,s){if(t&1){let e=HD();Ni(0,"li")(1,"button",9),yh("click",function(){let o=Vu(e).$implicit,m=zD(2);return Hu(m.onStepClick(o))}),Ni(2,"span",10),_w(3),tl(),Ni(4,"span",11)(5,"span",12),_w(6),Uw(7,"transloco"),tl(),ND(8,he,3,4,"nz-tag"),tl()()();}if(t&2){let e,i=s.$implicit,o=zD(2);vI(),Nh("selected",o.isSelected(i))("current",o.isCurrent(i))("unreached",!i.reached),uh("disabled",!i.reached),lh("data-testid","step-"+i.definition.id),vI(2),Vh(i.definition.name),vI(3),Vh(Ww(7,11,o.stepTypeKey(i.definition.type))),vI(2),xD((e=i.execution)?8:-1,e);}}function Ee(t,s){t&1&&(Ni(0,"p",8),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),sl(" ",Ww(2,1,"jobs.detail.noStepSelected")," "));}function Se(t,s){t&1&&(Ni(0,"p",16),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),Vh(Ww(2,1,"jobs.detail.inProgress.loop")));}function we(t,s){if(t&1){let e=HD();Ni(0,"li")(1,"button",19),yh("click",function(){let o=Vu(e).$implicit,m=zD(4);return Hu(m.openIteration(m.selectedDefinition(),o))}),_w(2),Uw(3,"transloco"),tl()();}if(t&2){let e=s.$implicit;vI(),lh("data-testid","loop-iteration-"+e.index),vI(),sl(" ",Gw(3,2,"jobs.detail.loopIteration",Bw(5,de,e.index+1))," ");}}function Ie(t,s){t&1&&(Ni(0,"li",12),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),Vh(Ww(2,1,"jobs.detail.noIterations")));}function Te(t,s){if(t&1&&(Ni(0,"p",18),_w(1),tl()),t&2){let e=zD(4);vI(),Vh(e.selectedExecution().error);}}function ke(t,s){if(t&1&&(Ni(0,"div",13)(1,"h3"),_w(2),tl(),ND(3,Se,3,3,"p",16),Ni(4,"ul",17),kD(5,we,4,7,"li",null,ge,false,Ie,3,3,"li",12),tl(),ND(8,Te,2,1,"p",18),tl()),t&2){let e=zD(3);vI(2),Vh(e.selectedDefinition()?.name),vI(),xD(e.isRunning(e.selectedExecution())?3:-1),vI(2),OD(e.selectedExecution().iterations??Hw(4,ce)),vI(3),xD(e.selectedExecution().error?8:-1);}}function Me(t,s){t&1&&(Ni(0,"p",16),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),sl(" ",Ww(2,1,"jobs.detail.inProgress.sub_workflow")," "));}function ye(t,s){if(t&1&&(Ni(0,"p",18),_w(1),tl()),t&2){let e=zD(4);vI(),Vh(e.selectedExecution().error);}}function je(t,s){if(t&1&&(Ni(0,"div",14)(1,"h3"),_w(2),tl(),ND(3,Me,3,3,"p",16),dh(4,"app-job-status-table",20),ND(5,ye,2,1,"p",18),tl()),t&2){let e=zD(3);vI(2),Vh(e.selectedDefinition()?.name),vI(),xD(e.isRunning(e.selectedExecution())?3:-1),vI(),uh("jobIds",e.selectedExecution().childJobIds??Hw(4,ce)),vI(),xD(e.selectedExecution().error?5:-1);}}function De(t,s){if(t&1&&(Ni(0,"li"),_w(1),tl()),t&2){let e=s.$implicit;vI(),Vh(e);}}function Je(t,s){t&1&&(Ni(0,"li",12),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),Vh(Ww(2,1,"jobs.resume.noQuestions")));}function Pe(t,s){if(t&1&&(Ni(0,"p",25),_w(1),tl()),t&2){let e=zD(5);vI(),Vh(e.resumeParseError());}}function Ne(t,s){if(t&1){let e=HD();Ni(0,"section",21)(1,"h4"),_w(2),Uw(3,"transloco"),tl(),Ni(4,"ul",23),kD(5,De,2,1,"li",null,AD,false,Je,3,3,"li",12),tl(),Ni(8,"label"),_w(9),Uw(10,"transloco"),Ni(11,"textarea",24),yh("input",function(o){Vu(e);let m=zD(4);return Hu(m.onResumeTextInput(o))}),tl()(),ND(12,Pe,2,1,"p",25),Ni(13,"button",26),yh("click",function(){Vu(e);let o=zD(4);return Hu(o.resumeSubmit.emit())}),_w(14),Uw(15,"transloco"),tl()();}if(t&2){let e=zD(4);vI(2),Vh(Ww(3,7,"jobs.resume.heading")),vI(3),OD(e.waitingPrompts()),vI(4),sl(" ",Ww(10,9,"jobs.resume.jsonLabel")," "),vI(2),uh("value",e.resumeText()),vI(),xD(e.resumeParseError()?12:-1),vI(),uh("disabled",e.resuming()),vI(),sl(" ",Ww(15,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function Oe(t,s){if(t&1&&(Ni(0,"pre",22),_w(1),tl()),t&2){let e=zD(4);vI(),Vh(e.formatOutput(e.selectedExecution()));}}function We(t,s){if(t&1&&(Ni(0,"div",15)(1,"h3"),_w(2),tl(),ND(3,Ne,16,13,"section",21)(4,Oe,2,1,"pre",22),tl()),t&2){let e=zD(3);vI(2),Vh(e.selectedDefinition()?.name),vI(),xD(e.showResume()?3:4);}}function ze(t,s){if(t&1&&(Ni(0,"p",16),_w(1),Uw(2,"transloco"),tl()),t&2){let e=zD(4);vI(),sl(" ",Ww(2,1,"jobs.detail.inProgress."+e.selectedExecution().type)," ");}}function Re(t,s){if(t&1&&(Ni(0,"p",27),_w(1),tl()),t&2){let e=zD(4);vI(),Vh(e.selectedExecution().error);}}function Be(t,s){if(t&1&&(Ni(0,"pre",22),_w(1),tl()),t&2){let e=zD(4);vI(),Vh(e.formatOutput(e.selectedExecution()));}}function Fe(t,s){if(t&1&&(Ni(0,"div")(1,"h3"),_w(2),tl(),ND(3,ze,3,3,"p",16)(4,Re,2,1,"p",27)(5,Be,2,1,"pre",22),tl()),t&2){let e=zD(3);lh("data-testid",e.selectedExecution().type+"-view"),vI(2),Vh(e.selectedDefinition()?.name),vI(),xD(e.isRunning(e.selectedExecution())?3:e.selectedExecution().error?4:5);}}function Ve(t,s){if(t&1&&ND(0,ke,9,5,"div",13)(1,je,6,5,"div",14)(2,We,5,2,"div",15)(3,Fe,6,3,"div"),t&2){let e,i=zD(2);xD((e=i.selectedExecution().type)==="loop"?0:e==="sub_workflow"?1:e==="interaction"?2:3);}}function Le(t,s){if(t&1&&(Ni(0,"aside",5)(1,"h3"),_w(2),Uw(3,"transloco"),tl(),Ni(4,"ul",6),kD(5,ve,9,13,"li",null,Ce),tl()(),Ni(7,"section",7),ND(8,Ee,3,3,"p",8)(9,Ve,4,1),tl()),t&2){let e=zD();vI(2),Vh(Ww(3,2,"jobs.detail.stepsHeading")),vI(3),OD(e.rows()),vI(3),xD(e.selectedExecution()?9:8);}}var pe=(()=>{class t{constructor(){this.definitions=q0.required(),this.executions=q0.required(),this.job=q0.required(),this.selectedExecutionId=q0(null),this.currentExecutionId=q0(null),this.waitingEvent=q0(null),this.resumeText=q0(`{
2
-
3
- }`),this.resumeParseError=q0(null),this.resuming=q0(false),this.canResume=q0(false),this.selectExecution=U0(),this.resumeTextChange=U0(),this.resumeSubmit=U0(),this.nestedIteration=Go(null),this.nestedLoopDefinition=Go(null),this.nestedSelectedId=Go(null),this.rows=Kw(()=>it(this.definitions(),this.executions())),this.selectedExecution=Kw(()=>{let e=this.selectedExecutionId();return e?this.executions().find(i=>i.id===e)??null:null}),this.selectedDefinition=Kw(()=>{let e=this.selectedExecution();return e?this.definitions().find(i=>i.id===e.stepDefinitionId)??null:null}),this.waitingPrompts=Kw(()=>{let e=this.waitingEvent();return e?e.questions.length>0?e.questions:e.data!=null?[JSON.stringify(e.data,null,2)]:[]:[]}),this.showResume=Kw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),i=this.currentExecutionId();return e!=null&&e.id===i&&e.type==="interaction"&&this.job().status==="waiting_for_human"});}stepStatusKey(e){return `jobs.stepStatus.${e}`}stepTypeKey(e){return `step-list.stepType.${e}`}onStepClick(e){!e.reached||!e.execution||(this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.selectExecution.emit(e.execution.id));}openIteration(e,i){this.nestedLoopDefinition.set(e),this.nestedIteration.set(i);let o=i.stepExecutions[0];this.nestedSelectedId.set(o?.id??null);}closeIteration(){this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.nestedSelectedId.set(null);}onNestedSelect(e){this.nestedSelectedId.set(e);}onResumeTextInput(e){this.resumeTextChange.emit(e.target.value);}formatOutput(e){return e.error?e.error:e.output===void 0?"":typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)}isRunning(e){return e?.status==="running"}isSelected(e){return e.execution!=null&&e.execution.id===this.selectedExecutionId()}isCurrent(e){return e.execution!=null&&e.execution.id===this.currentExecutionId()}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=JE({type:t,selectors:[["app-job-step-workspace"]],inputs:{definitions:[1,"definitions"],executions:[1,"executions"],job:[1,"job"],selectedExecutionId:[1,"selectedExecutionId"],currentExecutionId:[1,"currentExecutionId"],waitingEvent:[1,"waitingEvent"],resumeText:[1,"resumeText"],resumeParseError:[1,"resumeParseError"],resuming:[1,"resuming"],canResume:[1,"canResume"]},outputs:{selectExecution:"selectExecution",resumeTextChange:"resumeTextChange",resumeSubmit:"resumeSubmit"},decls:3,vars:1,consts:[["data-testid","job-step-workspace",1,"workspace"],["data-testid","loop-drill-in",1,"nested"],["nz-button","","nzType","link","type","button","data-testid","loop-back",3,"click"],[1,"nested-label"],[3,"selectExecution","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","canResume"],["data-testid","step-side-panel",1,"side-panel"],[1,"step-list"],["data-testid","step-main-area",1,"main-area"],["data-testid","no-step-selected",1,"muted"],["type","button",1,"step-button",3,"click","disabled"],[1,"step-name"],[1,"step-meta"],[1,"muted"],["data-testid","loop-view"],["data-testid","sub-workflow-view"],["data-testid","interaction-view"],["data-testid","step-in-progress"],["data-testid","loop-iterations",1,"iteration-list"],[1,"error"],["nz-button","","nzType","link","type","button",3,"click"],[3,"jobIds"],["data-testid","resume-form",1,"resume"],["data-testid","step-output"],["data-testid","waiting-questions"],["data-testid","resume-json","rows","8",3,"input","value"],["data-testid","resume-parse-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","resume-button",3,"click","disabled"],["data-testid","step-error",1,"error"]],template:function(i,o){if(i&1&&(Ni(0,"div",0),ND(1,be,8,16,"div",1)(2,Le,10,4),tl()),i&2){let m;vI(),xD((m=o.nestedIteration())?1:2,m);}},dependencies:[t,jn,Vd,Fc,y7,A7,W$1,I,vt,fc],styles:[".workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(14rem,18rem) 1fr;gap:1rem;align-items:start;min-height:20rem}.nested[_ngcontent-%COMP%]{grid-column:1 / -1}.nested-label[_ngcontent-%COMP%]{margin:0 0 .75rem;color:#57534e}.side-panel[_ngcontent-%COMP%]{border:1px solid #d6d3d1;background:#ffffffbf;padding:.75rem}.side-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.step-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem}.step-button[_ngcontent-%COMP%]{width:100%;text-align:left;font:inherit;padding:.45rem .55rem;border:1px solid transparent;background:transparent;cursor:pointer;display:flex;flex-direction:column;gap:.2rem}.step-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#f5f5f4}.step-button.selected[_ngcontent-%COMP%]{border-color:#a8a29e;background:#fafaf9}.step-button.current[_ngcontent-%COMP%]{box-shadow:inset 3px 0 #0c0a09}.step-button[_ngcontent-%COMP%]:disabled, .step-button.unreached[_ngcontent-%COMP%]{opacity:.55;cursor:not-allowed}.step-name[_ngcontent-%COMP%]{font-weight:600}.step-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;font-size:.8rem}.main-area[_ngcontent-%COMP%]{border:1px solid #d6d3d1;background:#ffffffd9;padding:1rem;min-height:16rem}.main-area[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}pre[_ngcontent-%COMP%]{overflow:auto;padding:.75rem;background:#f5f5f4;border:1px solid #d6d3d1;font-size:.85rem}.iteration-list[_ngcontent-%COMP%]{padding-left:1.1rem}.resume[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0}.resume[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font:inherit;font-family:ui-monospace,Consolas,monospace;padding:.4rem .5rem;border:1px solid #a8a29e}@media(max-width:48rem){.workspace[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]});}}return t})();function Ae(t,s){t&1&&(Ni(0,"p",1),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),Vh(Ww(2,1,"common.loading")));}function $e(t,s){if(t&1&&(Ni(0,"p",2),_w(1),tl()),t&2){let e=zD();vI(),Vh(e.loadError());}}function qe(t,s){if(t&1){let e=HD();Ni(0,"button",15),yh("click",function(){Vu(e);let o=zD(2);return Hu(o.jumpToCurrent())}),_w(1),Uw(2,"transloco"),tl();}t&2&&(vI(),sl(" ",Ww(2,1,"jobs.detail.jumpToCurrent")," "));}function Ke(t,s){if(t&1&&(Ni(0,"p",11),_w(1),tl()),t&2){let e=zD(2);vI(),Vh(e.actionError());}}function Qe(t,s){t&1&&(dh(0,"nz-alert",12),Uw(1,"transloco")),t&2&&uh("nzMessage",Ww(1,1,"jobs.detail.queued"));}function He(t,s){if(t&1){let e=HD();Ni(0,"app-job-step-workspace",16),yh("selectExecution",function(o){Vu(e);let m=zD(2);return Hu(m.onSelectExecution(o))})("resumeTextChange",function(o){Vu(e);let m=zD(2);return Hu(m.setResumeText(o))})("resumeSubmit",function(){Vu(e);let o=zD(2);return Hu(o.submitResume())}),tl();}if(t&2){let e=zD(),i=zD();uh("definitions",s.steps)("executions",e.stepHistory)("job",e)("selectedExecutionId",i.viewedExecutionId())("currentExecutionId",i.currentStep()?.id??null)("waitingEvent",i.waitingEvent())("resumeText",i.resumeText())("resumeParseError",i.resumeParseError())("resuming",i.resuming())("canResume",true);}}function Ue(t,s){t&1&&(Ni(0,"p",14),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),sl(" ",Ww(2,1,"jobs.detail.workflowMissing")," "));}function Ge(t,s){if(t&1&&(Ni(0,"header",3)(1,"div")(2,"a",4),_w(3),Uw(4,"transloco"),tl(),Ni(5,"h1",5),_w(6),tl(),Ni(7,"p",6)(8,"span",7),_w(9),tl(),_w(10," \xB7 "),Ni(11,"nz-tag",8),_w(12),Uw(13,"transloco"),tl(),_w(14," \xB7 "),Ni(15,"span",9),_w(16),tl()()(),ND(17,qe,3,3,"button",10),tl(),ND(18,Ke,2,1,"p",11),ND(19,Qe,2,3,"nz-alert",12)(20,He,1,10,"app-job-step-workspace",13)(21,Ue,3,3,"p",14)),t&2){let e,i=s,o=zD();vI(3),Vh(Ww(4,8,"jobs.detail.backToStart")),vI(3),Vh(i.id),vI(3),Vh(i.workflowId),vI(3),Vh(Ww(13,10,o.statusKey(i.status))),vI(4),Vh(o.subjectText()),vI(),xD(o.showJumpToCurrent()?17:-1),vI(),xD(o.actionError()?18:-1),vI(),xD(o.showQueued()?19:(e=o.workflow())?20:21,e);}}var Et=(()=>{class t{constructor(){this.route=C(W),this.jobsApi=C(U),this.workflowsApi=C(U$1),this.eventsService=C(f),this.transloco=C(vr),this.destroyRef=C(at),this.job=Go(null),this.workflow=Go(null),this.loading=Go(true),this.loadError=Go(null),this.actionError=Go(null),this.eventStream=Go(null),this.eventsSnapshot=Go([]),this.autoFollow=Go(true),this.viewedExecutionId=Go(null),this.resumeText=Go(`{
4
-
5
- }`),this.resumeParseError=Go(null),this.resuming=Go(false),this.currentStep=Kw(()=>{let e=this.job();return e?et(e):null}),this.showQueued=Kw(()=>{let e=this.job();return e!=null&&et(e)==null}),this.showJumpToCurrent=Kw(()=>{let e=this.currentStep();return e?this.viewedExecutionId()!==e.id:false}),this.eventLog=Kw(()=>this.eventStream()?.events()??this.eventsSnapshot()),this.waitingEvent=Kw(()=>{let e=this.eventLog();for(let i=e.length-1;i>=0;i-=1){let o=e[i];if(o?.type==="waiting_for_human")return o}return null}),this.destroyRef.onDestroy(()=>this.closeStream()),this.route.paramMap.pipe(xt(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(!i){this.loading.set(false),this.loadError.set(this.transloco.translate("jobs.detail.loadFailed"));return}this.load(i);}),sd(()=>{let e=this.eventStream();if(!e)return;let i=e.latest();i&&Jw(()=>{(i.type==="step_started"||i.type==="step_completed"||i.type==="step_failed"||i.type==="waiting_for_human"||i.type==="waiting_for_children"||i.type==="human_answered"||i.type==="job_completed"||i.type==="job_failed")&&this.refreshJob(i.jobId),(i.type==="job_completed"||i.type==="job_failed")&&this.closeStream();});}),sd(()=>{let e=this.currentStep();this.autoFollow()&&Jw(()=>{this.viewedExecutionId.set(e?.id??null);});});}statusKey(e){return `jobs.status.${e}`}subjectText(){return U$2(this.job()?.subjectContext)??"\u2014"}onSelectExecution(e){this.autoFollow.set(false),this.viewedExecutionId.set(e);}jumpToCurrent(){this.autoFollow.set(true),this.viewedExecutionId.set(this.currentStep()?.id??null);}setResumeText(e){this.resumeText.set(e),this.resumeParseError.set(null);}submitResume(){let e=this.job();if(!e)return;let i;try{i=JSON.parse(this.resumeText());}catch(o){this.resumeParseError.set(o instanceof Error?o.message:this.transloco.translate("jobs.resume.invalidJson"));return}this.resumeParseError.set(null),this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(e.id,i).subscribe({next:o=>{this.resuming.set(false),this.applyJob(o),G(o.status)&&this.closeStream();},error:o=>{this.resuming.set(false),this.actionError.set(this.errorMessage(o,this.transloco.translate("jobs.errors.resumeFailed")));}});}load(e){this.loading.set(true),this.loadError.set(null),this.actionError.set(null),this.autoFollow.set(true),this.viewedExecutionId.set(null),this.resumeText.set(`{
6
-
7
- }`),this.resumeParseError.set(null),this.closeStream(),this.eventsSnapshot.set([]),this.jobsApi.get(e).pipe(xt(this.destroyRef)).subscribe({next:i=>{this.workflowsApi.get(i.workflowId).subscribe({next:o=>{this.workflow.set(o),this.applyJob(i),this.loading.set(false),G(i.status)||this.eventStream.set(this.eventsService.connect({jobId:i.id}));},error:o=>{this.workflow.set(null),this.applyJob(i),this.loading.set(false),this.actionError.set(this.errorMessage(o,this.transloco.translate("jobs.detail.workflowLoadFailed"))),G(i.status)||this.eventStream.set(this.eventsService.connect({jobId:i.id}));}});},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("jobs.detail.loadFailed")));}});}applyJob(e){this.job.set(e),this.autoFollow()&&this.viewedExecutionId.set(et(e)?.id??null);}refreshJob(e){this.jobsApi.get(e).subscribe({next:i=>this.applyJob(i),error:i=>{this.actionError.set(this.errorMessage(i,this.transloco.translate("jobs.errors.refreshFailed")));}});}closeStream(){let e=this.eventStream();e&&(this.eventsSnapshot.set(e.events()),e.close(),this.eventStream.set(null));}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=JE({type:t,selectors:[["app-job-detail"]],decls:4,vars:1,consts:[["data-testid","job-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/jobs"],["data-testid","job-id"],[1,"meta"],["data-testid","job-workflow"],["data-testid","job-status"],["data-testid","job-subject"],["nz-button","","type","button","data-testid","jump-to-current"],["data-testid","action-error",1,"error"],["data-testid","queued-message","nzType","info",3,"nzMessage"],[3,"definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resumeText","resumeParseError","resuming","canResume"],["data-testid","missing-workflow",1,"muted"],["nz-button","","type","button","data-testid","jump-to-current",3,"click"],[3,"selectExecution","resumeTextChange","resumeSubmit","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resumeText","resumeParseError","resuming","canResume"]],template:function(i,o){if(i&1&&(Ni(0,"main",0),ND(1,Ae,3,3,"p",1)(2,$e,2,1,"p",2)(3,Ge,22,12),tl()),i&2){let m;vI(),xD(o.loading()?1:o.loadError()?2:(m=o.job())?3:-1,m);}},dependencies:[jn,Mt,Gn,un,Vd,Fc,y7,A7,W$1,I,pe,fc],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.error[_ngcontent-%COMP%]{color:#9f1239}.muted[_ngcontent-%COMP%]{color:#78716c}"]});}}return t})();export{Et as JobDetailComponent};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-Di_OsX8x.js';import {G as Go,K as Kw,i as ie}from'./main-JSLBK4RN.js';var f=(()=>{class e{connect(t){let n=new URLSearchParams;t?.jobId&&n.set("jobId",t.jobId),t?.batchId&&n.set("batchId",t.batchId);let r=n.toString(),p=`${a.apiBaseUrl}/events${r?`?${r}`:""}`,a$1=Go([]),b=Kw(()=>{let o=a$1();return o.length>0?o[o.length-1]:void 0}),s=new EventSource(p);return s.onmessage=o=>{let c;try{c=JSON.parse(o.data);}catch(d){return}a$1.update(d=>[...d,c]);},{events:a$1.asReadonly(),latest:b,close:()=>{s.onmessage=null,s.close();}}}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{f};
@@ -1 +0,0 @@
1
- import {U}from'./chunk-Cczqw9G5.js';import {f}from'./chunk-DHPxevqq.js';import {v as vt}from'./chunk-CPYgCVHJ.js';import {W as W$1,I}from'./chunk-Bgtkf8nM.js';import'./chunk-BvDaTl4u.js';import'./chunk-DlU8g0UO.js';import'./chunk-B8aKNL-C.js';import {C,Q as W,v as vr,a as at,G as Go,x as xt,T as sd,X as Jw,J as JE,j as jn,M as Mt,f as fc,N as Ni,p as ND,k as tl,u as vI,D as xD,h as _w,U as Uw,w as Vh,W as Ww,E as zD,o as dh,a0 as Gw,a1 as Bw,A as uh}from'./main-JSLBK4RN.js';import {U as U$1}from'./chunk-CZLubDvD.js';import {o}from'./chunk-Di_OsX8x.js';import'./chunk-B4A7hSM3.js';var z=i=>({count:i});function F(i,h){i&1&&(Ni(0,"p",1),_w(1),Uw(2,"transloco"),tl()),i&2&&(vI(),Vh(Ww(2,1,"common.loading")));}function K(i,h){if(i&1&&(Ni(0,"p",2),_w(1),tl()),i&2){let t=zD();vI(),Vh(t.loadError());}}function L(i,h){if(i&1&&(Ni(0,"header",3)(1,"div")(2,"a",4),_w(3),Uw(4,"transloco"),tl(),Ni(5,"h1",5),_w(6),tl(),Ni(7,"p",6)(8,"nz-tag",7),_w(9),Uw(10,"transloco"),tl(),Ni(11,"span",8),_w(12),tl(),_w(13," \xB7 "),Ni(14,"span",9),_w(15),Uw(16,"transloco"),tl(),_w(17," \xB7 "),Ni(18,"span",10),_w(19),Uw(20,"transloco"),tl()()()(),Ni(21,"section",11)(22,"h2"),_w(23),Uw(24,"transloco"),tl(),dh(25,"app-job-status-table",12),tl()),i&2){let t=h,e=zD();vI(3),Vh(Ww(4,8,"batches.detail.backHint")),vI(3),Vh(t.id),vI(3),Vh(Ww(10,10,e.statusKey(t.status))),vI(3),Vh(t.workflowId),vI(3),Vh(Gw(16,12,"batches.detail.subjectCount",Bw(19,z,t.resolvedSubjects.length))),vI(4),Vh(Ww(20,15,e.triggeredByKey(t.triggeredBy))),vI(4),Vh(Ww(24,17,"batches.detail.membersHeading")),vI(2),uh("jobs",e.memberJobs());}}var $=3e3;function g(i){return i!=="running"}var rt=(()=>{class i{constructor(){this.route=C(W),this.batchesApi=C(U),this.jobsApi=C(U$1),this.eventsService=C(f),this.transloco=C(vr),this.destroyRef=C(at),this.batch=Go(null),this.memberJobs=Go([]),this.loading=Go(true),this.loadError=Go(null),this.polling=Go(false),this.eventStream=Go(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(xt(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),sd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();!e||e.type!=="batch_completed"||e.batchId===this.batchId&&Jw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();});});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(xt(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),g(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),g(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||g(t.status)){this.stopPolling();return}this.refreshMembers();},$));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof o||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=JE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["data-testid","batch-members",1,"members"],[3,"jobs"]],template:function(e,p){if(e&1&&(Ni(0,"main",0),ND(1,F,3,3,"p",1)(2,K,2,1,"p",2)(3,L,26,21),tl()),e&2){let f;vI(),xD(p.loading()?1:p.loadError()?2:(f=p.batch())?3:-1,f);}},dependencies:[jn,Mt,W$1,I,vt,fc],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{rt as BatchDetailComponent};
@@ -1,5 +0,0 @@
1
- import {j}from'./chunk-CRPsjdw8.js';import {U}from'./chunk-mjUdDQQg.js';import {F as Fz,a as Fb,x as xz,I as Ie}from'./chunk-Cv76Fxhr.js';import {C,Q as W,P as ue$1,a as at,v as vr,aa as O,ab as ur,ac as Me,G as Go,K as Kw,x as xt,J as JE,j as jn,b as _o,ad as F4,g as go,F as F3,M as Mt,V as Vd,c as Fc,y as y7,Y as A7,d as Kb,q as q5,e as G5,f as fc,N as Ni,h as _w,k as tl,U as Uw,l as yh,p as ND,u as vI,w as Vh,W as Ww,A as uh,z as sl,D as xD,E as zD,H as HD,n as cE,m as kD,R as RD,B as uE,O as OD,o as dh,I as Vu,L as Hu}from'./main-JSLBK4RN.js';import'./chunk-B8aKNL-C.js';import {o}from'./chunk-Di_OsX8x.js';import'./chunk-B4A7hSM3.js';function de(t,d){t&1&&(Ni(0,"p",5),_w(1),Uw(2,"transloco"),tl()),t&2&&(vI(),Vh(Ww(2,1,"common.loading")));}function pe(t,d){if(t&1&&(Ni(0,"p",6),_w(1),tl()),t&2){let e=zD();vI(),Vh(e.loadError());}}function ce(t,d){if(t&1&&(Ni(0,"li"),_w(1),tl()),t&2){let e=d.$implicit;vI(),Vh(e);}}function me(t,d){if(t&1&&(Ni(0,"section",7)(1,"h2"),_w(2),Uw(3,"transloco"),tl(),Ni(4,"ul"),kD(5,ce,2,1,"li",null,RD),tl()()),t&2){let e=zD(2);vI(2),Vh(Ww(3,1,"views.editor.validation")),vI(3),OD(e.validationErrors());}}function ue(t,d){if(t&1&&(dh(0,"nz-option",11),Uw(1,"transloco")),t&2){let e=d.$implicit,r=zD(2);uh("nzValue",e)("nzLabel",Ww(1,2,r.subjectTypeKey(e)));}}function ge(t,d){if(t&1){let e=HD();ND(0,me,7,3,"section",7),Ni(1,"label",8)(2,"span"),_w(3),Uw(4,"transloco"),tl(),Ni(5,"input",9),yh("ngModelChange",function(i){Vu(e);let p=zD();return Hu(p.name.set(i))}),tl(),cE(),tl(),Ni(6,"div",8)(7,"span"),_w(8),Uw(9,"transloco"),tl(),Ni(10,"nz-select",10),yh("ngModelChange",function(i){Vu(e);let p=zD();return Hu(p.subjectType.set(i))}),kD(11,ue,2,4,"nz-option",11,RD),tl(),cE(),tl(),Ni(13,"label",8)(14,"span"),_w(15),Uw(16,"transloco"),tl(),Ni(17,"textarea",12),yh("ngModelChange",function(i){Vu(e);let p=zD();return Hu(p.queryText.set(i))}),tl(),cE(),Ni(18,"span",13),_w(19),Uw(20,"transloco"),tl()();}if(t&2){let e=zD();xD(e.validationErrors().length>0?0:-1),vI(3),Vh(Ww(4,8,"views.editor.name")),vI(2),uh("ngModel",e.name()),uE(),vI(3),Vh(Ww(9,10,"views.editor.subjectType")),vI(2),uh("ngModel",e.subjectType()),uE(),vI(),OD(e.subjectTypes),vI(4),Vh(Ww(16,12,"views.editor.query")),vI(2),uh("ngModel",e.queryText()),uE(),vI(2),Vh(Ww(20,14,"views.editor.queryHint"));}}function he(t){let d=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return d.length>0?`${d}-${e}`:`view-${e}`}var $e=(()=>{class t{constructor(){this.route=C(W),this.router=C(ue$1),this.viewsApi=C(U),this.message=C(Fz),this.destroyRef=C(at),this.transloco=C(vr),this.language=C(O),this.routeId=ur(this.route.paramMap.pipe(Me(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=Go(""),this.subjectType=Go("ticket"),this.queryText=Go(`{
2
-
3
- }`),this.loadError=Go(null),this.validationErrors=Go([]),this.saving=Go(false),this.loading=Go(true),this.subjectTypes=["ticket","pull_request","documentation"],this.isNew=Kw(()=>!this.routeId()),this.pageTitle=Kw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{id:this.routeId()}))),this.route.paramMap.pipe(xt(this.destroyRef)).subscribe(e=>{let r=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),!r){this.name.set(""),this.subjectType.set("ticket"),this.queryText.set(`{
4
-
5
- }`),this.loading.set(false);return}this.loading.set(true),this.viewsApi.get(r).subscribe({next:i=>{this.name.set(i.name),this.subjectType.set(i.subjectType),this.queryText.set(JSON.stringify(i.query,null,2)),this.loading.set(false);},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}save(){let e;try{e=JSON.parse(this.queryText());}catch(_){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(e===null||typeof e!="object"||Array.isArray(e)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}let r=this.routeId(),i={id:r??he(this.name()),name:this.name().trim(),subjectType:this.subjectType(),query:e},p=Fb.safeParse(i);if(!p.success){this.validationErrors.set(j(p.error));return}this.validationErrors.set([]),this.saving.set(true);let S=p.data;(this.isNew()||!r?this.viewsApi.create(S):this.viewsApi.update(r,S)).subscribe({next:_=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",_.id,"edit"]);},error:_=>{this.saving.set(false),this.message.error(this.errorMessage(_,this.transloco.translate("views.editor.saveFailed")));}});}errorMessage(e,r){return e instanceof o||e instanceof Error?e.message:r}static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=JE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/views"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-subject-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(r,i){r&1&&(Ni(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),_w(4),tl()(),Ni(5,"div",2)(6,"a",3),_w(7),Uw(8,"transloco"),tl(),Ni(9,"button",4),yh("click",function(){return i.save()}),_w(10),Uw(11,"transloco"),tl()()(),ND(12,de,3,3,"p",5)(13,pe,2,1,"p",6)(14,ge,21,16),tl()),r&2&&(vI(4),Vh(i.pageTitle()),vI(3),Vh(Ww(8,6,"views.editor.backToList")),vI(2),uh("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),vI(),sl(" ",Ww(11,8,"common.save")," "),vI(2),xD(i.loading()?12:i.loadError()?13:14));},dependencies:[jn,_o,F4,go,F3,Mt,Vd,Fc,y7,A7,xz,Ie,Kb,q5,G5,fc],styles:[".editor[_ngcontent-%COMP%]{max-width:40rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();export{$e as ViewEditorComponent};
@@ -1 +0,0 @@
1
- import {Z as q0,$ as U0,s,r,J as JE,j as jn,bT as nl,m as kD,bU as rl,u as vI,O as OD,h as _w,p as ND,z as sl,D as xD,H as HD,bV as vh,I as Vu,E as zD,L as Hu,bW as gh,a3 as lh,R as RD,a4 as Hw,w as Vh}from'./main-JSLBK4RN.js';var P=()=>[],$=(t,r)=>r.name;function S(t,r){t&1&&(nl(0,"span",1),_w(1,"*"),rl());}function O(t,r){if(t&1){let e=HD();nl(0,"input",6),vh("change",function(o){Vu(e);let a=zD().$implicit,c=zD();return Hu(c.setValue(a,o))}),rl();}if(t&2){let e=zD().$implicit,n=zD();gh("checked",n.checked(e)),lh("data-testid","input-"+e.name);}}function D(t,r){if(t&1){let e=HD();nl(0,"input",7),vh("input",function(o){Vu(e);let a=zD().$implicit,c=zD();return Hu(c.setValue(a,o))}),rl();}if(t&2){let e=zD().$implicit,n=zD();gh("value",n.displayValue(e)),lh("data-testid","input-"+e.name);}}function L(t,r){if(t&1&&(nl(0,"option",4),_w(1),rl()),t&2){let e=r.$implicit;gh("value",e),vI(),Vh(e);}}function q(t,r){if(t&1){let e=HD();nl(0,"select",8),vh("change",function(o){Vu(e);let a=zD().$implicit,c=zD();return Hu(c.setValue(a,o))}),kD(1,L,2,2,"option",4,RD),rl();}if(t&2){let e=zD().$implicit,n=zD();gh("value",n.displayValue(e)),lh("data-testid","input-"+e.name),vI(),OD(e.options??Hw(2,P));}}function N(t,r){if(t&1){let e=HD();nl(0,"input",9),vh("input",function(o){Vu(e);let a=zD().$implicit,c=zD();return Hu(c.setValue(a,o))}),rl();}if(t&2){let e=zD().$implicit,n=zD();gh("value",n.displayValue(e)),lh("data-testid","input-"+e.name);}}function B(t,r){if(t&1&&(nl(0,"label"),_w(1),ND(2,S,2,0,"span",1),ND(3,O,1,2,"input",2)(4,D,1,2,"input",3)(5,q,3,3,"select",4)(6,N,1,2,"input",5),rl()),t&2){let e,n=r.$implicit;vI(),sl(" ",n.label," "),vI(),xD(n.required?2:-1),vI(),xD((e=n.type)==="boolean"?3:e==="number"?4:e==="select"?5:6);}}function z(t){if(t.defaultValue!==void 0)return t.defaultValue;switch(t.type){case "boolean":return false;case "number":return "";case "select":return t.options?.[0]??"";default:return ""}}function J(t){let r={};for(let e of t)r[e.name]=z(e);return r}var K=(()=>{class t{constructor(){this.fields=q0([]),this.values=q0({}),this.valuesChange=U0();}displayValue(e){let n=this.values()[e.name];return n==null?"":String(n)}checked(e){return !!this.values()[e.name]}setValue(e,n){let o=n.target,a=o.value;e.type==="boolean"?a=o.checked:e.type==="number"&&(a=o.value===""?"":Number(o.value)),this.valuesChange.emit(s(r({},this.values()),{[e.name]:a}));}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=JE({type:t,selectors:[["app-workflow-input-form"]],inputs:{fields:[1,"fields"],values:[1,"values"]},outputs:{valuesChange:"valuesChange"},decls:3,vars:0,consts:[["data-testid","workflow-input-form",1,"input-form"],[1,"required"],["type","checkbox",3,"checked"],["type","number",3,"value"],[3,"value"],["type","text",3,"value"],["type","checkbox",3,"change","checked"],["type","number",3,"input","value"],[3,"change","value"],["type","text",3,"input","value"]],template:function(n,o){n&1&&(nl(0,"div",0),kD(1,B,7,3,"label",null,$),rl()),n&2&&(vI(),OD(o.fields()));},dependencies:[jn],styles:["label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}input[type=checkbox][_ngcontent-%COMP%]{width:1.1rem;height:1.1rem}.required[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{J,K};
@@ -1 +0,0 @@
1
- import {a7 as ss,d7 as X,d8 as Vg}from'./main-JSLBK4RN.js';var o=class extends Error{constructor(t,i){super(i),this.httpStatus=t,this.name="ApiError";}};var a={apiBaseUrl:"/api"};function p(r,t){return r&&typeof r=="object"&&"error"in r&&typeof r.error=="string"?r.error:t}function E(){return r=>r.pipe(ss(t=>t instanceof X?Vg(()=>new o(t.status,p(t.error,t.message||`HTTP ${t.status}`))):Vg(()=>t)))}export{E,a,o};
@@ -1 +0,0 @@
1
- import {af as eD,ag as hu,C,cc as oe$1,al as Nr,bD as Z0,an as m3,ao as Ie,a as at,cr as A,ap as Oa,aZ as Fe$1,T as sd,x as xt,cd as Vt,J as JE,b as _o,cL as Rr,g as go,F as F3,ai as K0,aE as ZD,N as Ni,l as yh,k as tl,n as cE,o as dh,aV as YD,a2 as Nh,u as vI,A as uh,a3 as lh,B as uE,aH as Vw,aI as d1,aK as bo,bh as Dh,bi as JD,bj as XD,Z as q0,G as Go,at as eT,K as Kw,ay as ep,X as Jw,m as kD,E as zD,O as OD,h as _w,z as sl}from'./main-JSLBK4RN.js';var re=["inputElement"],te=["*"],ae=(t,s)=>s.value;function ce(t,s){if(t&1&&(Ni(0,"label",0),_w(1),tl()),t&2){let e=s.$implicit,i=zD(2);uh("nzValue",e.value)("nzName",i.nzName())("nzDisabled",e.disabled||i.finalDisabled()),vI(),sl(" ",e.label," ");}}function le(t,s){if(t&1&&kD(0,ce,2,4,"label",0,ae),t&2){let e=zD();OD(e.normalizedOptions());}}var ie=new A(""),oe=(()=>{class t{ngZone=C(oe$1);elementRef=C(Nr);cdr=C(Z0);focusMonitor=C(m3);dir=C(Ie).valueSignal;destroyRef=C(at);checkboxGroupComponent=C(ie,{optional:true});nzFormStatusService=C(Oa,{optional:true});isNzDisableFirstChange=true;onChange=()=>{};onTouched=()=>{};inputElement;nzCheckedChange=new Fe$1;nzValue=null;nzAutoFocus=false;nzDisabled=false;nzIndeterminate=false;nzChecked=false;nzId=null;nzName=null;innerCheckedChange(e){!this.nzDisabled&&!this.checkboxGroupComponent?.finalDisabled()&&(this.setValue(e),this.checkboxGroupComponent?.onCheckedChange(this.nzValue,e));}writeValue(e){this.nzChecked=e,this.cdr.markForCheck();}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||e,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}focus(){this.focusMonitor.focusVia(this.inputElement,"keyboard");}blur(){this.inputElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.elementRef);}),this.checkboxGroupComponent&&sd(()=>{let e=this.checkboxGroupComponent.value()||[];this.setValue(e.includes(this.nzValue)),this.cdr.markForCheck();});}ngOnInit(){this.focusMonitor.monitor(this.elementRef,true).pipe(xt(this.destroyRef)).subscribe(e=>{e||Promise.resolve().then(()=>this.onTouched());}),Vt(this.elementRef.nativeElement,"click").pipe(xt(this.destroyRef)).subscribe(e=>{e.preventDefault(),this.focus(),!this.nzDisabled&&this.ngZone.run(()=>{this.innerCheckedChange(!this.nzChecked),this.cdr.markForCheck();});}),Vt(this.inputElement.nativeElement,"click").pipe(xt(this.destroyRef)).subscribe(e=>e.stopPropagation());}ngAfterViewInit(){this.nzAutoFocus&&this.focus();}setValue(e){this.nzChecked=e,this.onChange(e),this.nzCheckedChange.emit(e);}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=JE({type:t,selectors:[["","nz-checkbox",""]],viewQuery:function(i,n){if(i&1&&Dh(re,7),i&2){let r;JD(r=XD())&&(n.inputElement=r.first);}},hostAttrs:[1,"ant-checkbox-wrapper"],hostVars:10,hostBindings:function(i,n){i&2&&Nh("ant-checkbox-group-item",!!n.checkboxGroupComponent)("ant-checkbox-wrapper-in-form-item",!!n.nzFormStatusService)("ant-checkbox-wrapper-checked",n.nzChecked)("ant-checkbox-wrapper-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-rtl",n.dir()==="rtl");},inputs:{nzValue:"nzValue",nzAutoFocus:[2,"nzAutoFocus","nzAutoFocus",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzIndeterminate:[2,"nzIndeterminate","nzIndeterminate",K0],nzChecked:[2,"nzChecked","nzChecked",K0],nzId:"nzId",nzName:"nzName"},outputs:{nzCheckedChange:"nzCheckedChange"},exportAs:["nzCheckbox"],features:[Vw([{provide:d1,useExisting:bo(()=>t),multi:true}])],ngContentSelectors:te,decls:6,vars:12,consts:[["inputElement",""],[1,"ant-checkbox"],["type","checkbox",1,"ant-checkbox-input",3,"ngModelChange","checked","ngModel","disabled"],[1,"ant-checkbox-inner"]],template:function(i,n){i&1&&(ZD(),Ni(0,"span",1)(1,"input",2,0),yh("ngModelChange",function(se){return n.innerCheckedChange(se)}),tl(),cE(),dh(3,"span",3),tl(),Ni(4,"span"),YD(5),tl()),i&2&&(Nh("ant-checkbox-checked",n.nzChecked&&!n.nzIndeterminate)("ant-checkbox-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-indeterminate",n.nzIndeterminate),vI(),uh("checked",n.nzChecked)("ngModel",n.nzChecked)("disabled",n.nzDisabled||(n.checkboxGroupComponent?.finalDisabled()??false)),lh("autofocus",n.nzAutoFocus?"autofocus":null)("id",n.nzId)("name",n.nzName||n.checkboxGroupComponent?.nzName()),uE());},dependencies:[_o,Rr,go,F3],encapsulation:2})}return t})(),ue=(()=>{class t{onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;dir=C(Ie).valueSignal;nzName=q0(null);nzDisabled=q0(false,{transform:K0});nzOptions=q0([]);value=Go(null);finalDisabled=eT(()=>this.nzDisabled());normalizedOptions=Kw(()=>de(this.nzOptions()));constructor(){let e=C(Nr),i=C(m3),n=C(at);ep(()=>{i.monitor(e,true).pipe(xt(n)).subscribe(r=>{r||this.onTouched();}),n.onDestroy(()=>{i.stopMonitoring(e);});});}writeValue(e){Jw(()=>{this.value.set(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Jw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}onCheckedChange(e,i){this.finalDisabled()||(this.value.update(n=>i?n?.concat(e)||[e]:n?.filter(r=>r!==e)||[]),this.onChange(this.value()));}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=JE({type:t,selectors:[["nz-checkbox-group"]],hostAttrs:[1,"ant-checkbox-group"],hostVars:2,hostBindings:function(i,n){i&2&&Nh("ant-checkbox-group-rtl",n.dir()==="rtl");},inputs:{nzName:[1,"nzName"],nzDisabled:[1,"nzDisabled"],nzOptions:[1,"nzOptions"]},exportAs:["nzCheckboxGroup"],features:[Vw([{provide:d1,useExisting:bo(()=>t),multi:true},{provide:ie,useExisting:bo(()=>t)}])],ngContentSelectors:te,decls:2,vars:0,consts:[["nz-checkbox","",3,"nzValue","nzName","nzDisabled"]],template:function(i,n){i&1&&(ZD(),YD(0,0,null,le,2,0));},dependencies:[oe],encapsulation:2})}return t})();function de(t){return t.map(s=>typeof s=="string"||typeof s=="number"?{label:`${s}`,value:s}:s)}var Fe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=eD({type:t});static \u0275inj=hu({imports:[oe,ue]})}return t})();export{Fe as F,oe as o};
@@ -1 +0,0 @@
1
- import {af as eD,ag as hu,aX as dC,C,bD as Z0,d4 as Zm,ao as Ie,aY as fC,aZ as Fe,b$ as Tt,J as JE,aA as vt,aB as ke,bd as Pt,be as Ne,bc as d4,bC as fy,ai as K0,p as ND,D as xD,bk as pt,H as HD,N as Ni,cK as oc,k as tl,E as zD,a2 as Nh,A as uh,u as vI,aF as oh,l as yh,o as dh,bL as ol,h as _w,bM as il,w as Vh,I as Vu,L as Hu,cq as hh}from'./main-JSLBK4RN.js';function X(n,i){n&1&&hh(0);}function $(n,i){if(n&1&&oh(0,X,1,0,"ng-container",7),n&2){let e=zD(3);uh("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&dh(0,"nz-icon",6),n&2){let e=zD(3);uh("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(Ni(0,"div",2),ND(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),tl()),n&2){let e=zD(2);vI(),xD(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(ol(0),_w(1),il()),n&2){let e=zD(4);vI(),Vh(e.nzMessage);}}function on(n,i){if(n&1&&(Ni(0,"span",8),oh(1,tn,2,1,"ng-container",7),tl()),n&2){let e=zD(3);vI(),uh("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(ol(0),_w(1),il()),n&2){let e=zD(4);vI(),Vh(e.nzDescription);}}function rn(n,i){if(n&1&&(Ni(0,"span",9),oh(1,an,2,1,"ng-container",7),tl()),n&2){let e=zD(3);vI(),uh("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(Ni(0,"div",3),ND(1,on,2,1,"span",8),ND(2,rn,2,1,"span",9),tl()),n&2){let e=zD(2);vI(),xD(e.nzMessage?1:-1),vI(),xD(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(ol(0),_w(1),il()),n&2){let e=zD(3);vI(),Vh(e.nzAction);}}function sn(n,i){if(n&1&&(Ni(0,"div",4),oh(1,cn,2,1,"ng-container",7),tl()),n&2){let e=zD(2);vI(),uh("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(ol(0),Ni(1,"span",12),_w(2),tl(),il()),n&2){let e=zD(4);vI(2),Vh(e.nzCloseText);}}function mn(n,i){if(n&1&&oh(0,dn,3,1,"ng-container",7),n&2){let e=zD(3);uh("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&dh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=HD();Ni(0,"button",10),yh("click",function(){Vu(e);let z=zD(2);return Hu(z.closeAlert())}),ND(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),tl();}if(n&2){let e=zD(2);vI(),xD(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=HD();Ni(0,"div",1),oc(function(z){Vu(e);let T=zD();return Hu(T.onLeaveAnimationDone(z))}),ND(1,en,3,1,"div",2),ND(2,ln,3,2,"div",3),ND(3,sn,2,1,"div",4),ND(4,_n,3,1,"button",5),tl();}if(n&2){let e=zD();Nh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),uh("nzNoAnimation",e.nzNoAnimation),vI(),xD(e.nzShowIcon?1:-1),vI(),xD(e.nzMessage||e.nzDescription?2:-1),vI(),xD(e.nzAction?3:-1),vI(),xD(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[pt()],_=[pt()],dC(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),dC(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(Z0);animationType=C(Zm,{optional:true});dir=C(Ie).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=fC(this,i,false);nzShowIcon=(fC(this,e),fC(this,z,false));nzBanner=(fC(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Fe;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){Tt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=JE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",K0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",K0],nzBanner:[2,"nzBanner","nzBanner",K0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",K0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[fy],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&ND(0,zn,5,23,"div",0),t&2&&xD(l.closed?-1:0);},dependencies:[vt,ke,Pt,Ne,d4],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=eD({type:n});static \u0275inj=hu({imports:[un]})}return n})();export{Gn as G,un as u};
@@ -1 +0,0 @@
1
- import {u,t}from'./chunk-B5hULR_G.js';import {U}from'./chunk-mjUdDQQg.js';import {J,K}from'./chunk-Di8Mt9Sl.js';import {G as Gn,u as un}from'./chunk-DpU7iV6a.js';import {U as U$1}from'./chunk-DLA1DsR_.js';import {U as U$2}from'./chunk-Cczqw9G5.js';import {O as Od,Q as Ql,x as xd,$ as $l,R as Rl,M as Md,V as Vi,j as jl,a as Vl}from'./chunk-BvDaTl4u.js';import'./chunk-DlU8g0UO.js';import'./chunk-B8aKNL-C.js';import {C,Q as W$1,v as vr,a as at,G as Go,K as Kw,x as xt,r,a6 as Rg,J as JE,j as jn,b as _o,g as go,F as F3,M as Mt,V as Vd,c as Fc,y as y7,Y as A7,d as Kb,q as q5,e as G5,f as fc,N as Ni,p as ND,k as tl,u as vI,D as xD,h as _w,U as Uw,w as Vh,W as Ww,E as zD,H as HD,l as yh,A as uh,a1 as Bw,z as sl,a0 as Gw,m as kD,n as cE,B as uE,O as OD,o as dh,a3 as lh,bS as $w,I as Vu,L as Hu}from'./main-JSLBK4RN.js';import {o}from'./chunk-Di_OsX8x.js';import'./chunk-B4A7hSM3.js';var xe=i=>["/views",i,"edit"],be=i=>({count:i}),Me=i=>["/batches",i],ze=(i,r)=>({workflowId:i,subjectId:r}),W=(i,r)=>r.id;function ye(i,r){i&1&&(Ni(0,"p",1),_w(1),Uw(2,"transloco"),tl()),i&2&&(vI(),Vh(Ww(2,1,"common.loading")));}function Ve(i,r){if(i&1&&(Ni(0,"p",2),_w(1),tl()),i&2){let e=zD();vI(),Vh(e.loadError());}}function Ie(i,r){if(i&1&&dh(0,"nz-option",17),i&2){let e=r.$implicit;uh("nzValue",e.id)("nzLabel",e.name);}}function Se(i,r){if(i&1){let e=HD();Ni(0,"div",12)(1,"span"),_w(2),Uw(3,"transloco"),tl(),Ni(4,"nz-select",16),yh("ngModelChange",function(o){Vu(e);let c=zD(2);return Hu(c.rowStartWorkflowId.set(o))}),kD(5,Ie,1,2,"nz-option",17,W),tl(),cE(),tl();}if(i&2){let e=zD(2);vI(2),Vh(Ww(3,2,"views.detail.rowStartWorkflow")),vI(2),uh("ngModel",e.rowStartWorkflowId()),uE(),vI(),OD(e.singleWorkflows());}}function De(i,r){i&1&&(Ni(0,"a",19),_w(1),Uw(2,"transloco"),tl()),i&2&&(uh("routerLink",Bw(4,Me,r)),vI(),sl(" ",Ww(2,2,"views.detail.openBatch")," "));}function Te(i,r){if(i&1&&(dh(0,"nz-alert",18),ND(1,De,3,6,"a",19)),i&2){let e,t=zD(2);uh("nzMessage",t.confirmation()),vI(),xD((e=t.confirmationBatchId())?1:-1,e);}}function Ee(i,r){i&1&&(Ni(0,"p",20),_w(1),Uw(2,"transloco"),tl()),i&2&&(vI(),sl(" ",Ww(2,1,"views.detail.noBulkWorkflows")," "));}function Be(i,r){if(i&1&&dh(0,"nz-option",17),i&2){let e=r.$implicit;uh("nzValue",e.id)("nzLabel",e.name+" ("+e.cardinality+")");}}function Ne(i,r){if(i&1){let e=HD();Ni(0,"app-workflow-input-form",27),yh("valuesChange",function(o){Vu(e);let c=zD(4);return Hu(c.setInputValues(o))}),tl();}if(i&2){let e=zD(4);uh("fields",r.inputSchema)("values",e.inputValues());}}function We(i,r){if(i&1&&(Ni(0,"p",23),_w(1),tl()),i&2){let e=zD(4);vI(),Vh(e.launchError());}}function je(i,r){if(i&1){let e=HD();Ni(0,"div",12)(1,"span"),_w(2),Uw(3,"transloco"),tl(),Ni(4,"nz-select",21),yh("ngModelChange",function(o){Vu(e);let c=zD(3);return Hu(c.onBulkWorkflowChange(o))}),kD(5,Be,1,2,"nz-option",17,W),tl(),cE(),tl(),ND(7,Ne,1,2,"app-workflow-input-form",22),ND(8,We,2,1,"p",23),Ni(9,"div",24)(10,"button",25),yh("click",function(){Vu(e);let o=zD(3);return Hu(o.launch())}),_w(11),Uw(12,"transloco"),tl(),Ni(13,"button",26),yh("click",function(){Vu(e);let o=zD(3);return Hu(o.cancelLaunch())}),_w(14),Uw(15,"transloco"),tl()();}if(i&2){let e,t=zD(3);vI(2),Vh(Ww(3,8,"views.detail.selectWorkflow")),vI(2),uh("ngModel",t.selectedBulkWorkflowId()),uE(),vI(),OD(t.bulkWorkflows()),vI(2),xD((e=t.selectedBulkWorkflow())?7:-1,e),vI(),xD(t.launchError()?8:-1),vI(2),uh("nzLoading",t.launching())("disabled",!t.selectedBulkWorkflow()||t.launching()),vI(),sl(" ",Ww(12,10,t.launching()?"views.detail.launching":"views.detail.launch")," "),vI(3),sl(" ",Ww(15,12,"views.detail.cancelLaunch")," ");}}function Pe(i,r){if(i&1&&(Ni(0,"section",13)(1,"h2"),_w(2),Uw(3,"transloco"),tl(),ND(4,Ee,3,3,"p",20)(5,je,16,14),tl()),i&2){let e=zD(2);vI(2),sl(" ",Ww(3,2,r==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),vI(2),xD(e.bulkWorkflows().length===0?4:5);}}function Oe(i,r){i&1&&(Ni(0,"p",14),_w(1),Uw(2,"transloco"),tl()),i&2&&(vI(),Vh(Ww(2,1,"views.detail.emptySubjects")));}function Fe(i,r){if(i&1&&(Ni(0,"a",31),_w(1),Uw(2,"transloco"),tl()),i&2){let e=zD().$implicit,t=zD(3);uh("queryParams",$w(5,ze,t.rowStartWorkflowId(),e.id)),lh("data-testid","start-"+e.id),vI(),sl(" ",Ww(2,3,"views.detail.start")," ");}}function Le(i,r){if(i&1){let e=HD();Ni(0,"tr")(1,"td",29),yh("nzCheckedChange",function(o){let c=Vu(e).$implicit,x=zD(3);return Hu(x.onItemChecked(c.id,o))}),tl(),Ni(2,"td")(3,"span"),_w(4),tl()(),Ni(5,"td")(6,"span"),_w(7),tl()(),Ni(8,"td")(9,"span"),_w(10),tl()(),Ni(11,"td",30),ND(12,Fe,3,8,"a",31),tl()();}if(i&2){let e=r.$implicit,t=zD(3);lh("data-testid","subject-"+e.id),vI(),uh("nzChecked",t.checkedIds().has(e.id)),vI(2),lh("data-testid","subject-id-"+e.id),vI(),Vh(e.id),vI(2),lh("data-testid","subject-title-"+e.id),vI(),Vh(e.title),vI(2),lh("data-testid","subject-details-"+e.id),vI(),Vh(t.subjectDetails(e)),vI(2),xD(t.singleWorkflows().length>0?12:-1);}}function Ae(i,r){if(i&1){let e=HD();Ni(0,"nz-table",15)(1,"thead")(2,"tr")(3,"th",28),yh("nzCheckedChange",function(o){Vu(e);let c=zD(2);return Hu(c.onAllChecked(o))}),tl(),Ni(4,"th"),_w(5),Uw(6,"transloco"),tl(),Ni(7,"th"),_w(8),Uw(9,"transloco"),tl(),Ni(10,"th"),_w(11),Uw(12,"transloco"),tl(),Ni(13,"th"),_w(14),Uw(15,"transloco"),tl()()(),Ni(16,"tbody"),kD(17,Le,13,9,"tr",null,W),tl()();}if(i&2){let e=zD(2);uh("nzData",e.subjects())("nzFrontPagination",false)("nzShowPagination",false),vI(3),uh("nzChecked",e.allChecked())("nzIndeterminate",e.someChecked()),vI(2),Vh(Ww(6,9,"views.detail.column.id")),vI(3),Vh(Ww(9,11,"views.detail.column.title")),vI(3),Vh(Ww(12,13,"views.detail.column.details")),vI(3),Vh(Ww(15,15,"views.detail.column.actions")),vI(3),OD(e.subjects());}}function $e(i,r){if(i&1){let e=HD();Ni(0,"header",3)(1,"div")(2,"a",4),_w(3),Uw(4,"transloco"),tl(),Ni(5,"h1",5),_w(6),tl(),Ni(7,"p",6)(8,"span",7),_w(9),Uw(10,"transloco"),tl()()(),Ni(11,"a",8),_w(12),Uw(13,"transloco"),tl()(),Ni(14,"section",9)(15,"button",10),yh("click",function(){Vu(e);let o=zD();return Hu(o.beginLaunch("view"))}),_w(16),Uw(17,"transloco"),tl(),Ni(18,"button",11),yh("click",function(){Vu(e);let o=zD();return Hu(o.beginLaunch("manual"))}),_w(19),Uw(20,"transloco"),tl(),ND(21,Se,7,4,"div",12),tl(),ND(22,Te,2,2),ND(23,Pe,6,4,"section",13),ND(24,Oe,3,3,"p",14)(25,Ae,19,17,"nz-table",15);}if(i&2){let e,t=r,o=zD();vI(3),Vh(Ww(4,12,"views.detail.backToList")),vI(3),Vh(t.name),vI(3),Vh(Ww(10,14,o.subjectTypeKey(t.subjectType))),vI(2),uh("routerLink",Bw(23,xe,t.id)),vI(),sl(" ",Ww(13,16,"views.detail.edit")," "),vI(4),sl(" ",Ww(17,18,"views.detail.runOnAll")," "),vI(2),uh("disabled",o.checkedCount()===0),vI(),sl(" ",Gw(20,20,"views.detail.runSelected",Bw(25,be,o.checkedCount()))," "),vI(2),xD(o.singleWorkflows().length>0?21:-1),vI(),xD(o.confirmation()?22:-1),vI(),xD((e=o.launchMode())?23:-1,e),vI(),xD(o.subjects().length===0?24:25);}}var ht=(()=>{class i{constructor(){this.route=C(W$1),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.batchesApi=C(U$2),this.transloco=C(vr),this.destroyRef=C(at),this.view=Go(null),this.subjects=Go([]),this.workflows=Go([]),this.loading=Go(true),this.loadError=Go(null),this.checkedIds=Go(new Set),this.launchMode=Go(null),this.selectedBulkWorkflowId=Go(""),this.inputValues=Go({}),this.launching=Go(false),this.launchError=Go(null),this.confirmation=Go(null),this.confirmationBatchId=Go(null),this.rowStartWorkflowId=Go(""),this.checkedCount=Kw(()=>this.checkedIds().size),this.allChecked=Kw(()=>{let e=this.subjects();return e.length>0&&e.every(t=>this.checkedIds().has(t.id))}),this.someChecked=Kw(()=>{let e=this.checkedCount();return e>0&&e<this.subjects().length}),this.bulkWorkflows=Kw(()=>{let e=this.view();return e?this.workflows().filter(t$1=>u(t$1.cardinality)&&t(t$1,e.subjectType)):[]}),this.singleWorkflows=Kw(()=>{let e=this.view();return e?this.workflows().filter(t$1=>t$1.cardinality==="single"&&t(t$1,e.subjectType)):[]}),this.selectedBulkWorkflow=Kw(()=>this.bulkWorkflows().find(e=>e.id===this.selectedBulkWorkflowId())??null),this.route.paramMap.pipe(xt(this.destroyRef)).subscribe(e=>{let t=e.get("id");if(!t){this.loading.set(false),this.loadError.set(this.transloco.translate("views.detail.loadFailed"));return}this.load(t);});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}subjectDetails(e){if(e.subjectType==="ticket")return [e.status,e.assignee].filter(Boolean).join(" \xB7 ");if(e.subjectType==="pull_request"){let t=`${e.sourceBranch} \u2192 ${e.targetBranch}`;return e.author?`${e.author} \xB7 ${t}`:t}return e.url??""}onItemChecked(e,t){this.checkedIds.update(o=>{let c=new Set(o);return t?c.add(e):c.delete(e),c});}onAllChecked(e){this.checkedIds.set(e?new Set(this.subjects().map(t=>t.id)):new Set);}beginLaunch(e){if(e==="manual"&&this.checkedCount()===0)return;this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(e);let t=this.bulkWorkflows()[0];this.selectBulkWorkflow(t?.id??"");}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}selectBulkWorkflow(e){this.selectedBulkWorkflowId.set(e);let t=this.bulkWorkflows().find(o=>o.id===e);this.inputValues.set(J(t?.inputSchema??[]));}onBulkWorkflowChange(e){this.selectBulkWorkflow(e);}setInputValues(e){this.inputValues.set(e);}launch(){let e=this.view(),t=this.selectedBulkWorkflow(),o=this.launchMode();if(!e||!t||!o)return;let c=o==="view"?{mode:"view",viewId:e.id}:{mode:"manual",subjectType:e.subjectType,subjectIds:[...this.checkedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:t.id,selection:c,triggeredBy:o==="view"?"view_bulk":"multiselect",inputValues:r({},this.inputValues())}).pipe(xt(this.destroyRef)).subscribe({next:x=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(x)),this.confirmationBatchId.set(x.kind==="batch"?x.batch.id:null),this.launchMode.set(null);},error:x=>{this.launching.set(false),this.launchError.set(this.errorMessage(x,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(e){return e.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:e.batch.id,count:e.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:e.job.id})}load(e){this.loading.set(true),this.loadError.set(null),this.checkedIds.set(new Set),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Rg({view:this.viewsApi.get(e),subjects:this.viewsApi.getSubjects(e),workflows:this.workflowsApi.list()}).pipe(xt(this.destroyRef)).subscribe({next:({view:t$1,subjects:o,workflows:c})=>{this.view.set(t$1),this.subjects.set(o),this.workflows.set(c);let x=c.find(j=>j.cardinality==="single"&&t(j,t$1.subjectType));this.rowStartWorkflowId.set(x?.id??""),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("views.detail.loadFailed")));}});}errorMessage(e,t){return e instanceof o||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=JE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","view-name"],[1,"meta"],["data-testid","view-subject-type"],["nz-button","","data-testid","edit-view",3,"routerLink"],[1,"toolbar"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click"],["nz-button","","type","button","data-testid","run-selected",3,"click","disabled"],[1,"field"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],["data-testid","subject-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","row-start-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","bulk-workflow-select",3,"ngModelChange","ngModel"],[3,"fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"valuesChange","fields","values"],[3,"nzCheckedChange","nzChecked","nzIndeterminate"],[3,"nzCheckedChange","nzChecked"],[1,"actions"],["nz-button","","nzType","link","routerLink","/jobs/new",3,"queryParams"]],template:function(t,o){if(t&1&&(Ni(0,"main",0),ND(1,ye,3,3,"p",1)(2,Ve,2,1,"p",2)(3,$e,26,27),tl()),t&2){let c;vI(),xD(o.loading()?1:o.loadError()?2:(c=o.view())?3:-1,c);}},dependencies:[jn,_o,go,F3,Mt,Gn,un,Vd,Fc,y7,A7,Kb,q5,G5,Od,Ql,xd,$l,Rl,Md,Vi,jl,Vl,K,fc],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0}.meta[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{ht as ViewDetailComponent};
@@ -1 +0,0 @@
1
- import {u}from'./chunk-B4A7hSM3.js';import {a,E}from'./chunk-Di_OsX8x.js';import {C,a9 as or,i as ie}from'./main-JSLBK4RN.js';var U=(()=>{class r{constructor(){this.http=C(or),this.baseUrl=`${a.apiBaseUrl}/views`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}getSubjects(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/subjects`).pipe(E())}create(t){return this.http.post(this.baseUrl,t).pipe(E())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(E())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};