@knoflows/engine 0.1.0-alpha.7 → 0.1.0-alpha.8
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/README.md +1 -1
- package/dist/engine.js +18 -17
- package/package.json +8 -4
- package/static/assets/i18n/en.json +102 -5
- package/static/assets/i18n/es.json +102 -5
- package/static/{chunk-E9Klh0DL.js → chunk-BEvII7Hn.js} +1 -1
- package/static/chunk-BIFLxIMS.js +66 -0
- package/static/chunk-BQgEbMSp.js +1 -0
- package/static/{chunk-BiwCj5Ed.js → chunk-BYIP8zBR.js} +1 -1
- package/static/chunk-BiLgez1m.js +1 -0
- package/static/chunk-BnnoOI-1.js +1 -0
- package/static/chunk-BrJS_1Y1.js +1 -0
- package/static/chunk-CB7iIlL9.js +1 -0
- package/static/chunk-CL0Sh0Qb.js +1 -0
- package/static/chunk-CNj32s8G.js +1 -0
- package/static/chunk-CQ708Y6F.js +1 -0
- package/static/chunk-CoKTfrti.js +1 -0
- package/static/{chunk-CxrhCycA.js → chunk-Cuaj1Fgz.js} +1 -1
- package/static/{chunk-D7ecsHWV.js → chunk-CxgNB2C8.js} +1 -1
- package/static/chunk-DO1B2M6l.js +1 -0
- package/static/chunk-DTLDtzu5.js +1 -0
- package/static/chunk-Dc_LNQ-q.js +1 -0
- package/static/chunk-DflfYru0.js +1 -0
- package/static/{chunk-C9TOy_jn.js → chunk-DjiFAEo3.js} +1 -1
- package/static/{chunk--huWzdqj.js → chunk-Dqtz3Iow.js} +1 -1
- package/static/chunk-DrlNmyyx.js +7 -0
- package/static/chunk-G2CzeazF.js +1 -0
- package/static/chunk-He--f9Sf.js +1 -0
- package/static/chunk-JcYd5MYJ.js +5 -0
- package/static/chunk-MRIst_Tv.js +1 -0
- package/static/{chunk-GrrV0ukn.js → chunk-Xv2Lx0k9.js} +1 -1
- package/static/{chunk-DjcxfmKB.js → chunk-bi3jOaJV.js} +1 -1
- package/static/chunk-fPx6gQSM.js +1 -0
- package/static/chunk-g1iNEPSG.js +1 -0
- package/static/chunk-mmWflnUN.js +1 -0
- package/static/index.html +2 -2
- package/static/main-R7YQQZVK.js +249 -0
- package/static/chunk-164-t-LC.js +0 -1
- package/static/chunk-B2oijRKi.js +0 -1
- package/static/chunk-BMOj-ctp.js +0 -1
- package/static/chunk-B_0vwfJH.js +0 -1
- package/static/chunk-Ba2Pk3ZV.js +0 -1
- package/static/chunk-BgxH8sDB.js +0 -1
- package/static/chunk-CIADdbUP.js +0 -1
- package/static/chunk-CfZWJKlu.js +0 -1
- package/static/chunk-Cg4mENZa.js +0 -1
- package/static/chunk-Cv5pNW9n.js +0 -1
- package/static/chunk-CzSFfhcS.js +0 -7
- package/static/chunk-D5kutWaL.js +0 -66
- package/static/chunk-DZV_xppV.js +0 -1
- package/static/chunk-DaPHlPte.js +0 -1
- package/static/chunk-DeFJOu7x.js +0 -1
- package/static/chunk-DkKxPJBS.js +0 -1
- package/static/chunk-DnSW_i5C.js +0 -5
- package/static/chunk-Dnos4vY0.js +0 -1
- package/static/chunk-M0pfvgRb.js +0 -1
- package/static/chunk-PG4bRDhM.js +0 -1
- package/static/chunk-dMfVmcfD.js +0 -1
- package/static/main-6LDEPJ3H.js +0 -249
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {Q as QE,ac as Lr,L as Ln,ad as Mu,K as Kt,f as _i,N as ND,g as Kc,l as lh,p as gI,A as xD,v as vw,R as Rw,x as ch,a3 as xw,a6 as Nw,a5 as ah,w as nl,O as Ow}from'./main-R7YQQZVK.js';var k=e=>["/manage",e],O=()=>({exact:true}),w=(e,o)=>o.path;function P(e,o){if(e&1&&(_i(0,"a",2),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=o.$implicit;ch("routerLink",xw(6,k,t.path))("routerLinkActiveOptions",Nw(8,O)),ah("data-testid","manage-tab-"+t.path),gI(),nl(" ",Ow(2,4,t.labelKey)," ");}}var A=[{path:"workflows",labelKey:"manage.tab.workflows"},{path:"views",labelKey:"manage.tab.views"},{path:"providers",labelKey:"manage.tab.providers"},{path:"preferences",labelKey:"manage.tab.preferences"}],T=(()=>{class e{constructor(){this.tabs=A;}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-manage-shell"]],decls:5,vars:0,consts:[["data-testid","manage-shell",1,"manage-shell"],["data-testid","manage-tabs","role","tablist",1,"manage-tabs"],["role","tab","routerLinkActive","active",3,"routerLink","routerLinkActiveOptions"]],template:function(n,y){n&1&&(_i(0,"section",0)(1,"nav",1),ND(2,P,3,9,"a",2,w),Kc(),lh(4,"router-outlet"),Kc()),n&2&&(gI(2),xD(y.tabs));},dependencies:[Lr,Ln,Mu,Kt],styles:[".manage-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%}.manage-tabs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.25rem;padding:.5rem 1.5rem 0;border-bottom:1px solid #d6d3d1;background:#ffffffb3}.manage-tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:.65rem .9rem;color:#57534e;text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}.manage-tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#1c1917}.manage-tabs[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:#1c1917;font-weight:600;border-bottom-color:#1c1917}"]});}}return e})();export{A as MANAGE_TABS,T as ManageShellComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {A as Ad,H as Hl,$ as $d,a as Al,c as $l,V as Vd,b as Ai,X as Xl,B as Bl}from'./chunk-g1iNEPSG.js';import {a0 as $0,a1 as B0,q as qo,H as Hw,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,Z as y7,K as Kt,f as _i,m as bD,v as vw,R as Rw,g as Kc,N as ND,p as gI,B as _D,x as ch,P as Ph,O as Ow,A as xD,F as LD,h as gh,E as VD,w as nl,a2 as Pw,a3 as xw,a5 as ah,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var Q=t=>({count:t}),U=t=>["/jobs",t],X=(t,c)=>c.id;function Y(t,c){if(t&1){let e=LD();_i(0,"div",1)(1,"button",4),gh("click",function(){Pu(e);let o=VD();return Lu(o.emitBulk())}),vw(2),Rw(3,"transloco"),Kc()();}if(t&2){let e=VD();gI(),ch("disabled",e.checkedCount()===0),gI(),nl(" ",Pw(3,2,"runnableTable.runSelected",xw(5,Q,e.checkedCount()))," ");}}function Z(t,c){if(t&1){let e=LD();_i(0,"th",5),gh("nzCheckedChange",function(o){Pu(e);let s=VD();return Lu(s.onAllChecked(o))}),Kc();}if(t&2){let e=VD();ch("nzChecked",e.allChecked())("nzIndeterminate",e.someChecked());}}function ee(t,c){t&1&&(_i(0,"th"),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"runnableTable.column.actions")));}function te(t,c){if(t&1){let e=LD();_i(0,"td",12),gh("nzCheckedChange",function(o){Pu(e);let s=VD().$implicit,H=VD();return Lu(H.onItemChecked(s.id,o))}),Kc();}if(t&2){let e=VD().$implicit,n=VD();ch("nzChecked",n.checkedIds().has(e.id)),ah("data-testid","check-"+e.id);}}function ne(t,c){if(t&1&&(_i(0,"span",9),vw(1),Kc()),t&2){let e=VD().$implicit;ah("data-testid","subtitle-"+e.id),gI(),Ph(e.subtitle);}}function ie(t,c){if(t&1&&(_i(0,"a",10),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=c,n=VD().$implicit,o=VD();ch("routerLink",xw(5,U,e.id)),ah("data-testid","latest-"+n.id),gI(),nl(" ",Ow(2,3,o.statusKey(e.status))," ");}}function oe(t,c){if(t&1&&(_i(0,"span",11),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD().$implicit;ah("data-testid","latest-"+e.id),gI(),Ph(Ow(2,2,"runnableTable.neverRun"));}}function ae(t,c){if(t&1){let e=LD();_i(0,"td")(1,"button",13),gh("click",function(){Pu(e);let o=VD().$implicit,s=VD();return Lu(s.emitRow(o.id))}),vw(2),Rw(3,"transloco"),Kc()();}if(t&2){let e=VD().$implicit;gI(),ah("data-testid","run-"+e.id),gI(),nl(" ",Ow(3,2,"runnableTable.run")," ");}}function le(t,c){if(t&1&&(_i(0,"tr"),bD(1,te,1,2,"td",6),_i(2,"td")(3,"div",7)(4,"span",8),vw(5),Kc(),bD(6,ne,2,2,"span",9),Kc()(),_i(7,"td"),bD(8,ie,3,7,"a",10)(9,oe,3,4,"span",11),Kc(),bD(10,ae,4,4,"td"),Kc()),t&2){let e,n=c.$implicit,o=VD();ah("data-testid","row-"+n.id),gI(),_D(o.selectable()?1:-1),gI(3),ah("data-testid","label-"+n.id),gI(),Ph(n.primaryLabel),gI(),_D(n.subtitle?6:-1),gI(2),_D((e=n.latestJob)?8:9,e),gI(2),_D(o.showRowAction()?10:-1);}}var we=(()=>{class t{constructor(){this.rows=$0([]),this.selectable=$0(false),this.showRowAction=$0(true),this.rowAction=B0(),this.bulkAction=B0(),this.checkedIds=qo(new Set),this.checkedCount=Hw(()=>this.checkedIds().size),this.allChecked=Hw(()=>{let e=this.rows();return e.length>0&&e.every(n=>this.checkedIds().has(n.id))}),this.someChecked=Hw(()=>{let e=this.checkedCount();return e>0&&e<this.rows().length});}onItemChecked(e,n){this.checkedIds.update(o=>{let s=new Set(o);return n?s.add(e):s.delete(e),s});}onAllChecked(e){this.checkedIds.set(e?new Set(this.rows().map(n=>n.id)):new Set);}emitBulk(){this.bulkAction.emit([...this.checkedIds()]);}emitRow(e){this.rowAction.emit(e);}statusKey(e){return `jobs.status.${e}`}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-runnable-items-table"]],inputs:{rows:[1,"rows"],selectable:[1,"selectable"],showRowAction:[1,"showRowAction"]},outputs:{rowAction:"rowAction",bulkAction:"bulkAction"},decls:16,vars:12,consts:[["data-testid","runnable-items-table",1,"runnable-table"],["data-testid","bulk-bar",1,"bulk-bar"],[3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","select-all",3,"nzChecked","nzIndeterminate"],["nz-button","","type","button","data-testid","run-selected",3,"click","disabled"],["data-testid","select-all",3,"nzCheckedChange","nzChecked","nzIndeterminate"],[3,"nzChecked"],[1,"item"],[1,"primary"],[1,"subtitle"],[3,"routerLink"],[1,"never"],[3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"]],template:function(n,o){n&1&&(_i(0,"div",0),bD(1,Y,4,7,"div",1),_i(2,"nz-table",2)(3,"thead")(4,"tr"),bD(5,Z,1,2,"th",3),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),bD(12,ee,3,3,"th"),Kc()(),_i(13,"tbody"),ND(14,le,11,7,"tr",null,X),Kc()()()),n&2&&(gI(),_D(o.selectable()?1:-1),gI(),ch("nzData",o.rows())("nzFrontPagination",false)("nzShowPagination",false),gI(3),_D(o.selectable()?5:-1),gI(2),Ph(Ow(8,8,"runnableTable.column.item")),gI(3),Ph(Ow(11,10,"runnableTable.column.latestRun")),gI(2),_D(o.showRowAction()?12:-1),gI(2),xD(o.rows()));},dependencies:[Mi,Ln,sd,zc,t7,y7,Ad,Hl,$d,Al,$l,Vd,Ai,Xl,Bl,Kt],styles:[".runnable-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.bulk-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem}.primary[_ngcontent-%COMP%]{font-weight:600}.subtitle[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.never[_ngcontent-%COMP%]{color:#78716c}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{we as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {C,bB as Zi,a8 as a,bD as u,bC as E,i as ie}from'./main-R7YQQZVK.js';var U=(()=>{class r{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/batches`;}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())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(E())}launch(t){return this.http.post(this.baseUrl,t).pipe(E())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {o as ox,i as ix}from'./chunk-BIFLxIMS.js';import {s,r,t as t$1}from'./main-R7YQQZVK.js';var y=["agent","interaction","shell","git","provider_action","sub_workflow","loop"];function I(){return {name:"",appliesTo:"none",subjectHandling:"per-subject",inputSchema:[],steps:[],notificationPolicy:{triggers:[]}}}function d(){return crypto.randomUUID()}function g(t,e){return t.map(n=>{let r$1=s(r({},n),{_key:d(),_idAutoSync:e.idAutoSync});return n.type==="loop"?s(r({},r$1),{steps:g(n.steps,e)}):r$1})}function h(t,e){let n=e?.id??"",r$1=e?.name??"",i={_key:e?.key??d(),_idAutoSync:e?.idAutoSync??true};switch(t){case "agent":return r({type:t,id:n,name:r$1,objective:"",outputFormat:"free_text"},i);case "interaction":return r({type:t,id:n,name:r$1,interaction:"questionnaire"},i);case "shell":return r({type:t,id:n,name:r$1,command:""},i);case "git":return r({type:t,id:n,name:r$1,operation:"create_worktree",params:{}},i);case "provider_action":return r({type:t,id:n,name:r$1,action:"get_subject",params:{}},i);case "sub_workflow":return r({type:t,id:n,name:r$1,workflowId:"",forEach:"selection"},i);case "loop":return r({type:t,id:n,name:r$1,steps:[],until:{type:"field_empty",stepId:"",field:""},maxIterations:3,onMaxIterations:{action:"fail"}},i)}}function b(){return {name:"",label:"",type:"string",required:false}}function A(t){return t?Object.entries(t).map(([e,n])=>({key:e,value:n==null?"":String(n)})):[]}function j(t){let e={};for(let n of t){let r=n.key.trim();r&&(e[r]=n.value);}return e}function T(t){return t.issues.map(e=>`${e.path.length>0?e.path.map(String).join("."):"(root)"}: ${e.message}`)}function m(t){let i=t,{_key:e,_idAutoSync:n}=i,r$1=t$1(i,["_key","_idAutoSync"]);return r$1.type==="loop"?s(r({},r$1),{steps:r$1.steps.map(a=>m(a))}):r$1}function v(t,e={}){let n=t.steps.map(_=>{let u=m(_);if(!u.id){let p=u,{id:x}=p;return t$1(p,["id"])}return u}),a=t,{id:r$1}=a,i=t$1(a,["id"]);return e.omitWorkflowId||!r$1?s(r({},i),{steps:n}):s(r({},i),{id:r$1,steps:n})}function E(t,e,n){if(!t._idAutoSync)return s(r({},t),{name:e});let r$1=ox(n);t.id&&r$1.delete(t.id);let i=e.trim().length>0?ix(e,r$1):"";return s(r({},t),{name:e,id:i})}function P(t,e){return s(r({},t),{id:e,_idAutoSync:false})}export{A,E,I,P,T,b,g,h,j,v,y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-Cuaj1Fgz.js';import {$ as $$1,R,y,T,P,q,D,N,w,V,_}from'./chunk-CQ708Y6F.js';import {S as Sk,N as Nx,v as vf,u as uk,I as Ie}from'./chunk-BIFLxIMS.js';import {C,ag as $,b as at,V as Ve,q as qo,H as Hw,a9 as Ng,u as ue,s,r,ah as Ml,ai as Se,aa as Xi,ab as Dg,o,Q as QE,M as Mi,n as n8,aj as S4,J as J6,k as k3,c as sd,z as zc,d as t7,Z as y7,$ as $b,e as V5,D as D5,K as Kt$1,f as _i,v as vw,R as Rw,g as Kc,h as gh,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,ak as YE,al as uu,am as pT,an as kt$1,ao as _r,ap as oe,aq as z0,ar as a3,as as hT,at as Le,au as m1,av as St,aw as c8,ax as pt,ay as Se$1,az as Tt,aA as Ie$1,aB as ly,aC as Z0,l as lh,a4 as Mh,x as ch,a5 as ah,aD as Sw,aE as h1,aF as wo,aG as Ih,aH as qD,aI as WD,E as VD,N as ND,A as xD,F as LD,j as oE,y as sE,aJ as ut,aK as nh,S as SD,aL as el,aM as tl,G as Pu,I as Lu}from'./main-R7YQQZVK.js';import {G as Gn,u as un}from'./chunk-bi3jOaJV.js';import {W,I}from'./chunk-DjiFAEo3.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';var yt=["switchElement"];function bt(i,p){i&1&&lh(0,"nz-icon",3);}function Et(i,p){if(i&1&&(el(0),vw(1),tl()),i&2){let e=VD(2);gI(),Ph(e.nzCheckedChildren);}}function It(i,p){if(i&1&&nh(0,Et,2,1,"ng-container",6),i&2){let e=VD();ch("nzStringTemplateOutlet",e.nzCheckedChildren);}}function wt(i,p){if(i&1&&(el(0),vw(1),tl()),i&2){let e=VD(2);gI(),Ph(e.nzUnCheckedChildren);}}function Nt(i,p){if(i&1&&nh(0,wt,2,1,"ng-container",6),i&2){let e=VD();ch("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var kt="switch",J=(()=>{let i,p=[],e=[];return class K{static{let t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[ut()],pT(null,null,i,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,u)=>{r.nzSize=u;}},metadata:t},p,e),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:t});}_nzModuleName=kt;nzConfigService=C(kt$1);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(z0);focusMonitor=C(a3);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=hT(this,p,"default");nzId=(hT(this,e),null);dir=C(Le).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(m1,{optional:true});finalSize=Hw(()=>this.formSize?.()||this.size());updateValue(t){this.isChecked!==t&&(this.isChecked=t,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(t){let{nzSize:r}=t;r&&this.size.set(r.currentValue);}ngOnInit(){St(this.el,"click").pipe(ue(this.destroyRef)).subscribe(t=>{t.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),St(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(t=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:r}=t;r!==37&&r!==39&&r!==32&&r!==13||(t.preventDefault(),this.ngZone.run(()=>{r===37?this.updateValue(false):r===39?this.updateValue(true):(r===32||r===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(t=>{t||Promise.resolve().then(()=>this.onTouched());});}writeValue(t){this.isChecked=t,this.cdr.markForCheck();}registerOnChange(t){this.onChange=t;}registerOnTouched(t){this.onTouched=t;}setDisabledState(t){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||t,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(r){return new(r||K)};static \u0275cmp=QE({type:K,selectors:[["nz-switch"]],viewQuery:function(r,u){if(r&1&&Ih(yt,7),r&2){let q;qD(q=WD())&&(u.switchElement=q.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",Z0],nzDisabled:[2,"nzDisabled","nzDisabled",Z0],nzControl:[2,"nzControl","nzControl",Z0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Sw([{provide:h1,useExisting:wo(()=>K),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(r,u){r&1&&(_i(0,"button",1,0)(2,"span",2),bD(3,bt,1,0,"nz-icon",3),Kc(),_i(4,"span",4),bD(5,It,1,1,"ng-container")(6,Nt,1,1,"ng-container"),Kc(),lh(7,"div",5),Kc()),r&2&&(Mh("ant-switch-checked",u.isChecked)("ant-switch-loading",u.nzLoading)("ant-switch-disabled",u.nzDisabled)("ant-switch-small",u.finalSize()==="small")("ant-switch-rtl",u.dir()==="rtl"),ch("disabled",u.nzDisabled)("nzWaveExtraNode",true),ah("id",u.nzId),gI(3),_D(u.nzLoading?3:-1),gI(2),_D(u.isChecked?5:6));},dependencies:[c8,y7,pt,Se$1,Tt,Ie$1],encapsulation:2})}})(),ht=(()=>{class i{static \u0275fac=function(o){return new(o||i)};static \u0275mod=YE({type:i});static \u0275inj=uu({imports:[J]})}return i})();var Y=(i,p)=>p.id,Dt=(i,p)=>p.key;function Ot(i,p){i&1&&(_i(0,"div",4),lh(1,"nz-alert",9),Rw(2,"transloco"),Kc()),i&2&&(gI(),ch("nzMessage",Ow(2,1,"settings.restartRequired.message")));}function Vt(i,p){i&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Pt(i,p){if(i&1&&(_i(0,"p",6),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function At(i,p){if(i&1&&(_i(0,"nz-tag",11),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=VD().$implicit;ah("data-testid",e.id+"-default-chip"),gI(),Ph(Ow(2,2,"settings.defaultAgent.label"));}}function Ft(i,p){if(i&1){let e=LD();_i(0,"tr")(1,"td",10)(2,"span"),vw(3),Kc(),bD(4,At,3,4,"nz-tag",11),Kc(),_i(5,"td")(6,"nz-tag"),vw(7),Rw(8,"transloco"),Kc()(),_i(9,"td"),vw(10),Kc(),_i(11,"td",12)(12,"button",13),gh("click",function(){let t=Pu(e).$implicit,r=VD(2);return Lu(r.openEdit(t))}),vw(13),Rw(14,"transloco"),Kc(),_i(15,"button",14),Rw(16,"transloco"),Rw(17,"transloco"),Rw(18,"transloco"),gh("nzOnConfirm",function(){let t=Pu(e).$implicit,r=VD(2);return Lu(r.removeInstance(t.id))}),vw(19),Rw(20,"transloco"),Kc()()();}if(i&2){let e=p.$implicit,o=VD(2);ah("data-testid","instance-"+e.id),gI(),ah("data-testid",e.id+"-name"),gI(2),Ph(e.displayName),gI(),_D(o.isDefaultAgent(e)?4:-1),gI(2),ah("data-testid",e.id+"-type"),gI(),Ph(Ow(8,15,o.typeLabelKey(e))),gI(2),ah("data-testid",e.id+"-expires"),gI(),nl(" ",e.expiresOn??""," "),gI(2),ah("data-testid",e.id+"-edit"),gI(),nl(" ",Ow(14,17,"settings.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(16,19,"settings.deleteConfirm"))("nzOkText",Ow(17,21,"settings.delete"))("nzCancelText",Ow(18,23,"common.cancel")),ah("data-testid",e.id+"-delete"),gI(4),nl(" ",Ow(20,25,"settings.delete")," ");}}function Bt(i,p){if(i&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc()()(),_i(15,"tbody"),ND(16,Ft,21,27,"tr",null,Y),Kc()()),i&2){let e=VD();ch("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,7,"settings.column.displayName")),gI(3),Ph(Ow(8,9,"settings.column.type")),gI(3),Ph(Ow(11,11,"settings.column.expiresOn")),gI(3),Ph(Ow(14,13,"settings.column.actions")),gI(3),xD(e.instances());}}function Rt(i,p){if(i&1&&(_i(0,"li"),vw(1),Kc()),i&2){let e=p.$implicit;gI(),Ph(e);}}function Lt(i,p){if(i&1&&(_i(0,"section",16)(1,"h3"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,Rt,2,1,"li",null,SD),Kc()()),i&2){let e=VD(2);gI(2),Ph(Ow(3,1,"settings.validation")),gI(3),xD(e.validationErrors());}}function Kt(i,p){if(i&1&&(_i(0,"p",17),vw(1),Kc()),i&2){let e=VD(2);gI(),Ph(e.secretSaveError());}}function qt(i,p){if(i&1&&(lh(0,"nz-option",24),Rw(1,"transloco")),i&2){let e=p.$implicit;ch("nzValue",e.id)("nzLabel",Ow(1,2,e.labelKey));}}function $t(i,p){if(i&1){let e=LD();_i(0,"label",18)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"input",32),gh("ngModelChange",function(t){let r=Pu(e).$implicit,u=VD(2);return Lu(u.setDraftConfig(r.key,t))}),Kc(),oE(),Kc();}if(i&2){let e=p.$implicit,o=VD(2);gI(2),Ph(Ow(3,3,e.labelKey)),gI(2),ch("ngModel",o.configValue(o.draft().config,e.key)),ah("data-testid","provider-config-"+e.key),sE();}}function jt(i,p){if(i&1){let e=LD();_i(0,"button",33),gh("click",function(){Pu(e);let t=VD(2);return Lu(t.fetchModels())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(2);ch("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),nl(" ",Ow(2,3,"settings.model.fetch")," ");}}function Ut(i,p){if(i&1&&lh(0,"nz-option",24),i&2){let e=VD(3);ch("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function Wt(i,p){if(i&1&&lh(0,"nz-option",24),i&2){let e=p.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function Zt(i,p){if(i&1&&(_i(0,"p",35),vw(1),Kc()),i&2){let e=VD(3);gI(),Ph(e.modelsError());}}function Ht(i,p){if(i&1){let e=LD();_i(0,"div",18)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",34),Rw(5,"transloco"),gh("ngModelChange",function(t){Pu(e);let r=VD(2);return Lu(r.setDraftConfig("model",t??""))}),bD(6,Ut,1,2,"nz-option",24),ND(7,Wt,1,2,"nz-option",24,Y),Kc(),oE(),bD(9,Zt,2,1,"p",35),_i(10,"p",22),vw(11),Rw(12,"transloco"),Kc()(),_i(13,"label",36)(14,"span"),vw(15),Rw(16,"transloco"),Kc(),_i(17,"nz-switch",37),gh("ngModelChange",function(t){Pu(e);let r=VD(2);return Lu(r.setDefaultAgentDraft(t))}),Kc(),oE(),Kc();}if(i&2){let e=VD(2);gI(2),Ph(Ow(3,8,"settings.model.label")),gI(2),ch("nzPlaceHolder",Ow(5,10,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),sE(),gI(2),_D(e.selectedModelMissingFromList()?6:-1),gI(),xD(e.availableModels()),gI(2),_D(e.modelsError()?9:-1),gI(2),Ph(Ow(12,12,"settings.model.hint")),gI(4),Ph(Ow(16,14,"settings.defaultAgent.toggle")),gI(2),ch("ngModel",e.draft().defaultAgent),sE();}}function Qt(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"div",15)(2,"h2"),vw(3),Rw(4,"transloco"),Kc(),bD(5,Lt,7,3,"section",16),bD(6,Kt,2,1,"p",17),_i(7,"label",18)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"input",19),gh("ngModelChange",function(t){Pu(e);let r=VD();return Lu(r.onDisplayNameChange(t))}),Kc(),oE(),Kc(),_i(12,"label",20)(13,"span"),vw(14),Rw(15,"transloco"),Kc(),_i(16,"input",21),gh("ngModelChange",function(t){Pu(e);let r=VD();return Lu(r.onIdChange(t))}),Kc(),oE(),_i(17,"p",22),vw(18),Rw(19,"transloco"),Kc()(),_i(20,"div",18)(21,"span"),vw(22),Rw(23,"transloco"),Kc(),_i(24,"nz-select",23),gh("ngModelChange",function(t){Pu(e);let r=VD();return Lu(r.onTypeChange(t))}),ND(25,qt,2,4,"nz-option",24,Y),Kc(),oE(),Kc(),ND(27,$t,5,5,"label",18,Dt),_i(29,"label",18)(30,"span"),vw(31),Rw(32,"transloco"),Kc(),_i(33,"div",25)(34,"input",26),Rw(35,"transloco"),gh("ngModelChange",function(t){Pu(e);let r=VD();return Lu(r.setSecretValue(t))}),Kc(),oE(),bD(36,jt,3,5,"button",27),Kc()(),bD(37,Ht,18,16),_i(38,"label",18)(39,"span"),vw(40),Rw(41,"transloco"),Kc(),_i(42,"input",28),gh("ngModelChange",function(t){Pu(e);let r=VD();return Lu(r.setExpiresOn(t))}),Kc(),oE(),_i(43,"p",22),vw(44),Rw(45,"transloco"),Kc()(),_i(46,"div",29)(47,"button",30),gh("click",function(){Pu(e);let t=VD();return Lu(t.closeModal())}),vw(48),Rw(49,"transloco"),Kc(),_i(50,"button",31),gh("click",function(){Pu(e);let t=VD();return Lu(t.saveModal())}),vw(51),Rw(52,"transloco"),Kc()()()();}if(i&2){let e=VD();gI(3),nl(" ",Ow(4,21,e.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),_D(e.validationErrors().length>0?5:-1),gI(),_D(e.secretSaveError()?6:-1),gI(3),Ph(Ow(10,23,"settings.displayName")),gI(2),ch("ngModel",e.draft().displayName),sE(),gI(3),Ph(Ow(15,25,"settings.instanceId")),gI(2),ch("ngModel",e.draft().id),sE(),gI(2),Ph(Ow(19,27,"settings.instanceIdHint")),gI(4),Ph(Ow(23,29,"settings.type.label")),gI(2),ch("ngModel",e.draft().optionId),sE(),gI(),xD(e.typeOptions),gI(2),xD(e.configFields(e.draft().type)),gI(4),Ph(Ow(32,31,"settings.apiKey.label")),gI(3),ch("ngModel",e.draft().secretValue)("placeholder",Ow(35,33,e.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),sE(),gI(2),_D(e.draft().kind==="agent"?36:-1),gI(),_D(e.draft().kind==="agent"?37:-1),gI(3),Ph(Ow(41,35,"settings.expiresOn.label")),gI(2),ch("ngModel",e.draft().expiresOn),sE(),gI(2),Ph(Ow(45,37,"settings.expiresOn.hint")),gI(4),nl(" ",Ow(49,39,"common.cancel")," "),gI(2),ch("nzLoading",e.saving()),gI(),nl(" ",Ow(52,41,"common.save")," ");}}var Ui=(()=>{class i{constructor(){this.api=C($),this.providersApi=C($$1),this.message=C(Sk),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(R()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.instances=Hw(()=>this.loaded().providerInstances??[]),this.typeOptions=y,this.configFields=T,this.typeLabelKey=P,this.isAgent=Nx,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:o})=>{this.applySettings(e,false),this.status.set(o),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,o){let t=e[o];return typeof t=="string"?t:""}isDefaultAgent(e){return Nx(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(o=>o.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}openCreate(){this.resetModal(R());}openEdit(e){this.resetModal(q(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(o=>D(o,e,this.existingIds(o)));}onIdChange(e){this.draft.update(o=>N(o,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.draft.update(o=>{let t=w(o,e);return t.kind!=="agent"||o.kind==="agent"?t:s(r({},t),{defaultAgent:this.shouldDefaultNewAgent(o)})});}setDraftConfig(e,o){this.draft.update(t=>s(r({},t),{config:s(r({},t.config),{[e]:o})}));}setSecretValue(e){this.draft.update(o=>s(r({},o),{secretValue:e}));}setExpiresOn(e){this.draft.update(o=>s(r({},o),{expiresOn:e}));}setDefaultAgentDraft(e){this.draft.update(o=>s(r({},o),{defaultAgent:e}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let o=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(o?{type:e.type,apiKey:o}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.availableModels.set(t),this.fetchingModels.set(false);},error:t=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(t,this.transloco.translate("settings.model.fetchFailed")));}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let o=vf.safeParse(V(e));if(!o.success){this.validationErrors.set(_(o.error));return}this.saving.set(true);let t=o.data,r$1=t.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r(r({},t),r$1)):this.api.updateProviderInstance(e.originalId,r({displayName:t.displayName,config:t.config,secretKey:t.secretKey,expiresOn:t.expiresOn??null},r$1))).pipe(Ml(T=>{this.applySettings(T.settings,T.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(t.secretKey,P).pipe(Se(()=>({kind:"ok"})),Xi(_t=>Dg({kind:"secret-failed",err:_t}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:T=>{if(this.saving.set(false),T.kind==="secret-failed"){this.draft.update(P=>s(r({},P),{originalId:t.id,id:t.id,idAutoSync:false,secretKey:t.secretKey})),this.secretSaveError.set(this.errorMessage(T.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:T=>{this.saving.set(false),this.message.error(this.errorMessage(T,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:o=>this.applySettings(o.settings,o.restartRequired),error:o=>{this.message.error(this.errorMessage(o,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(o=>o.id).filter(o=>o!==e.originalId)}applySettings(e,o){let t=e.providerInstances??[];this.loaded.set(r({providerInstances:t},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),o&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,o$1){return e instanceof o||e instanceof Error?e.message:o$1}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(o,t){o&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"p",2),vw(7),Rw(8,"transloco"),Kc()(),_i(9,"button",3),gh("click",function(){return t.openCreate()}),vw(10),Rw(11,"transloco"),Kc()(),bD(12,Ot,3,3,"div",4),bD(13,Vt,3,3,"p",5)(14,Pt,2,1,"p",6)(15,Bt,18,15,"nz-table",7),bD(16,Qt,53,43,"div",8),Kc()),o&2&&(gI(4),Ph(Ow(5,6,"settings.title")),gI(3),Ph(Ow(8,8,"settings.lede")),gI(3),nl(" ",Ow(11,10,"settings.addProvider")," "),gI(2),_D(t.restartRequired()?12:-1),gI(),_D(t.loading()?13:t.loadError()?14:15),gI(3),_D(t.modalOpen()?16:-1));},dependencies:[Mi,n8,S4,J6,k3,Gn,un,sd,zc,t7,y7,uk,Ie,_n,Cn,$b,V5,D5,ht,J,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt$1],styles:[".settings[_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}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.name-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return i})();export{Ui as ProvidersManageComponent,Ui as SettingsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-Cuaj1Fgz.js';import {U}from'./chunk-MRIst_Tv.js';import {W,I}from'./chunk-DjiFAEo3.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';import {C,V as Ve,b as at,q as qo,u as ue,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,c as sd,z as zc,d as t7,$ as $b,e as V5,D as D5,K as Kt$1,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,h as gh,N as ND,S as SD,j as oE,x as ch,y as sE,A as xD,l as lh,a5 as ah,a2 as Pw,a3 as xw,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var st=e=>({count:e}),dt=e=>["/workflows",e,"edit"],pt=(e,p)=>p.id;function ct(e,p){e&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function mt(e,p){if(e&1&&(_i(0,"p",4),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.loadError());}}function ft(e,p){if(e&1&&(lh(0,"nz-option",7),Rw(1,"transloco")),e&2){let t=p.$implicit,o=VD(2);ch("nzValue",t)("nzLabel",Ow(1,2,o.subjectHandlingFilterKey(t)));}}function wt(e,p){if(e&1&&(_i(0,"p",8),vw(1),Kc()),e&2){let t=VD(2);gI(),Ph(t.deleteError());}}function ut(e,p){e&1&&(_i(0,"section",9)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",11),vw(5),Rw(6,"transloco"),Kc()()),e&2&&(gI(2),Ph(Ow(3,2,"workflows.list.emptyState")),gI(3),nl(" ",Ow(6,4,"workflows.list.emptyCreateButton")," "));}function _t(e,p){if(e&1&&(_i(0,"span"),vw(1),Kc()),e&2){let t=VD().$implicit;ah("data-testid","description-"+t.id),gI(),Ph(t.description);}}function xt(e,p){if(e&1&&(_i(0,"span",13),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=VD().$implicit;ah("data-testid","description-"+t.id),gI(),Ph(Ow(2,2,"workflows.list.noDescription"));}}function gt(e,p){if(e&1&&(_i(0,"nz-tag"),vw(1),Rw(2,"transloco"),Kc()),e&2){let t=p.$implicit,o=VD().$implicit,m=VD(3);ah("data-testid","applies-to-"+o.id),gI(),Ph(Ow(2,2,m.subjectTypeKey(t)));}}function Ct(e,p){if(e&1){let t=LD();_i(0,"tr")(1,"td")(2,"span"),vw(3),Kc()(),_i(4,"td",12),bD(5,_t,2,2,"span")(6,xt,3,4,"span",13),Kc(),_i(7,"td"),ND(8,gt,3,4,"nz-tag",null,SD),Kc(),_i(10,"td")(11,"nz-tag"),vw(12),Rw(13,"transloco"),Kc()(),_i(14,"td")(15,"span"),vw(16),Rw(17,"transloco"),Kc()(),_i(18,"td",14)(19,"a",15),vw(20),Rw(21,"transloco"),Kc(),_i(22,"button",16),Rw(23,"transloco"),Rw(24,"transloco"),Rw(25,"transloco"),gh("nzOnConfirm",function(){let m=Pu(t).$implicit,h=VD(3);return Lu(h.deleteWorkflow(m.id))}),vw(26),Rw(27,"transloco"),Kc()()();}if(e&2){let t=p.$implicit,o=VD(3);ah("data-testid","workflow-"+t.id),gI(2),ah("data-testid","name-"+t.id),gI(),Ph(t.name),gI(2),_D(t.description?.trim()?5:6),gI(3),xD(o.appliesToValues(t)),gI(3),ah("data-testid","subject-handling-"+t.id),gI(),Ph(Ow(13,16,o.subjectHandlingKey(t.subjectHandling))),gI(3),ah("data-testid","step-count-"+t.id),gI(),Ph(Pw(17,18,"workflows.list.stepCount",xw(31,st,t.steps.length))),gI(3),ch("routerLink",xw(33,dt,t.id)),ah("data-testid","edit-"+t.id),gI(),nl(" ",Ow(21,21,"workflows.list.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(23,23,"workflows.list.deleteConfirm"))("nzOkText",Ow(24,25,"workflows.list.delete"))("nzCancelText",Ow(25,27,"common.cancel")),ah("data-testid","delete-"+t.id),gI(4),nl(" ",Ow(27,29,"workflows.list.delete")," ");}}function kt(e,p){if(e&1&&(_i(0,"nz-table",10)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"th"),vw(19),Rw(20,"transloco"),Kc()()(),_i(21,"tbody"),ND(22,Ct,28,35,"tr",null,pt),Kc()()),e&2){let t=VD(2);ch("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,9,"workflows.list.column.name")),gI(3),Ph(Ow(8,11,"workflows.list.column.description")),gI(3),Ph(Ow(11,13,"workflow-editor.appliesTo")),gI(3),Ph(Ow(14,15,"workflow-editor.subjectHandling.label")),gI(3),Ph(Ow(17,17,"workflows.list.column.steps")),gI(3),Ph(Ow(20,19,"workflows.list.column.actions")),gI(3),xD(t.workflows());}}function bt(e,p){if(e&1){let t=LD();_i(0,"div",5)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",6),gh("ngModelChange",function(m){Pu(t);let h=VD();return Lu(h.setSubjectHandlingFilter(m))}),ND(5,ft,2,4,"nz-option",7,SD),Kc(),oE(),Kc(),bD(7,wt,2,1,"p",8),bD(8,ut,7,6,"section",9)(9,kt,24,21,"nz-table",10);}if(e&2){let t=VD();gI(2),Ph(Ow(3,4,"workflows.list.filterBySubjectHandling")),gI(2),ch("ngModel",t.subjectHandlingFilter()),sE(),gI(),xD(t.subjectHandlingOptions),gI(2),_D(t.deleteError()?7:-1),gI(),_D(t.workflows().length===0?8:9);}}var Kt=(()=>{class e{constructor(){this.workflowsApi=C(U),this.transloco=C(Ve),this.destroyRef=C(at),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let o=t.appliesTo;return o==="none"?["none"]:Array.isArray(o)?o:[o]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(o=>o.filter(m=>m.id!==t));},error:o=>{this.deleteError.set(this.errorMessage(o,this.transloco.translate("workflows.list.deleteFailed")));}});}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:o=>{this.workflows.set(o),this.loading.set(false);},error:o=>{this.loading.set(false),this.loadError.set(this.errorMessage(o,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,o$1){return t instanceof o||t instanceof Error?t.message:o$1}static{this.\u0275fac=function(o){return new(o||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-workflow-list"]],decls:11,vars:7,consts:[["data-testid","workflows-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(o,m){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,ct,3,3,"p",3)(9,mt,2,1,"p",4)(10,bt,10,6),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"workflows.list.title")),gI(3),nl(" ",Ow(7,5,"workflows.list.createButton")," "),gI(2),_D(m.loading()?8:m.loadError()?9:10));},dependencies:[Mi,n8,J6,k3,Ln,sd,zc,t7,_n,Cn,$b,V5,D5,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt$1],styles:[".list-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}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return e})();export{Kt as WorkflowListComponent,Kt as WorkflowsManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-Cuaj1Fgz.js';import {C,ae as U,af as u,V as Ve,b as at,q as qo,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,N as ND,x as ch,A as xD,F as LD,h as gh,a5 as ah,G as Pu,I as Lu}from'./main-R7YQQZVK.js';import {U as U$1}from'./chunk-MRIst_Tv.js';import {W,I}from'./chunk-DjiFAEo3.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';function Z(t,p){return [...t.map(i=>({type:"view",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:i.subjectType})),...p.map(i=>({type:"shortcut",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:null}))].sort((i,c)=>i.name.localeCompare(c.name))}var ee=(t,p)=>p.type+p.id;function te(t,p){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ie(t,p){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ne(t,p){if(t&1&&(_i(0,"p",7),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function oe(t,p){t&1&&(_i(0,"section",8)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",2)(5,"a",10),vw(6),Rw(7,"transloco"),Kc(),_i(8,"a",11),vw(9),Rw(10,"transloco"),Kc()()()),t&2&&(gI(2),Ph(Ow(3,3,"manage.views.emptyState")),gI(4),nl(" ",Ow(7,5,"manage.views.createView")," "),gI(3),nl(" ",Ow(10,7,"manage.views.createShortcut")," "));}function ae(t,p){if(t&1&&(vw(0),Rw(1,"transloco")),t&2){let e=VD().$implicit,i=VD(3);nl(" ",Ow(1,1,i.subjectTypeKey(e.subjectType))," ");}}function re(t,p){t&1&&(vw(0),Rw(1,"transloco")),t&2&&nl(" ",Ow(1,1,"manage.views.noSubjectType")," ");}function se(t,p){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td")(4,"nz-tag"),vw(5),Rw(6,"transloco"),Kc()(),_i(7,"td"),vw(8),Kc(),_i(9,"td"),bD(10,ae,2,3)(11,re,2,3),Kc(),_i(12,"td",12)(13,"a",13),vw(14),Rw(15,"transloco"),Kc(),_i(16,"button",14),Rw(17,"transloco"),Rw(18,"transloco"),Rw(19,"transloco"),gh("nzOnConfirm",function(){let c=Pu(e).$implicit,v=VD(3);return Lu(v.deleteItem(c))}),vw(20),Rw(21,"transloco"),Kc()()();}if(t&2){let e=p.$implicit,i=VD(3);ah("data-testid","item-"+e.type+"-"+e.id),gI(),ah("data-testid","name-"+e.type+"-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","type-"+e.type+"-"+e.id),gI(),Ph(Ow(6,17,i.typeKey(e.type))),gI(2),ah("data-testid","workflow-"+e.type+"-"+e.id),gI(),nl(" ",i.workflowName(e)," "),gI(),ah("data-testid","subject-type-"+e.type+"-"+e.id),gI(),_D(e.subjectType?10:11),gI(3),ch("routerLink",i.editLink(e)),ah("data-testid","edit-"+e.type+"-"+e.id),gI(),nl(" ",Ow(15,19,"manage.views.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(17,21,i.deleteConfirmKey(e)))("nzOkText",Ow(18,23,"manage.views.delete"))("nzCancelText",Ow(19,25,"common.cancel")),ah("data-testid","delete-"+e.type+"-"+e.id),gI(4),nl(" ",Ow(21,27,"manage.views.delete")," ");}}function de(t,p){if(t&1&&(_i(0,"nz-table",9)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,se,22,29,"tr",null,ee),Kc()()),t&2){let e=VD(2);ch("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,8,"manage.views.column.name")),gI(3),Ph(Ow(8,10,"manage.views.column.type")),gI(3),Ph(Ow(11,12,"manage.views.column.workflow")),gI(3),Ph(Ow(14,14,"manage.views.column.subjectType")),gI(3),Ph(Ow(17,16,"manage.views.column.actions")),gI(3),xD(e.items());}}function pe(t,p){if(t&1&&(bD(0,ne,2,1,"p",7),bD(1,oe,11,9,"section",8)(2,de,21,18,"nz-table",9)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.items().length===0?1:2);}}var Ne=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(u),this.workflowsApi=C(U$1),this.transloco=C(Ve),this.destroyRef=C(at),this.items=qo([]),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.load();}typeKey(e){return `manage.views.type.${e}`}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}workflowName(e){return this.workflows().find(i=>i.id===e.workflowId)?.name??e.workflowId}editLink(e){return e.type==="view"?["/views",e.id,"edit"]:["/shortcuts",e.id,"edit"]}deleteConfirmKey(e){return e.type==="view"?"manage.views.deleteConfirmView":"manage.views.deleteConfirmShortcut"}deleteItem(e){this.deleteError.set(null),(e.type==="view"?this.viewsApi.delete(e.id):this.shortcutsApi.delete(e.id)).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.items.update(c=>c.filter(v=>!(v.type===e.type&&v.id===e.id)));},error:c=>{this.deleteError.set(this.errorMessage(c,this.transloco.translate("manage.views.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({views:this.viewsApi.list(),shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({views:e,shortcuts:i,workflows:c})=>{this.items.set(Z(e,i)),this.workflows.set(c),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("manage.views.loadFailed")));}});}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=QE({type:t,selectors:[["app-views-and-shortcuts-manage"]],decls:15,vars:10,consts:[["data-testid","views-shortcuts-manage",1,"list-page"],[1,"header"],[1,"header-actions"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","managed-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","empty-create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","empty-create-shortcut"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(i,c){i&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"a",4),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,te,3,3,"p",5)(13,ie,2,1,"p",6)(14,pe,3,2),Kc()),i&2&&(gI(3),Ph(Ow(4,4,"manage.views.title")),gI(4),nl(" ",Ow(8,6,"manage.views.createView")," "),gI(3),nl(" ",Ow(11,8,"manage.views.createShortcut")," "),gI(2),_D(c.loading()?12:c.loadError()?13:14));},dependencies:[Mi,Ln,sd,zc,t7,_n,Cn,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt],styles:[".list-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-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.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 t})();export{Ne as ViewsAndShortcutsManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {Q as QE,K as Kt,aW as Jc,v as vw,R as Rw,aX as Xc,p as gI,P as Ph,O as Ow}from'./main-R7YQQZVK.js';var x=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-preferences-manage"]],decls:9,vars:6,consts:[["data-testid","preferences-manage",1,"list-page"],[1,"header"],[1,"lede"]],template:function(t,l){t&1&&(Jc(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Rw(5,"transloco"),Xc(),Jc(6,"p",2),vw(7),Rw(8,"transloco"),Xc()()()()),t&2&&(gI(4),Ph(Ow(5,2,"manage.preferences.title")),gI(3),Ph(Ow(8,4,"manage.preferences.body")));},dependencies:[Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}"]});}}return e})();export{x as PreferencesManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {P as Px,N as Nx,i as ix,j as jx}from'./chunk-BIFLxIMS.js';import {C,bB as Zi,a8 as a,bC as E,i as ie,s,r}from'./main-R7YQQZVK.js';var $=(()=>{class e{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/providers`;}listQueryTemplates(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates`).pipe(E())}listExtendedActions(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/actions`).pipe(E())}resolveQueryTemplate(t,i,r){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates/${encodeURIComponent(i)}/resolve`,{params:r}).pipe(E())}previewModels(t){return this.http.post(`${this.baseUrl}/preview-models`,t).pipe(E())}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();var y=[{id:"jira",labelKey:"settings.typeOption.jira",kind:"subject",type:"jira",subjectType:"ticket"},{id:"bitbucket",labelKey:"settings.typeOption.bitbucket",kind:"subject",type:"bitbucket",subjectType:"pull_request"},{id:"github",labelKey:"settings.typeOption.github",kind:"subject",type:"github",subjectType:"ticket"},{id:"confluence",labelKey:"settings.typeOption.confluence",kind:"subject",type:"confluence",subjectType:"documentation"},{id:"manual-ticket",labelKey:"settings.typeOption.manualTicket",kind:"subject",type:"manual",subjectType:"ticket"},{id:"manual-documentation",labelKey:"settings.typeOption.manualDocumentation",kind:"subject",type:"manual",subjectType:"documentation"},{id:"claude",labelKey:"settings.typeOption.claude",kind:"agent",type:"claude"},{id:"cursor",labelKey:"settings.typeOption.cursor",kind:"agent",type:"cursor"}],F=["ticket","pull_request","documentation"];function d(e){return y.find(n=>n.id===e)??y[0]}function h(e){return y.find(t=>t.kind!==e.kind||t.type!==e.type?false:t.kind==="agent"?true:jx(e)&&t.subjectType===e.subjectType)?.id??e.type}function P(e){let n=h(e);return d(n).labelKey}function T(e){return e==="jira"?[{key:"baseUrl",labelKey:"settings.jira.baseUrl"},{key:"email",labelKey:"settings.jira.email"}]:e==="bitbucket"?[{key:"email",labelKey:"settings.bitbucket.email"},{key:"workspace",labelKey:"settings.bitbucket.workspace"}]:e==="github"?[{key:"username",labelKey:"settings.github.username"}]:e==="confluence"?[{key:"baseUrl",labelKey:"settings.confluence.baseUrl"},{key:"email",labelKey:"settings.confluence.email"}]:[]}function R(){let e=y[0];return {originalId:null,id:"",idAutoSync:true,optionId:e.id,kind:e.kind,type:e.type,subjectType:e.subjectType??null,displayName:"",config:{},secretKey:Px("instance",e.kind),secretValue:"",expiresOn:"",defaultAgent:false}}function q(e,n=false){let t={};for(let o of T(e.type)){let s=e.config[o.key];typeof s=="string"&&(t[o.key]=s);}if(Nx(e)){let o=e.config.model;typeof o=="string"&&o.trim()&&(t.model=o.trim());}let i=h(e),r=d(i);return {originalId:e.id,id:e.id,idAutoSync:false,optionId:i,kind:r.kind,type:r.type,subjectType:r.subjectType??null,displayName:e.displayName,config:t,secretKey:e.secretKey,secretValue:"",expiresOn:e.expiresOn??"",defaultAgent:r.kind==="agent"?n:false}}function w(e,n){let t=d(n);return s(r({},e),{optionId:t.id,kind:t.kind,type:t.type,subjectType:t.subjectType??null,config:{},secretKey:Px(e.id||"instance",t.kind),defaultAgent:t.kind==="agent"?e.defaultAgent:false})}function D(e,n,t){if(!e.idAutoSync)return s(r({},e),{displayName:n});let i=n.trim().length>0?ix(n,t):"";return s(r({},e),{displayName:n,id:i,secretKey:Px(i||"instance",e.kind)})}function N(e,n){return s(r({},e),{id:n,idAutoSync:false,secretKey:Px(n.trim()||"instance",e.kind)})}function V(e){let n={};for(let s of T(e.type)){let b=(e.config[s.key]??"").trim();b&&(n[s.key]=b);}let t=e.id.trim(),i=e.displayName.trim()||t,r$1=e.secretKey.trim()||Px(t,e.kind),o=e.expiresOn.trim()||void 0;if(e.kind==="agent"){let s=(e.config.model??"").trim();return s&&(n.model=s),r({id:t,kind:"agent",type:e.type,displayName:i,config:n,secretKey:r$1},o?{expiresOn:o}:{})}return r({id:t,kind:"subject",type:e.type,subjectType:e.subjectType??"ticket",displayName:i,config:n,secretKey:r$1},o?{expiresOn:o}:{})}function _(e){return e.issues.map(n=>`${n.path.length>0?n.path.map(String).join("."):"(root)"}: ${n.message}`)}function K(e){return (e?.providerInstances??[]).filter(jx)}function B(e,n){return K(e).filter(t=>jx(t)&&n.includes(t.subjectType))}export{$,B,D,F,N,P,R,T,V,_,q,w,y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q as qo,H as Hw,a8 as a,i as ie}from'./main-R7YQQZVK.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=qo([]),b=Hw(()=>{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 +1 @@
|
|
|
1
|
-
import {ah as YE,ai as uu,bb as pT,bc as hT,a0 as $0,ak as Z0,H as Hw,s,r,a$ as Le,R as Rt,bd as XE,be as eh,a4 as Mh,q as qo,bf as re,C,bg as Uo,bh as k8,bi as em,bj as on,bk as Ul,Q as QE,bl as fn,bm as f1,bn as gn,bo as Xa,bp as Ts,bq as Vs,br as t4,bs as Tt,bt as Ie,aC as pt$1,aD as Se,d as sd,z as zc,e as t7,Z as y7,bu as Wy,bv as Uy,aH as nh,j as gh,w as ch,bw as Ih,an as _r,bx as qD,by as WD,bz as ut$1,bA as s0,b0 as N7,bB as Sy,L as LD,g as _i,bC as oi,bD as ri,m as bD,K as Kc,bE as Bh,h as Rw,v as vw,B as VD,bF as sw,aP as cw,p as gI,A as _D,a5 as ah,O as Ow,u as nl,bG as ji,a_ as XI,bH as kt,b as at,bI as Wm,bJ as jo,bK as Kg,bL as Yg,bM as kg,bN as kr,bO as xy,b2 as ly,aq as Le$1,bP as z0,bQ as r2,bR as a2,bS as _e,bT as Ou,bU as vn,bV as He,bW as Er,as as j3,l as lh,bX as el,bY as tl,bZ as i9,P as Ph,aI as Lw,E as Pu,G as Lu}from'./main-6LDEPJ3H.js';var lt=["overlay"];function ct(i,m){if(i&1&&(el(0),vw(1),tl()),i&2){let e=VD(2);gI(),Ph(e.nzTitle);}}function pt(i,m){if(i&1){let e=LD();_i(0,"div",2),oi(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationLeave())}),ri(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationEnter())}),lh(1,"div",3),_i(2,"div",4)(3,"div",5),nh(4,ct,2,1,"ng-container",6),Kc()()();}if(i&2){let e=VD();sw(e.nzOverlayStyle),cw(e._classMap),Mh("ant-tooltip-rtl",e.dir()==="rtl"),ch("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),sw(e._arrowStyleMap),gI(2),sw(e._contentStyleMap),gI(),ch("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext);}}var tt=(()=>{class i{componentType;elementRef=C(_r);hostView=C(ji);renderer=C(XI);noAnimation=C(t4,{host:true,optional:true});nzConfigService=C(kt);destroyRef=C(at);platformId=C(Wm);config;visibleChange=new Le;get _title(){return this.title||this.directiveTitle||null}get _content(){return this.content||this.directiveContent||null}get _trigger(){return typeof this.trigger<"u"?this.trigger:"hover"}get _placement(){let e=this.placement;return Array.isArray(e)&&e.length>0?e:typeof e=="string"&&e?[e]:["top"]}get _visible(){return (typeof this.visible<"u"?this.visible:this.internalVisible)||false}get _mouseEnterDelay(){return this.mouseEnterDelay||.15}get _mouseLeaveDelay(){return this.mouseLeaveDelay||.1}get _overlayClassName(){return this.overlayClassName||null}get _overlayStyle(){return this.overlayStyle||null}get _overlayClickable(){return this.overlayClickable??true}internalVisible=false;getProxyPropertyMap(){return {noAnimation:["noAnimation",()=>!!this.noAnimation]}}component;destroy$=new re;triggerDisposables=[];delayTimer;constructor(e){this.componentType=e,this.destroyRef.onDestroy(()=>{this.clearTogglingTimer(),this.removeTriggerListeners();});}ngAfterViewInit(){jo(this.platformId)&&(this.createComponent(),this.registerTriggers());}ngOnChanges(e){let{trigger:t}=e;t&&!t.isFirstChange()&&this.registerTriggers(),this.component&&this.updatePropertiesByChanges(e);}show(){this.component?.show();}hide(){this.component?.hide();}updatePosition(){this.component&&this.component.updatePosition();}createComponent(){let e=this.hostView.createComponent(this.componentType);this.component=e.instance,this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement),e.location.nativeElement),this.component.setOverlayOrigin(this.origin||this.elementRef),this.initProperties();let t=this.component.nzVisibleChange.pipe(Kg());t.pipe(Rt(this.destroyRef)).subscribe(n=>{this.internalVisible=n,this.visibleChange.emit(n);}),t.pipe(on(Boolean),Yg(0,kg),on(()=>!!this.component?.overlay?.overlayRef),Rt(this.destroyRef)).subscribe(()=>{this.component?.updatePosition();});}registerTriggers(){let e=this.elementRef.nativeElement,t=this.trigger;if(this.removeTriggerListeners(),t==="hover"){let n;this.triggerDisposables.push(this.renderer.listen(e,"mouseenter",()=>{this.delayEnterLeave(true,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(e,"mouseleave",()=>{this.delayEnterLeave(true,false,this._mouseLeaveDelay),this.component?.overlay.overlayRef&&!n&&(n=this.component.overlay.overlayRef.overlayElement,this.triggerDisposables.push(this.renderer.listen(n,"mouseenter",()=>{this.delayEnterLeave(false,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(n,"mouseleave",()=>{this.delayEnterLeave(false,false,this._mouseLeaveDelay);})));}));}else t==="focus"?(this.triggerDisposables.push(this.renderer.listen(e,"focusin",()=>this.show())),this.triggerDisposables.push(this.renderer.listen(e,"focusout",()=>this.hide()))):t==="click"&&this.triggerDisposables.push(this.renderer.listen(e,"click",n=>{n.preventDefault(),this.show();}));}updatePropertiesByChanges(e){this.updatePropertiesByKeys(Object.keys(e));}updatePropertiesByKeys(e){let t=r({title:["nzTitle",()=>this._title],directiveTitle:["nzTitle",()=>this._title],content:["nzContent",()=>this._content],directiveContent:["nzContent",()=>this._content],trigger:["nzTrigger",()=>this._trigger],placement:["nzPlacement",()=>this._placement],visible:["nzVisible",()=>this._visible],mouseEnterDelay:["nzMouseEnterDelay",()=>this._mouseEnterDelay],mouseLeaveDelay:["nzMouseLeaveDelay",()=>this._mouseLeaveDelay],overlayClassName:["nzOverlayClassName",()=>this._overlayClassName],overlayStyle:["nzOverlayStyle",()=>this._overlayStyle],overlayClickable:["nzOverlayClickable",()=>this._overlayClickable],arrowPointAtCenter:["nzArrowPointAtCenter",()=>this.arrowPointAtCenter]},this.getProxyPropertyMap());(e||Object.keys(t).filter(n=>!n.startsWith("directive"))).forEach(n=>{if(t[n]){let[o,c]=t[n];this.updateComponentValue(o,c());}}),this.component?.updateByDirective();}initProperties(){this.updatePropertiesByKeys();}updateComponentValue(e,t){typeof t<"u"&&(this.component[e]=t);}delayEnterLeave(e,t,n=-1){this.delayTimer?this.clearTogglingTimer():n>0?this.delayTimer=setTimeout(()=>{this.delayTimer=void 0,t?this.show():this.hide();},n*1e3):t&&e?this.show():this.hide();}removeTriggerListeners(){this.triggerDisposables.forEach(e=>e()),this.triggerDisposables.length=0;}clearTogglingTimer(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=void 0);}static \u0275fac=function(t){return new(t||i)(kr(xy))};static \u0275dir=XE({type:i,features:[ly]})}return i})(),mt=(()=>{class i{noAnimation=C(t4,{host:true,optional:true});dir=C(Le$1).valueSignal;cdr=C(z0);elementRef=C(_r);destroyRef=C(at);overlay;nzTitle=null;nzContent=null;nzArrowPointAtCenter=false;nzOverlayClassName;nzOverlayStyle={};nzOverlayClickable=true;nzBackdrop=false;nzMouseEnterDelay;nzMouseLeaveDelay;nzVisibleChange=new re;set nzVisible(e){let t=i9(e);this._visible!==t&&(this._visible=t,this.nzVisibleChange.next(t));}get nzVisible(){return this._visible}_visible=false;set nzTrigger(e){this._trigger=e;}get nzTrigger(){return this._trigger}_trigger="hover";set nzPlacement(e){let t=e.map(n=>r2(_e[n],a2[n]));this._positions=[...t,...Ou];}preferredPlacement="top";origin;_classMap={};_prefix="ant-tooltip";_positions=[...Ou];constructor(){this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzVisible||(this.isEmpty()||(this.nzVisible=true,this.nzVisibleChange.next(true),this.cdr.detectChanges()),this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.getDirection()==="rtl"&&this.overlay.overlayRef.setDirection("ltr"));}hide(){this.nzVisible&&(this.nzVisible=false,this.nzVisibleChange.next(false),this.cdr.detectChanges());}updateByDirective(){this.updateStyles(),this.cdr.detectChanges(),Promise.resolve().then(()=>{this.updatePosition(),this.updateVisibilityByTitle();});}updatePosition(){this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.updatePosition();}onPositionChange(e){this.preferredPlacement=vn(e),this.updateStyles(),this.cdr.detectChanges();}setOverlayOrigin(e){this.origin=e,this.cdr.markForCheck();}onClickOutside(e){if(!this.nzOverlayClickable)return;let t=He(e);!this.origin.nativeElement.contains(t)&&this.nzTrigger!==null&&this.hide();}updateVisibilityByTitle(){this.isEmpty()&&this.hide();}updateStyles(){this._classMap=s(r({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true});}transformClassListToMap(e){let t={};return (e!==null?e.split(/\s+/):[]).forEach(o=>t[o]=true),t}static \u0275fac=function(t){return new(t||i)};static \u0275dir=XE({type:i,viewQuery:function(t,n){if(t&1&&Ih(lt,5),t&2){let o;qD(o=WD())&&(n.overlay=o.first);}}})}return i})();function ut(i){return i instanceof Er?false:i===""||!j3(i)}var nt=(()=>{class i extends mt{_animationPrefix="ant-zoom-big-fast";nzTitle=null;nzTitleContext=null;nzColor;_arrowStyleMap={};_contentStyleMap={};zoomAnimationEnter=s0(()=>`${this._animationPrefix}-enter ${this._animationPrefix}-enter-active`);zoomAnimationLeave=s0(()=>`${this._animationPrefix}-leave ${this._animationPrefix}-leave-active`);isEmpty(){return ut(this.nzTitle)}updateStyles(){let e=this.nzColor&&N7(this.nzColor);this._classMap=s(r({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true,[`${this._prefix}-${this.nzColor}`]:e}),this._contentStyleMap={backgroundColor:this.nzColor&&!e?this.nzColor:null},this._arrowStyleMap={"--antd-arrow-background-color":this.nzColor&&!e?this.nzColor:null};}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sy(i)))(n||i)}})();static \u0275cmp=QE({type:i,selectors:[["nz-tooltip"]],exportAs:["nzTooltipComponent"],features:[eh],decls:2,vars:4,consts:[["overlay","cdkConnectedOverlay"],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","nzArrowPointAtCenter"],[1,"ant-tooltip",3,"nzNoAnimation"],[1,"ant-tooltip-arrow"],[1,"ant-tooltip-content"],[1,"ant-tooltip-inner"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"]],template:function(t,n){t&1&&(nh(0,pt,5,13,"ng-template",1,0,Lw),gh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&ch("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayOpen",n._visible)("cdkConnectedOverlayPositions",n._positions)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[fn,f1,t4,Tt,Ie,gn,Xa],encapsulation:2})}return i})();var dt=["okBtn"],ft=["cancelBtn"];function zt(i,m){i&1&&lh(0,"div",5);}function ht(i,m){if(i&1&&(el(0),lh(1,"nz-icon",17),tl()),i&2){let e=m.$implicit;gI(),ch("nzType",e||"exclamation-circle");}}function vt(i,m){if(i&1&&(_i(0,"span",10),nh(1,ht,2,1,"ng-container",16),Kc()),i&2){let e=VD(2);gI(),ch("nzStringTemplateOutlet",e.nzIcon);}}function yt(i,m){if(i&1&&(el(0),vw(1),tl()),i&2){let e=VD(2);gI(),nl(" ",e.nzTitle," ");}}function gt(i,m){if(i&1){let e=LD();_i(0,"div",4),oi(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationLeave())}),ri(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationEnter())}),bD(1,zt,1,0,"div",5),_i(2,"div",6)(3,"div",7)(4,"div")(5,"div",8)(6,"div",9),bD(7,vt,2,1,"span",10),_i(8,"div",11),nh(9,yt,2,1,"ng-container",12),Kc()(),_i(10,"div",13)(11,"button",14,1),gh("click",function(){Pu(e);let n=VD();return Lu(n.onCancel())}),Bh(13),Rw(14,"nzI18n"),vw(15),Kc(),_i(16,"button",15,2),gh("click",function(){Pu(e);let n=VD();return Lu(n.onConfirm())}),Bh(18),Rw(19,"nzI18n"),vw(20),Kc()()()()()()();}if(i&2){let e=VD();sw(e.nzOverlayStyle),cw(e._classMap),Mh("ant-popover-rtl",e.dir()==="rtl"),ch("cdkTrapFocusAutoCapture",e.nzAutoFocus!==null)("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),_D(e.nzPopconfirmShowArrow?1:-1),gI(6),_D(e.nzIcon!==null?7:-1),gI(2),ch("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext),gI(2),ch("nzDanger",e.nzCancelButtonProps()?.nzDanger)("disabled",e.nzCancelButtonProps()?.nzDisabled),ah("cdkFocusInitial",e.nzAutoFocus==="cancel"||null);let t=e.nzCancelText()||Ow(14,22,"Modal.cancelText");gI(4),nl(" ",t," "),gI(),ch("nzType",e.nzOkButtonProps().nzType)("nzDanger",e.nzOkButtonProps().nzDanger)("nzLoading",e.confirmLoading)("disabled",e.nzOkButtonProps().nzDisabled),ah("cdkFocusInitial",e.nzAutoFocus==="ok"||null);let n=e.nzOkText()||Ow(19,24,"Modal.okText");gI(4),nl(" ",n," ");}}var Ct="popconfirm",Cn=(()=>{let i=tt,m,e=[],t=[],n,o=[],c=[];return class he extends i{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;m=[ut$1()],n=[ut$1()],pT(null,null,m,{kind:"field",name:"nzPopconfirmBackdrop",static:false,private:false,access:{has:a=>"nzPopconfirmBackdrop"in a,get:a=>a.nzPopconfirmBackdrop,set:(a,N)=>{a.nzPopconfirmBackdrop=N;}},metadata:C},e,t),pT(null,null,n,{kind:"field",name:"nzAutofocus",static:false,private:false,access:{has:a=>"nzAutofocus"in a,get:a=>a.nzAutofocus,set:(a,N)=>{a.nzAutofocus=N;}},metadata:C},o,c),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}_nzModuleName=Ct;arrowPointAtCenter;title;titleContext=null;directiveTitle;trigger="click";placement="top";origin;mouseEnterDelay;mouseLeaveDelay;overlayClassName;overlayStyle;visible;nzBeforeConfirm;nzIcon;nzCondition=false;nzPopconfirmShowArrow=true;nzPopconfirmBackdrop=hT(this,e,false);nzAutofocus=(hT(this,t),hT(this,o,null));nzOkText=(hT(this,c),$0(null));nzOkType=$0("primary");nzCancelText=$0(null);nzOkButtonProps=$0(null);nzCancelButtonProps=$0(null);nzOkDisabled=$0(false,{transform:Z0});nzOkDanger=$0(false,{transform:Z0});okButtonProps=Hw(()=>s(r({},this.nzOkButtonProps()),{nzType:this.nzOkButtonProps()?.nzType||this.nzOkType()==="danger"?"primary":this.nzOkType(),nzDanger:this.nzOkDanger()||this.nzOkButtonProps()?.nzDanger||this.nzOkType()==="danger",nzDisabled:this.nzOkDisabled()||this.nzOkButtonProps()?.nzDisabled}));cancelButtonProps=Hw(()=>r({},this.nzCancelButtonProps()));directiveContent=null;content=null;overlayClickable;visibleChange=new Le;nzOnCancel=new Le;nzOnConfirm=new Le;getProxyPropertyMap(){return r({nzOkText:["nzOkText",()=>this.nzOkText],nzCancelText:["nzCancelText",()=>this.nzCancelText],nzOkButtonProps:["nzOkButtonProps",()=>this.okButtonProps],nzCancelButtonProps:["nzCancelButtonProps",()=>this.cancelButtonProps],nzBeforeConfirm:["nzBeforeConfirm",()=>this.nzBeforeConfirm],nzCondition:["nzCondition",()=>this.nzCondition],nzIcon:["nzIcon",()=>this.nzIcon],nzPopconfirmShowArrow:["nzPopconfirmShowArrow",()=>this.nzPopconfirmShowArrow],nzPopconfirmBackdrop:["nzBackdrop",()=>this.nzPopconfirmBackdrop],nzPopconfirmContext:["nzTitleContext",()=>this.titleContext],nzAutoFocus:["nzAutoFocus",()=>this.nzAutofocus]},super.getProxyPropertyMap())}constructor(){super(it);}createComponent(){super.createComponent(),this.component.nzOnCancel.pipe(Rt(this.destroyRef)).subscribe(()=>{this.nzOnCancel.emit();}),this.component.nzOnConfirm.pipe(Rt(this.destroyRef)).subscribe(()=>{this.nzOnConfirm.emit();});}static \u0275fac=function(a){return new(a||he)};static \u0275dir=XE({type:he,selectors:[["","nz-popconfirm",""]],hostVars:2,hostBindings:function(a,N){a&2&&Mh("ant-popover-open",N.visible);},inputs:{arrowPointAtCenter:[2,"nzPopconfirmArrowPointAtCenter","arrowPointAtCenter",Z0],title:[0,"nzPopconfirmTitle","title"],titleContext:[0,"nzPopconfirmTitleContext","titleContext"],directiveTitle:[0,"nz-popconfirm","directiveTitle"],trigger:[0,"nzPopconfirmTrigger","trigger"],placement:[0,"nzPopconfirmPlacement","placement"],origin:[0,"nzPopconfirmOrigin","origin"],mouseEnterDelay:[0,"nzPopconfirmMouseEnterDelay","mouseEnterDelay"],mouseLeaveDelay:[0,"nzPopconfirmMouseLeaveDelay","mouseLeaveDelay"],overlayClassName:[0,"nzPopconfirmOverlayClassName","overlayClassName"],overlayStyle:[0,"nzPopconfirmOverlayStyle","overlayStyle"],visible:[0,"nzPopconfirmVisible","visible"],nzBeforeConfirm:"nzBeforeConfirm",nzIcon:"nzIcon",nzCondition:[2,"nzCondition","nzCondition",Z0],nzPopconfirmShowArrow:[2,"nzPopconfirmShowArrow","nzPopconfirmShowArrow",Z0],nzPopconfirmBackdrop:"nzPopconfirmBackdrop",nzAutofocus:"nzAutofocus",nzOkText:[1,"nzOkText"],nzOkType:[1,"nzOkType"],nzCancelText:[1,"nzCancelText"],nzOkButtonProps:[1,"nzOkButtonProps"],nzCancelButtonProps:[1,"nzCancelButtonProps"],nzOkDisabled:[1,"nzOkDisabled"],nzOkDanger:[1,"nzOkDanger"]},outputs:{visibleChange:"nzPopconfirmVisibleChange",nzOnCancel:"nzOnCancel",nzOnConfirm:"nzOnConfirm"},exportAs:["nzPopconfirm"],features:[eh]})}})(),it=(()=>{class i extends nt{_animationPrefix="ant-zoom-big";okBtn;cancelBtn;nzCondition=false;nzPopconfirmShowArrow=true;nzIcon;nzAutoFocus=null;nzBeforeConfirm=null;nzOkText=qo(null);nzCancelText=qo(null);nzOkButtonProps=qo({nzType:"primary"});nzCancelButtonProps=qo(null);nzOnCancel=new re;nzOnConfirm=new re;_trigger="click";elementFocusedBeforeModalWasOpened=null;document=C(Uo);_prefix="ant-popover";confirmLoading=false;constructor(){super(),this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzCondition?this.onConfirm():(this.capturePreviouslyFocusedElement(),super.show());}hide(){super.hide(),this.restoreFocus();}handleConfirm(){this.nzOnConfirm.next(),super.hide();}onCancel(){this.nzOnCancel.next(),super.hide();}onConfirm(){this.nzBeforeConfirm?(this.confirmLoading=true,this.cdr.markForCheck(),k8(this.nzBeforeConfirm()).pipe(em(),on(Boolean),Ul(()=>{this.confirmLoading=false,this.cdr.markForCheck();})).subscribe(()=>this.handleConfirm())):this.handleConfirm();}capturePreviouslyFocusedElement(){this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement);}restoreFocus(){this.elementFocusedBeforeModalWasOpened?.focus();}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=QE({type:i,selectors:[["nz-popconfirm"]],viewQuery:function(t,n){if(t&1&&Ih(dt,5,_r)(ft,5,_r),t&2){let o;qD(o=WD())&&(n.okBtn=o),qD(o=WD())&&(n.cancelBtn=o);}},exportAs:["nzPopconfirmComponent"],features:[eh],decls:2,vars:5,consts:[["overlay","cdkConnectedOverlay"],["cancelBtn",""],["okBtn",""],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayOpen","nzArrowPointAtCenter"],["cdkTrapFocus","",1,"ant-popover",3,"cdkTrapFocusAutoCapture","nzNoAnimation"],[1,"ant-popover-arrow"],[1,"ant-popover-content"],[1,"ant-popover-inner"],[1,"ant-popover-inner-content"],[1,"ant-popover-message"],[1,"ant-popover-message-icon"],[1,"ant-popover-message-title"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[1,"ant-popover-buttons"],["nz-button","","nzSize","small",3,"click","nzDanger","disabled"],["nz-button","","nzSize","small",3,"click","nzType","nzDanger","nzLoading","disabled"],[4,"nzStringTemplateOutlet"],["nzTheme","fill",3,"nzType"]],template:function(t,n){t&1&&(nh(0,gt,21,26,"ng-template",3,0,Lw),gh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&ch("cdkConnectedOverlayHasBackdrop",n.nzBackdrop)("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayOpen",n._visible)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[fn,f1,gn,Xa,Ts,Vs,t4,Tt,Ie,pt$1,Se,sd,zc,t7,y7,Wy,Uy],encapsulation:2})}return i})(),_n=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=YE({type:i});static \u0275inj=uu({imports:[it]})}return i})();export{Cn as C,_n as _};
|
|
1
|
+
import {ak as YE,al as uu,am as pT,as as hT,a0 as $0,aC as Z0,H as Hw,s,r,aO as Le,u as ue,b5 as XE,bI as eh,a4 as Mh,q as qo,bJ as re,C,bK as Uo,bL as k8,bM as em,bN as on,bO as ql,Q as QE,bP as fn,bQ as f1,bR as gn,bS as Xa,bT as Ts,bU as Vs,bF as t4,az as Tt,aA as Ie,ax as pt$1,ay as Se,c as sd,z as zc,d as t7,Z as y7,bV as Wy,bW as Uy,aK as nh,h as gh,x as ch,aG as Ih,ao as _r,aH as qD,aI as WD,aJ as ut$1,bX as s0,aP as N7,bY as Sy,F as LD,f as _i,bZ as oi,b_ as ri,m as bD,g as Kc,b$ as Bh,R as Rw,v as vw,E as VD,b1 as sw,bp as cw,p as gI,B as _D,a5 as ah,O as Ow,w as nl,c0 as ji,aN as XI,an as kt,b as at,c1 as Wm,c2 as jl,c3 as Kg,c4 as Yg,c5 as kg,c6 as kr,c7 as xy,aB as ly,at as Le$1,aq as z0,c8 as r2,c9 as a2,ca as _e,cb as Ou,cc as vn,cd as He,bz as Er,bb as j3,l as lh,aL as el,aM as tl,ce as i9,P as Ph,bl as Lw,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var lt=["overlay"];function ct(i,m){if(i&1&&(el(0),vw(1),tl()),i&2){let e=VD(2);gI(),Ph(e.nzTitle);}}function pt(i,m){if(i&1){let e=LD();_i(0,"div",2),oi(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationLeave())}),ri(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationEnter())}),lh(1,"div",3),_i(2,"div",4)(3,"div",5),nh(4,ct,2,1,"ng-container",6),Kc()()();}if(i&2){let e=VD();sw(e.nzOverlayStyle),cw(e._classMap),Mh("ant-tooltip-rtl",e.dir()==="rtl"),ch("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),sw(e._arrowStyleMap),gI(2),sw(e._contentStyleMap),gI(),ch("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext);}}var tt=(()=>{class i{componentType;elementRef=C(_r);hostView=C(ji);renderer=C(XI);noAnimation=C(t4,{host:true,optional:true});nzConfigService=C(kt);destroyRef=C(at);platformId=C(Wm);config;visibleChange=new Le;get _title(){return this.title||this.directiveTitle||null}get _content(){return this.content||this.directiveContent||null}get _trigger(){return typeof this.trigger<"u"?this.trigger:"hover"}get _placement(){let e=this.placement;return Array.isArray(e)&&e.length>0?e:typeof e=="string"&&e?[e]:["top"]}get _visible(){return (typeof this.visible<"u"?this.visible:this.internalVisible)||false}get _mouseEnterDelay(){return this.mouseEnterDelay||.15}get _mouseLeaveDelay(){return this.mouseLeaveDelay||.1}get _overlayClassName(){return this.overlayClassName||null}get _overlayStyle(){return this.overlayStyle||null}get _overlayClickable(){return this.overlayClickable??true}internalVisible=false;getProxyPropertyMap(){return {noAnimation:["noAnimation",()=>!!this.noAnimation]}}component;destroy$=new re;triggerDisposables=[];delayTimer;constructor(e){this.componentType=e,this.destroyRef.onDestroy(()=>{this.clearTogglingTimer(),this.removeTriggerListeners();});}ngAfterViewInit(){jl(this.platformId)&&(this.createComponent(),this.registerTriggers());}ngOnChanges(e){let{trigger:t}=e;t&&!t.isFirstChange()&&this.registerTriggers(),this.component&&this.updatePropertiesByChanges(e);}show(){this.component?.show();}hide(){this.component?.hide();}updatePosition(){this.component&&this.component.updatePosition();}createComponent(){let e=this.hostView.createComponent(this.componentType);this.component=e.instance,this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement),e.location.nativeElement),this.component.setOverlayOrigin(this.origin||this.elementRef),this.initProperties();let t=this.component.nzVisibleChange.pipe(Kg());t.pipe(ue(this.destroyRef)).subscribe(n=>{this.internalVisible=n,this.visibleChange.emit(n);}),t.pipe(on(Boolean),Yg(0,kg),on(()=>!!this.component?.overlay?.overlayRef),ue(this.destroyRef)).subscribe(()=>{this.component?.updatePosition();});}registerTriggers(){let e=this.elementRef.nativeElement,t=this.trigger;if(this.removeTriggerListeners(),t==="hover"){let n;this.triggerDisposables.push(this.renderer.listen(e,"mouseenter",()=>{this.delayEnterLeave(true,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(e,"mouseleave",()=>{this.delayEnterLeave(true,false,this._mouseLeaveDelay),this.component?.overlay.overlayRef&&!n&&(n=this.component.overlay.overlayRef.overlayElement,this.triggerDisposables.push(this.renderer.listen(n,"mouseenter",()=>{this.delayEnterLeave(false,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(n,"mouseleave",()=>{this.delayEnterLeave(false,false,this._mouseLeaveDelay);})));}));}else t==="focus"?(this.triggerDisposables.push(this.renderer.listen(e,"focusin",()=>this.show())),this.triggerDisposables.push(this.renderer.listen(e,"focusout",()=>this.hide()))):t==="click"&&this.triggerDisposables.push(this.renderer.listen(e,"click",n=>{n.preventDefault(),this.show();}));}updatePropertiesByChanges(e){this.updatePropertiesByKeys(Object.keys(e));}updatePropertiesByKeys(e){let t=r({title:["nzTitle",()=>this._title],directiveTitle:["nzTitle",()=>this._title],content:["nzContent",()=>this._content],directiveContent:["nzContent",()=>this._content],trigger:["nzTrigger",()=>this._trigger],placement:["nzPlacement",()=>this._placement],visible:["nzVisible",()=>this._visible],mouseEnterDelay:["nzMouseEnterDelay",()=>this._mouseEnterDelay],mouseLeaveDelay:["nzMouseLeaveDelay",()=>this._mouseLeaveDelay],overlayClassName:["nzOverlayClassName",()=>this._overlayClassName],overlayStyle:["nzOverlayStyle",()=>this._overlayStyle],overlayClickable:["nzOverlayClickable",()=>this._overlayClickable],arrowPointAtCenter:["nzArrowPointAtCenter",()=>this.arrowPointAtCenter]},this.getProxyPropertyMap());(e||Object.keys(t).filter(n=>!n.startsWith("directive"))).forEach(n=>{if(t[n]){let[o,c]=t[n];this.updateComponentValue(o,c());}}),this.component?.updateByDirective();}initProperties(){this.updatePropertiesByKeys();}updateComponentValue(e,t){typeof t<"u"&&(this.component[e]=t);}delayEnterLeave(e,t,n=-1){this.delayTimer?this.clearTogglingTimer():n>0?this.delayTimer=setTimeout(()=>{this.delayTimer=void 0,t?this.show():this.hide();},n*1e3):t&&e?this.show():this.hide();}removeTriggerListeners(){this.triggerDisposables.forEach(e=>e()),this.triggerDisposables.length=0;}clearTogglingTimer(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=void 0);}static \u0275fac=function(t){return new(t||i)(kr(xy))};static \u0275dir=XE({type:i,features:[ly]})}return i})(),mt=(()=>{class i{noAnimation=C(t4,{host:true,optional:true});dir=C(Le$1).valueSignal;cdr=C(z0);elementRef=C(_r);destroyRef=C(at);overlay;nzTitle=null;nzContent=null;nzArrowPointAtCenter=false;nzOverlayClassName;nzOverlayStyle={};nzOverlayClickable=true;nzBackdrop=false;nzMouseEnterDelay;nzMouseLeaveDelay;nzVisibleChange=new re;set nzVisible(e){let t=i9(e);this._visible!==t&&(this._visible=t,this.nzVisibleChange.next(t));}get nzVisible(){return this._visible}_visible=false;set nzTrigger(e){this._trigger=e;}get nzTrigger(){return this._trigger}_trigger="hover";set nzPlacement(e){let t=e.map(n=>r2(_e[n],a2[n]));this._positions=[...t,...Ou];}preferredPlacement="top";origin;_classMap={};_prefix="ant-tooltip";_positions=[...Ou];constructor(){this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzVisible||(this.isEmpty()||(this.nzVisible=true,this.nzVisibleChange.next(true),this.cdr.detectChanges()),this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.getDirection()==="rtl"&&this.overlay.overlayRef.setDirection("ltr"));}hide(){this.nzVisible&&(this.nzVisible=false,this.nzVisibleChange.next(false),this.cdr.detectChanges());}updateByDirective(){this.updateStyles(),this.cdr.detectChanges(),Promise.resolve().then(()=>{this.updatePosition(),this.updateVisibilityByTitle();});}updatePosition(){this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.updatePosition();}onPositionChange(e){this.preferredPlacement=vn(e),this.updateStyles(),this.cdr.detectChanges();}setOverlayOrigin(e){this.origin=e,this.cdr.markForCheck();}onClickOutside(e){if(!this.nzOverlayClickable)return;let t=He(e);!this.origin.nativeElement.contains(t)&&this.nzTrigger!==null&&this.hide();}updateVisibilityByTitle(){this.isEmpty()&&this.hide();}updateStyles(){this._classMap=s(r({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true});}transformClassListToMap(e){let t={};return (e!==null?e.split(/\s+/):[]).forEach(o=>t[o]=true),t}static \u0275fac=function(t){return new(t||i)};static \u0275dir=XE({type:i,viewQuery:function(t,n){if(t&1&&Ih(lt,5),t&2){let o;qD(o=WD())&&(n.overlay=o.first);}}})}return i})();function ut(i){return i instanceof Er?false:i===""||!j3(i)}var nt=(()=>{class i extends mt{_animationPrefix="ant-zoom-big-fast";nzTitle=null;nzTitleContext=null;nzColor;_arrowStyleMap={};_contentStyleMap={};zoomAnimationEnter=s0(()=>`${this._animationPrefix}-enter ${this._animationPrefix}-enter-active`);zoomAnimationLeave=s0(()=>`${this._animationPrefix}-leave ${this._animationPrefix}-leave-active`);isEmpty(){return ut(this.nzTitle)}updateStyles(){let e=this.nzColor&&N7(this.nzColor);this._classMap=s(r({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true,[`${this._prefix}-${this.nzColor}`]:e}),this._contentStyleMap={backgroundColor:this.nzColor&&!e?this.nzColor:null},this._arrowStyleMap={"--antd-arrow-background-color":this.nzColor&&!e?this.nzColor:null};}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sy(i)))(n||i)}})();static \u0275cmp=QE({type:i,selectors:[["nz-tooltip"]],exportAs:["nzTooltipComponent"],features:[eh],decls:2,vars:4,consts:[["overlay","cdkConnectedOverlay"],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","nzArrowPointAtCenter"],[1,"ant-tooltip",3,"nzNoAnimation"],[1,"ant-tooltip-arrow"],[1,"ant-tooltip-content"],[1,"ant-tooltip-inner"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"]],template:function(t,n){t&1&&(nh(0,pt,5,13,"ng-template",1,0,Lw),gh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&ch("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayOpen",n._visible)("cdkConnectedOverlayPositions",n._positions)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[fn,f1,t4,Tt,Ie,gn,Xa],encapsulation:2})}return i})();var dt=["okBtn"],ft=["cancelBtn"];function zt(i,m){i&1&&lh(0,"div",5);}function ht(i,m){if(i&1&&(el(0),lh(1,"nz-icon",17),tl()),i&2){let e=m.$implicit;gI(),ch("nzType",e||"exclamation-circle");}}function vt(i,m){if(i&1&&(_i(0,"span",10),nh(1,ht,2,1,"ng-container",16),Kc()),i&2){let e=VD(2);gI(),ch("nzStringTemplateOutlet",e.nzIcon);}}function yt(i,m){if(i&1&&(el(0),vw(1),tl()),i&2){let e=VD(2);gI(),nl(" ",e.nzTitle," ");}}function gt(i,m){if(i&1){let e=LD();_i(0,"div",4),oi(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationLeave())}),ri(function(){Pu(e);let n=VD();return Lu(n.zoomAnimationEnter())}),bD(1,zt,1,0,"div",5),_i(2,"div",6)(3,"div",7)(4,"div")(5,"div",8)(6,"div",9),bD(7,vt,2,1,"span",10),_i(8,"div",11),nh(9,yt,2,1,"ng-container",12),Kc()(),_i(10,"div",13)(11,"button",14,1),gh("click",function(){Pu(e);let n=VD();return Lu(n.onCancel())}),Bh(13),Rw(14,"nzI18n"),vw(15),Kc(),_i(16,"button",15,2),gh("click",function(){Pu(e);let n=VD();return Lu(n.onConfirm())}),Bh(18),Rw(19,"nzI18n"),vw(20),Kc()()()()()()();}if(i&2){let e=VD();sw(e.nzOverlayStyle),cw(e._classMap),Mh("ant-popover-rtl",e.dir()==="rtl"),ch("cdkTrapFocusAutoCapture",e.nzAutoFocus!==null)("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),_D(e.nzPopconfirmShowArrow?1:-1),gI(6),_D(e.nzIcon!==null?7:-1),gI(2),ch("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext),gI(2),ch("nzDanger",e.nzCancelButtonProps()?.nzDanger)("disabled",e.nzCancelButtonProps()?.nzDisabled),ah("cdkFocusInitial",e.nzAutoFocus==="cancel"||null);let t=e.nzCancelText()||Ow(14,22,"Modal.cancelText");gI(4),nl(" ",t," "),gI(),ch("nzType",e.nzOkButtonProps().nzType)("nzDanger",e.nzOkButtonProps().nzDanger)("nzLoading",e.confirmLoading)("disabled",e.nzOkButtonProps().nzDisabled),ah("cdkFocusInitial",e.nzAutoFocus==="ok"||null);let n=e.nzOkText()||Ow(19,24,"Modal.okText");gI(4),nl(" ",n," ");}}var Ct="popconfirm",Cn=(()=>{let i=tt,m,e=[],t=[],n,o=[],c=[];return class he extends i{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;m=[ut$1()],n=[ut$1()],pT(null,null,m,{kind:"field",name:"nzPopconfirmBackdrop",static:false,private:false,access:{has:a=>"nzPopconfirmBackdrop"in a,get:a=>a.nzPopconfirmBackdrop,set:(a,N)=>{a.nzPopconfirmBackdrop=N;}},metadata:C},e,t),pT(null,null,n,{kind:"field",name:"nzAutofocus",static:false,private:false,access:{has:a=>"nzAutofocus"in a,get:a=>a.nzAutofocus,set:(a,N)=>{a.nzAutofocus=N;}},metadata:C},o,c),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}_nzModuleName=Ct;arrowPointAtCenter;title;titleContext=null;directiveTitle;trigger="click";placement="top";origin;mouseEnterDelay;mouseLeaveDelay;overlayClassName;overlayStyle;visible;nzBeforeConfirm;nzIcon;nzCondition=false;nzPopconfirmShowArrow=true;nzPopconfirmBackdrop=hT(this,e,false);nzAutofocus=(hT(this,t),hT(this,o,null));nzOkText=(hT(this,c),$0(null));nzOkType=$0("primary");nzCancelText=$0(null);nzOkButtonProps=$0(null);nzCancelButtonProps=$0(null);nzOkDisabled=$0(false,{transform:Z0});nzOkDanger=$0(false,{transform:Z0});okButtonProps=Hw(()=>s(r({},this.nzOkButtonProps()),{nzType:this.nzOkButtonProps()?.nzType||this.nzOkType()==="danger"?"primary":this.nzOkType(),nzDanger:this.nzOkDanger()||this.nzOkButtonProps()?.nzDanger||this.nzOkType()==="danger",nzDisabled:this.nzOkDisabled()||this.nzOkButtonProps()?.nzDisabled}));cancelButtonProps=Hw(()=>r({},this.nzCancelButtonProps()));directiveContent=null;content=null;overlayClickable;visibleChange=new Le;nzOnCancel=new Le;nzOnConfirm=new Le;getProxyPropertyMap(){return r({nzOkText:["nzOkText",()=>this.nzOkText],nzCancelText:["nzCancelText",()=>this.nzCancelText],nzOkButtonProps:["nzOkButtonProps",()=>this.okButtonProps],nzCancelButtonProps:["nzCancelButtonProps",()=>this.cancelButtonProps],nzBeforeConfirm:["nzBeforeConfirm",()=>this.nzBeforeConfirm],nzCondition:["nzCondition",()=>this.nzCondition],nzIcon:["nzIcon",()=>this.nzIcon],nzPopconfirmShowArrow:["nzPopconfirmShowArrow",()=>this.nzPopconfirmShowArrow],nzPopconfirmBackdrop:["nzBackdrop",()=>this.nzPopconfirmBackdrop],nzPopconfirmContext:["nzTitleContext",()=>this.titleContext],nzAutoFocus:["nzAutoFocus",()=>this.nzAutofocus]},super.getProxyPropertyMap())}constructor(){super(it);}createComponent(){super.createComponent(),this.component.nzOnCancel.pipe(ue(this.destroyRef)).subscribe(()=>{this.nzOnCancel.emit();}),this.component.nzOnConfirm.pipe(ue(this.destroyRef)).subscribe(()=>{this.nzOnConfirm.emit();});}static \u0275fac=function(a){return new(a||he)};static \u0275dir=XE({type:he,selectors:[["","nz-popconfirm",""]],hostVars:2,hostBindings:function(a,N){a&2&&Mh("ant-popover-open",N.visible);},inputs:{arrowPointAtCenter:[2,"nzPopconfirmArrowPointAtCenter","arrowPointAtCenter",Z0],title:[0,"nzPopconfirmTitle","title"],titleContext:[0,"nzPopconfirmTitleContext","titleContext"],directiveTitle:[0,"nz-popconfirm","directiveTitle"],trigger:[0,"nzPopconfirmTrigger","trigger"],placement:[0,"nzPopconfirmPlacement","placement"],origin:[0,"nzPopconfirmOrigin","origin"],mouseEnterDelay:[0,"nzPopconfirmMouseEnterDelay","mouseEnterDelay"],mouseLeaveDelay:[0,"nzPopconfirmMouseLeaveDelay","mouseLeaveDelay"],overlayClassName:[0,"nzPopconfirmOverlayClassName","overlayClassName"],overlayStyle:[0,"nzPopconfirmOverlayStyle","overlayStyle"],visible:[0,"nzPopconfirmVisible","visible"],nzBeforeConfirm:"nzBeforeConfirm",nzIcon:"nzIcon",nzCondition:[2,"nzCondition","nzCondition",Z0],nzPopconfirmShowArrow:[2,"nzPopconfirmShowArrow","nzPopconfirmShowArrow",Z0],nzPopconfirmBackdrop:"nzPopconfirmBackdrop",nzAutofocus:"nzAutofocus",nzOkText:[1,"nzOkText"],nzOkType:[1,"nzOkType"],nzCancelText:[1,"nzCancelText"],nzOkButtonProps:[1,"nzOkButtonProps"],nzCancelButtonProps:[1,"nzCancelButtonProps"],nzOkDisabled:[1,"nzOkDisabled"],nzOkDanger:[1,"nzOkDanger"]},outputs:{visibleChange:"nzPopconfirmVisibleChange",nzOnCancel:"nzOnCancel",nzOnConfirm:"nzOnConfirm"},exportAs:["nzPopconfirm"],features:[eh]})}})(),it=(()=>{class i extends nt{_animationPrefix="ant-zoom-big";okBtn;cancelBtn;nzCondition=false;nzPopconfirmShowArrow=true;nzIcon;nzAutoFocus=null;nzBeforeConfirm=null;nzOkText=qo(null);nzCancelText=qo(null);nzOkButtonProps=qo({nzType:"primary"});nzCancelButtonProps=qo(null);nzOnCancel=new re;nzOnConfirm=new re;_trigger="click";elementFocusedBeforeModalWasOpened=null;document=C(Uo);_prefix="ant-popover";confirmLoading=false;constructor(){super(),this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzCondition?this.onConfirm():(this.capturePreviouslyFocusedElement(),super.show());}hide(){super.hide(),this.restoreFocus();}handleConfirm(){this.nzOnConfirm.next(),super.hide();}onCancel(){this.nzOnCancel.next(),super.hide();}onConfirm(){this.nzBeforeConfirm?(this.confirmLoading=true,this.cdr.markForCheck(),k8(this.nzBeforeConfirm()).pipe(em(),on(Boolean),ql(()=>{this.confirmLoading=false,this.cdr.markForCheck();})).subscribe(()=>this.handleConfirm())):this.handleConfirm();}capturePreviouslyFocusedElement(){this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement);}restoreFocus(){this.elementFocusedBeforeModalWasOpened?.focus();}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=QE({type:i,selectors:[["nz-popconfirm"]],viewQuery:function(t,n){if(t&1&&Ih(dt,5,_r)(ft,5,_r),t&2){let o;qD(o=WD())&&(n.okBtn=o),qD(o=WD())&&(n.cancelBtn=o);}},exportAs:["nzPopconfirmComponent"],features:[eh],decls:2,vars:5,consts:[["overlay","cdkConnectedOverlay"],["cancelBtn",""],["okBtn",""],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayOpen","nzArrowPointAtCenter"],["cdkTrapFocus","",1,"ant-popover",3,"cdkTrapFocusAutoCapture","nzNoAnimation"],[1,"ant-popover-arrow"],[1,"ant-popover-content"],[1,"ant-popover-inner"],[1,"ant-popover-inner-content"],[1,"ant-popover-message"],[1,"ant-popover-message-icon"],[1,"ant-popover-message-title"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[1,"ant-popover-buttons"],["nz-button","","nzSize","small",3,"click","nzDanger","disabled"],["nz-button","","nzSize","small",3,"click","nzType","nzDanger","nzLoading","disabled"],[4,"nzStringTemplateOutlet"],["nzTheme","fill",3,"nzType"]],template:function(t,n){t&1&&(nh(0,gt,21,26,"ng-template",3,0,Lw),gh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&ch("cdkConnectedOverlayHasBackdrop",n.nzBackdrop)("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayOpen",n._visible)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[fn,f1,gn,Xa,Ts,Vs,t4,Tt,Ie,pt$1,Se,sd,zc,t7,y7,Wy,Uy],encapsulation:2})}return i})(),_n=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=YE({type:i});static \u0275inj=uu({imports:[it]})}return i})();export{Cn as C,_n as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {J,K as K$1}from'./chunk
|
|
1
|
+
import {J,K as K$1}from'./chunk-Dqtz3Iow.js';import {U}from'./chunk-MRIst_Tv.js';import {C,U as U$1,T as Ie,V as Ve,a as ae,q as qo,H as Hw,s,r,o,Q as QE,M as Mi,L as Ln,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,h as gh,N as ND,p as gI,P as Ph,O as Ow,B as _D,w as nl,x as ch,A as xD,E as VD,W as Lh,F as LD,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var L=(t,p)=>p.id;function $(t,p){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function z(t,p){if(t&1&&(_i(0,"option",6),vw(1),Kc()),t&2){let e=p.$implicit;ch("value",e.id),gI(),Lh("",e.name," (",e.id,")");}}function H(t,p){if(t&1){let e=LD();_i(0,"label"),vw(1),Rw(2,"transloco"),_i(3,"input",10),Rw(4,"transloco"),gh("input",function(o){Pu(e);let s=VD(2);return Lu(s.setSubjectId(o))}),Kc()();}if(t&2){let e=VD(2);gI(),nl(" ",Ow(2,3,"jobs.start.subjectId")," "),gI(2),ch("value",e.subjectId())("placeholder",Ow(4,5,"jobs.start.subjectIdPlaceholder"));}}function G(t,p){if(t&1){let e=LD();bD(0,H,5,7,"label"),_i(1,"app-workflow-input-form",9),gh("valuesChange",function(o){Pu(e);let s=VD();return Lu(s.inputValues.set(o))}),Kc();}if(t&2){let e=VD();_D(e.needsSubjectId()?0:-1),gI(),ch("fields",p.inputSchema)("values",e.inputValues());}}function K(t,p){if(t&1&&(_i(0,"p",8),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.actionError());}}var re=(()=>{class t{constructor(){this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(Ie),this.transloco=C(Ve),this.route=C(ae),this.workflows=qo([]),this.selectedWorkflowId=qo(""),this.subjectId=qo(""),this.inputValues=qo({}),this.loadError=qo(null),this.actionError=qo(null),this.starting=qo(false),this.selectedWorkflow=Hw(()=>this.workflows().find(e=>e.id===this.selectedWorkflowId())??null),this.needsSubjectId=Hw(()=>{let e=this.selectedWorkflow();return e!=null&&e.appliesTo!=="none"}),this.workflowsApi.list({subjectHandling:"per-subject"}).subscribe({next:e=>{this.workflows.set(e);let n=this.route.snapshot.queryParamMap.get("workflowId"),o=n&&e.some(C=>C.id===n)?n:e[0]?.id;o&&this.selectWorkflow(o);let s=this.route.snapshot.queryParamMap.get("subjectId");s&&this.subjectId.set(s);},error:e=>{this.loadError.set(this.errorMessage(e,this.transloco.translate("jobs.errors.loadWorkflows")));}});}selectWorkflow(e){this.selectedWorkflowId.set(e);let n=this.workflows().find(o=>o.id===e);this.inputValues.set(J(n?.inputSchema??[])),this.actionError.set(null);}onWorkflowChange(e){let n=e.target.value;this.selectWorkflow(n);}setSubjectId(e){this.subjectId.set(e.target.value);}start(){let e=this.selectedWorkflow();if(e){if(this.needsSubjectId()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r({workflowId:e.id},this.needsSubjectId()?{subjectId:this.subjectId().trim()}:{}),{inputValues:r({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}}errorMessage(e,n){return e instanceof o||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-runner"]],decls:26,vars:23,consts:[[1,"runner"],["routerLink","/jobs"],[1,"lede"],["data-testid","load-error",1,"error"],["data-testid","start-form",1,"panel"],["data-testid","workflow-select",3,"change","value"],[3,"value"],["data-testid","start-button","type","button",3,"click","disabled"],["data-testid","action-error",1,"error"],[3,"valuesChange","fields","values"],["data-testid","subject-id","type","text",3,"input","value","placeholder"]],template:function(n,o){if(n&1&&(_i(0,"main",0)(1,"a",1),vw(2),Rw(3,"transloco"),Kc(),_i(4,"h1"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"p",2),vw(8),Rw(9,"transloco"),Kc(),bD(10,$,2,1,"p",3),_i(11,"section",4)(12,"h2"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"label"),vw(16),Rw(17,"transloco"),_i(18,"select",5),gh("change",function(C){return o.onWorkflowChange(C)}),ND(19,z,2,3,"option",6,L),Kc()(),bD(21,G,2,3),_i(22,"button",7),gh("click",function(){return o.start()}),vw(23),Rw(24,"transloco"),Kc()(),bD(25,K,2,1,"p",8),Kc()),n&2){let s;gI(2),Ph(Ow(3,11,"jobs.detail.backToStart")),gI(3),Ph(Ow(6,13,"jobs.title")),gI(3),Ph(Ow(9,15,"jobs.lede")),gI(2),_D(o.loadError()?10:-1),gI(3),Ph(Ow(14,17,"jobs.start.heading")),gI(3),nl(" ",Ow(17,19,"jobs.start.workflow")," "),gI(2),ch("value",o.selectedWorkflowId()),gI(),xD(o.workflows()),gI(2),_D((s=o.selectedWorkflow())?21:-1,s),gI(),ch("disabled",o.starting()),gI(),nl(" ",Ow(24,21,o.starting()?"jobs.start.starting":"jobs.start.button")," "),gI(2),_D(o.actionError()?25:-1);}},dependencies:[Mi,Ln,K$1,Kt],styles:[".runner[_ngcontent-%COMP%]{max-width:52rem;margin:0 auto;padding:1.5rem;color:#1c1917;line-height:1.45}.lede[_ngcontent-%COMP%]{color:#57534e}.panel[_ngcontent-%COMP%]{margin-top:1.25rem;padding:1rem 0;border-top:1px solid #d6d3d1}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}button[_ngcontent-%COMP%]{font:inherit;margin-top:.5rem;padding:.45rem .9rem;border:1px solid #44403c;background:#f5f5f4;cursor:pointer}button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{re as JobRunnerComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {_ as _n}from'./chunk-Cuaj1Fgz.js';import {w as we}from'./chunk-BYIP8zBR.js';import {C,af as u,U as U$1,T as Ie,V as Ve,b as at,q as qo,H as Hw,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,h as gh,x as ch,G as Pu,I as Lu}from'./main-R7YQQZVK.js';import {U}from'./chunk-MRIst_Tv.js';import'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';function q(i,b){i&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function G(i,b){if(i&1&&(_i(0,"p",4),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function H(i,b){if(i&1&&(_i(0,"p",5),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function K(i,b){i&1&&(_i(0,"section",6)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",8),vw(5),Rw(6,"transloco"),Kc()()),i&2&&(gI(2),Ph(Ow(3,2,"shortcuts.list.emptyState")),gI(3),nl(" ",Ow(6,4,"shortcuts.list.emptyCreateButton")," "));}function Q(i,b){if(i&1){let t=LD();_i(0,"app-runnable-items-table",9),gh("rowAction",function(e){Pu(t);let c=VD(2);return Lu(c.onRowAction(e))}),Kc();}if(i&2){let t=VD(2);ch("rows",t.rows())("selectable",false)("showRowAction",true);}}function X(i,b){if(i&1&&(bD(0,H,2,1,"p",5),bD(1,K,7,6,"section",6)(2,Q,1,3,"app-runnable-items-table",7)),i&2){let t=VD();_D(t.actionError()?0:-1),gI(),_D(t.shortcuts().length===0?1:2);}}var ht=(()=>{class i{constructor(){this.shortcutsApi=C(u),this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(Ie),this.transloco=C(Ve),this.destroyRef=C(at),this.shortcuts=qo([]),this.workflows=qo([]),this.jobsById=qo({}),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.rows=Hw(()=>{let t=this.jobsById(),o=this.workflows();return this.shortcuts().map(e=>({id:e.id,primaryLabel:e.name,subtitle:o.find(c=>c.id===e.workflowId)?.name,latestJob:e.lastJobId?t[e.lastJobId]??null:null}))}),this.load();}onRowAction(t){let o=this.shortcuts().find(e=>e.id===t);o&&(this.actionError.set(null),this.jobsApi.start({workflowId:o.workflowId,inputValues:o.inputValues}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.shortcutsApi.update(o.id,{lastJobId:e.id}).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.shortcuts.update(W=>W.map(C=>C.id===c.id?c:C)),this.router.navigate(["/jobs",e.id]);},error:()=>{this.router.navigate(["/jobs",e.id]);}});},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("shortcuts.list.runFailed")));}}));}deleteShortcut(t){this.actionError.set(null),this.shortcutsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.shortcuts.update(o=>o.filter(e=>e.id!==t));},error:o=>{this.actionError.set(this.errorMessage(o,this.transloco.translate("shortcuts.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({shortcuts:t,workflows:o})=>{this.shortcuts.set(t),this.workflows.set(o),this.loading.set(false),this.loadLatestJobs(t);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("shortcuts.list.loadFailed")));}});}loadLatestJobs(t){let o=t.map(e=>e.lastJobId).filter(e=>e!=null);if(o.length===0){this.jobsById.set({});return}Ng(Object.fromEntries(o.map(e=>[e,this.jobsApi.get(e)]))).pipe(ue(this.destroyRef)).subscribe({next:e=>this.jobsById.set(e),error:()=>this.jobsById.set({})});}errorMessage(t,o$1){return t instanceof o||t instanceof Error?t.message:o$1}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-shortcut-list"]],decls:11,vars:7,consts:[["data-testid","shortcuts-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","empty-state",1,"empty"],[3,"rows","selectable","showRowAction"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","empty-create"],[3,"rowAction","rows","selectable","showRowAction"]],template:function(o,e){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,q,3,3,"p",3)(9,G,2,1,"p",4)(10,X,3,2),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"shortcuts.list.title")),gI(3),nl(" ",Ow(7,5,"shortcuts.list.createButton")," "),gI(2),_D(e.loading()?8:e.loadError()?9:10));},dependencies:[Mi,Ln,sd,zc,t7,_n,we,Kt],styles:[".list-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}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{ht as ShortcutListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {w as we}from'./chunk-BYIP8zBR.js';import {C,a as ae$1,T as Ie,ae as U,U as U$3,V as Ve,b as at,q as qo,H as Hw,u as ue$1,r,a9 as Ng,ab as Dg,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,v as vw,R as Rw,P as Ph,O as Ow,E as VD,F as LD,h as gh,x as ch,a3 as xw,w as nl,G as Pu,I as Lu,l as lh}from'./main-R7YQQZVK.js';import {J,K}from'./chunk-Dqtz3Iow.js';import {G as Gn,u as un}from'./chunk-bi3jOaJV.js';import {U as U$1}from'./chunk-MRIst_Tv.js';import {U as U$2}from'./chunk-BiLgez1m.js';import'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';var te=i=>["/views",i,"edit"],ie=i=>["/batches",i];function ne(i,c){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function oe(i,c){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function ae(i,c){i&1&&(_i(0,"span",8),vw(1),Kc()),i&2&&(gI(),Ph(c.name));}function le(i,c){i&1&&(_i(0,"a",16),vw(1),Rw(2,"transloco"),Kc()),i&2&&(ch("routerLink",xw(4,ie,c)),gI(),nl(" ",Ow(2,2,"views.detail.openBatch")," "));}function re(i,c){if(i&1&&(lh(0,"nz-alert",15),bD(1,le,3,6,"a",16)),i&2){let e,t=VD(2);ch("nzMessage",t.confirmation()),gI(),_D((e=t.confirmationBatchId())?1:-1,e);}}function se(i,c){i&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"views.detail.noBulkWorkflows")," "));}function ce(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.launchError());}}function de(i,c){if(i&1){let e=LD();_i(0,"p",18),vw(1),Kc(),_i(2,"app-workflow-input-form",19),gh("valuesChange",function(o){Pu(e);let l=VD(3);return Lu(l.setInputValues(o))}),Kc(),bD(3,ce,2,1,"p",20),_i(4,"div",21)(5,"button",22),gh("click",function(){Pu(e);let o=VD(3);return Lu(o.launch())}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",23),gh("click",function(){Pu(e);let o=VD(3);return Lu(o.cancelLaunch())}),vw(9),Rw(10,"transloco"),Kc()();}if(i&2){let e=c,t=VD(3);gI(),Ph(e.name),gI(),ch("fields",e.inputSchema)("values",t.inputValues()),gI(),_D(t.launchError()?3:-1),gI(2),ch("nzLoading",t.launching())("disabled",t.launching()),gI(),nl(" ",Ow(7,8,t.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),nl(" ",Ow(10,10,"views.detail.cancelLaunch")," ");}}function ue(i,c){if(i&1&&(_i(0,"section",12)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),bD(4,se,3,3,"p",17)(5,de,11,12),Kc()),i&2){let e,t=VD(2);gI(2),nl(" ",Ow(3,2,c==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),_D(t.canBulkLaunch()?(e=t.boundWorkflow())?5:-1:4,e);}}function pe(i,c){i&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"views.detail.emptySubjects")));}function me(i,c){if(i&1){let e=LD();_i(0,"app-runnable-items-table",24),gh("rowAction",function(o){Pu(e);let l=VD(2);return Lu(l.onRowAction(o))})("bulkAction",function(o){Pu(e);let l=VD(2);return Lu(l.onBulkAction(o))}),Kc();}if(i&2){let e=VD(2);ch("rows",e.rows())("selectable",true)("showRowAction",e.showRowAction());}}function he(i,c){if(i&1){let e=LD();_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"span",7),vw(9),Rw(10,"transloco"),Kc(),bD(11,ae,2,1,"span",8),Kc()(),_i(12,"a",9),vw(13),Rw(14,"transloco"),Kc()(),_i(15,"section",10)(16,"button",11),gh("click",function(){Pu(e);let o=VD();return Lu(o.beginLaunch("view"))}),vw(17),Rw(18,"transloco"),Kc()(),bD(19,re,2,2),bD(20,ue,6,4,"section",12),bD(21,pe,3,3,"p",13)(22,me,1,3,"app-runnable-items-table",14);}if(i&2){let e,t,o=c,l=VD();gI(3),Ph(Ow(4,11,"views.detail.backToList")),gI(3),Ph(o.name),gI(3),Ph(Ow(10,13,l.subjectTypeKey(o.subjectType))),gI(2),_D((e=l.boundWorkflow())?11:-1,e),gI(),ch("routerLink",xw(19,te,o.id)),gI(),nl(" ",Ow(14,15,"views.detail.edit")," "),gI(3),ch("disabled",!l.canBulkLaunch()),gI(),nl(" ",Ow(18,17,"views.detail.runOnAll")," "),gI(2),_D(l.confirmation()?19:-1),gI(),_D((t=l.launchMode())?20:-1,t),gI(),_D(l.subjects().length===0?21:22);}}var Ne=(()=>{class i{constructor(){this.route=C(ae$1),this.router=C(Ie),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.batchesApi=C(U$2),this.jobsApi=C(U$3),this.transloco=C(Ve),this.destroyRef=C(at),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Hw(()=>{let e=this.view();return e?this.workflows().find(t=>t.id===e.workflowId)??null:null}),this.canBulkLaunch=Hw(()=>this.boundWorkflow()!=null),this.showRowAction=Hw(()=>this.boundWorkflow()?.subjectHandling==="per-subject"),this.rows=Hw(()=>{let e=this.latestBySubject();return this.subjects().map(t=>({id:t.id,primaryLabel:t.title,subtitle:this.subjectDetails(t),latestJob:e[t.id]??null}))}),this.route.paramMap.pipe(ue$1(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??""}onBulkAction(e){this.selectedIds.set(e),this.beginLaunch("manual");}onRowAction(e){let t=this.view();t&&this.router.navigate(["/jobs/new"],{queryParams:{workflowId:t.workflowId,subjectId:e}});}beginLaunch(e){e==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(e),this.inputValues.set(J(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(e){this.inputValues.set(e);}launch(){let e=this.view(),t=this.boundWorkflow(),o=this.launchMode();if(!e||!t||!o)return;let l=o==="view"?{mode:"view",viewId:e.id}:{mode:"manual",subjectType:e.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:t.id,selection:l,triggeredBy:o==="view"?"view_bulk":"multiselect",inputValues:r({},this.inputValues())}).pipe(ue$1(this.destroyRef)).subscribe({next:v=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(v)),this.confirmationBatchId.set(v.kind==="batch"?v.batch.id:null),this.launchMode.set(null),this.refreshLatest(e.workflowId,this.subjects().map(ee=>ee.id));},error:v=>{this.launching.set(false),this.launchError.set(this.errorMessage(v,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.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(e),subjects:this.viewsApi.getSubjects(e),workflows:this.workflowsApi.list()}).pipe(ue$1(this.destroyRef)).subscribe({next:({view:t,subjects:o,workflows:l})=>{this.view.set(t),this.subjects.set(o),this.workflows.set(l),this.loading.set(false),this.refreshLatest(t.workflowId,o.map(v=>v.id));},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(e,t){(t.length===0?Dg({}):this.jobsApi.latestBySubject(e,t)).pipe(ue$1(this.destroyRef)).subscribe({next:l=>this.latestBySubject.set(l),error:()=>this.latestBySubject.set({})});}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=QE({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"],["data-testid","bound-workflow"],["nz-button","","data-testid","edit-view",3,"routerLink"],[1,"toolbar"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable","showRowAction"],["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","launch-workflow",1,"muted"],[3,"valuesChange","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,"rowAction","bulkAction","rows","selectable","showRowAction"]],template:function(t,o){if(t&1&&(_i(0,"main",0),bD(1,ne,3,3,"p",1)(2,oe,2,1,"p",2)(3,he,23,21),Kc()),t&2){let l;gI(),_D(o.loading()?1:o.loadError()?2:(l=o.view())?3:-1,l);}},dependencies:[Mi,Ln,Gn,un,sd,zc,t7,y7,K,we,Kt],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{Ne as ViewDetailComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {ak as YE,al as uu,C,ap as oe$1,ao as _r,aq as z0,ar as a3,at as Le,b as at,cH as A,ba as ga,aO as Le$1,X as rd,u as ue$1,av as St,Q as QE,n as n8,cZ as w0,J as J6,k as k3,aC as Z0,aR as BD,f as _i,h as gh,g as Kc,j as oE,l as lh,aS as $D,a4 as Mh,p as gI,x as ch,a5 as ah,y as sE,aD as Sw,aE as h1,aF as wo,aG as Ih,aH as qD,aI as WD,a0 as $0,q as qo,bd as Uw,H as Hw,bi as Kf,Y as Bw,N as ND,E as VD,A as xD,v as vw,w as nl}from'./main-R7YQQZVK.js';var re=["inputElement"],te=["*"],ae=(t,s)=>s.value;function ce(t,s){if(t&1&&(_i(0,"label",0),vw(1),Kc()),t&2){let e=s.$implicit,i=VD(2);ch("nzValue",e.value)("nzName",i.nzName())("nzDisabled",e.disabled||i.finalDisabled()),gI(),nl(" ",e.label," ");}}function le(t,s){if(t&1&&ND(0,ce,2,4,"label",0,ae),t&2){let e=VD();xD(e.normalizedOptions());}}var ie=new A(""),oe=(()=>{class t{ngZone=C(oe$1);elementRef=C(_r);cdr=C(z0);focusMonitor=C(a3);dir=C(Le).valueSignal;destroyRef=C(at);checkboxGroupComponent=C(ie,{optional:true});nzFormStatusService=C(ga,{optional:true});isNzDisableFirstChange=true;onChange=()=>{};onTouched=()=>{};inputElement;nzCheckedChange=new Le$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&&rd(()=>{let e=this.checkboxGroupComponent.value()||[];this.setValue(e.includes(this.nzValue)),this.cdr.markForCheck();});}ngOnInit(){this.focusMonitor.monitor(this.elementRef,true).pipe(ue$1(this.destroyRef)).subscribe(e=>{e||Promise.resolve().then(()=>this.onTouched());}),St(this.elementRef.nativeElement,"click").pipe(ue$1(this.destroyRef)).subscribe(e=>{e.preventDefault(),this.focus(),!this.nzDisabled&&this.ngZone.run(()=>{this.innerCheckedChange(!this.nzChecked),this.cdr.markForCheck();});}),St(this.inputElement.nativeElement,"click").pipe(ue$1(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=QE({type:t,selectors:[["","nz-checkbox",""]],viewQuery:function(i,n){if(i&1&&Ih(re,7),i&2){let r;qD(r=WD())&&(n.inputElement=r.first);}},hostAttrs:[1,"ant-checkbox-wrapper"],hostVars:10,hostBindings:function(i,n){i&2&&Mh("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",Z0],nzDisabled:[2,"nzDisabled","nzDisabled",Z0],nzIndeterminate:[2,"nzIndeterminate","nzIndeterminate",Z0],nzChecked:[2,"nzChecked","nzChecked",Z0],nzId:"nzId",nzName:"nzName"},outputs:{nzCheckedChange:"nzCheckedChange"},exportAs:["nzCheckbox"],features:[Sw([{provide:h1,useExisting:wo(()=>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&&(BD(),_i(0,"span",1)(1,"input",2,0),gh("ngModelChange",function(se){return n.innerCheckedChange(se)}),Kc(),oE(),lh(3,"span",3),Kc(),_i(4,"span"),$D(5),Kc()),i&2&&(Mh("ant-checkbox-checked",n.nzChecked&&!n.nzIndeterminate)("ant-checkbox-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-indeterminate",n.nzIndeterminate),gI(),ch("checked",n.nzChecked)("ngModel",n.nzChecked)("disabled",n.nzDisabled||(n.checkboxGroupComponent?.finalDisabled()??false)),ah("autofocus",n.nzAutoFocus?"autofocus":null)("id",n.nzId)("name",n.nzName||n.checkboxGroupComponent?.nzName()),sE());},dependencies:[n8,w0,J6,k3],encapsulation:2})}return t})(),ue=(()=>{class t{onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;dir=C(Le).valueSignal;nzName=$0(null);nzDisabled=$0(false,{transform:Z0});nzOptions=$0([]);value=qo(null);finalDisabled=Uw(()=>this.nzDisabled());normalizedOptions=Hw(()=>de(this.nzOptions()));constructor(){let e=C(_r),i=C(a3),n=C(at);Kf(()=>{i.monitor(e,true).pipe(ue$1(n)).subscribe(r=>{r||this.onTouched();}),n.onDestroy(()=>{i.stopMonitoring(e);});});}writeValue(e){Bw(()=>{this.value.set(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Bw(()=>{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=QE({type:t,selectors:[["nz-checkbox-group"]],hostAttrs:[1,"ant-checkbox-group"],hostVars:2,hostBindings:function(i,n){i&2&&Mh("ant-checkbox-group-rtl",n.dir()==="rtl");},inputs:{nzName:[1,"nzName"],nzDisabled:[1,"nzDisabled"],nzOptions:[1,"nzOptions"]},exportAs:["nzCheckboxGroup"],features:[Sw([{provide:h1,useExisting:wo(()=>t),multi:true},{provide:ie,useExisting:wo(()=>t)}])],ngContentSelectors:te,decls:2,vars:0,consts:[["nz-checkbox","",3,"nzValue","nzName","nzDisabled"]],template:function(i,n){i&1&&(BD(),$D(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=YE({type:t});static \u0275inj=uu({imports:[oe,ue]})}return t})();export{Fe as F,oe as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {T}from'./chunk-BnnoOI-1.js';import {S as Sk,a as vx,u as uk,I as Ie$1}from'./chunk-BIFLxIMS.js';import {C,a as ae,T as Ie,af as u,b as at,V as Ve,aY as O,aZ as de,ai as Se,q as qo,H as Hw,u as ue$1,r,o,Q as QE,M as Mi,n as n8,aj as S4,J as J6,k as k3,L as Ln,c as sd,z as zc,d as t7,Z as y7,$ as $b,e as V5,D as D5,K as Kt,f as _i,v as vw,g as Kc,R as Rw,h as gh,m as bD,p as gI,P as Ph,O as Ow,x as ch,w as nl,B as _D,E as VD,F as LD,j as oE,N as ND,y as sE,A as xD,S as SD,l as lh,G as Pu,I as Lu}from'./main-R7YQQZVK.js';import {J,K}from'./chunk-Dqtz3Iow.js';import {U}from'./chunk-MRIst_Tv.js';import'./chunk-Xv2Lx0k9.js';var me=(t,s)=>s.id;function ue(t,s){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function he(t,s){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,s){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=s.$implicit;gI(),Ph(e);}}function ge(t,s){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,fe,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"shortcuts.editor.validation")),gI(3),xD(e.validationErrors());}}function _e(t,s){if(t&1&&lh(0,"nz-option",11),t&2){let e=s.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=LD();_i(0,"app-workflow-input-form",13),gh("valuesChange",function(i){Pu(e);let u=VD(2);return Lu(u.setInputValues(i))}),Kc();}if(t&2){let e=VD(2);ch("fields",s.inputSchema)("values",e.inputValues());}}function ve(t,s){if(t&1){let e=LD();bD(0,ge,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.name.set(i))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.onWorkflowChange(i))}),ND(11,_e,1,2,"nz-option",11,me),Kc(),oE(),Kc(),bD(13,we,1,2,"app-workflow-input-form",12);}if(t&2){let e,o=VD();_D(o.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,6,"shortcuts.editor.name")),gI(2),ch("ngModel",o.name()),sE(),gI(3),Ph(Ow(9,8,"shortcuts.editor.workflow")),gI(2),ch("ngModel",o.workflowId()),sE(),gI(),xD(o.eligibleWorkflows()),gI(2),_D((e=o.selectedWorkflow())?13:-1,e);}}function Ce(t){let s=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return s.length>0?`sc-${s}-${e}`:`sc-${e}`}var He=(()=>{class t{constructor(){this.route=C(ae),this.router=C(Ie),this.shortcutsApi=C(u),this.workflowsApi=C(U),this.message=C(Sk),this.destroyRef=C(at),this.transloco=C(Ve),this.language=C(O),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.inputValues=qo({}),this.lastJobId=qo(void 0),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{id:this.routeId()}))),this.eligibleWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.subjectHandling==="per-subject")),this.selectedWorkflow=Hw(()=>this.eligibleWorkflows().find(e=>e.id===this.workflowId())??null),this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("shortcuts.editor.loadFailed")));}}),this.route.paramMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let o=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),!o){this.name.set(""),this.workflowId.set(""),this.inputValues.set({}),this.lastJobId.set(void 0),this.loading.set(false);return}this.loading.set(true),this.shortcutsApi.get(o).subscribe({next:i=>{this.name.set(i.name),this.workflowId.set(i.workflowId),this.inputValues.set(i.inputValues),this.lastJobId.set(i.lastJobId),this.loading.set(false);},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("shortcuts.editor.loadFailed")));}});});}onWorkflowChange(e){this.workflowId.set(e);let o=this.eligibleWorkflows().find(i=>i.id===e);this.inputValues.set(J(o?.inputSchema??[]));}setInputValues(e){this.inputValues.set(e);}save(){let e=this.routeId(),o=r({id:e??Ce(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=vx.safeParse(o);if(!i.success){this.validationErrors.set(T(i.error));return}this.validationErrors.set([]),this.saving.set(true),(this.isNew()||!e?this.shortcutsApi.create(i.data):this.shortcutsApi.update(e,i.data)).subscribe({next:M=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"shortcuts.editor.created":"shortcuts.editor.saved")),this.isNew()&&this.router.navigate(["/shortcuts",M.id,"edit"]);},error:M=>{this.saving.set(false),this.message.error(this.errorMessage(M,this.transloco.translate("shortcuts.editor.saveFailed")));}});}errorMessage(e,o$1){return e instanceof o||e instanceof Error?e.message:o$1}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-shortcut-editor"]],decls:15,vars:10,consts:[["data-testid","shortcut-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/shortcuts"],["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","shortcut-name",3,"ngModelChange","ngModel"],["data-testid","shortcut-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"fields","values"],[3,"valuesChange","fields","values"]],template:function(o,i){o&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return i.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,ue,3,3,"p",5)(13,he,2,1,"p",6)(14,ve,14,10),Kc()),o&2&&(gI(4),Ph(i.pageTitle()),gI(3),Ph(Ow(8,6,"shortcuts.editor.backToList")),gI(2),ch("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(i.loading()?12:i.loadError()?13:14));},dependencies:[Mi,n8,S4,J6,k3,Ln,sd,zc,t7,y7,uk,Ie$1,$b,V5,D5,K,Kt],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}.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}"]});}}return t})();export{He as ShortcutEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ak as YE,al as uu,C,aN as XI,ao as _r,at as Le,aO as Le$1,aP as N7,aQ as B7,Q as QE,ax as pt,ay as Se,aB as ly,aC as Z0,aR as BD,aS as $D,m as bD,p as gI,B as _D,h as gh,aT as _h,a4 as Mh,aU as fr,aV as pr,F as LD,f as _i,g as Kc,G as Pu,E as VD,I as Lu}from'./main-R7YQQZVK.js';var V=["*"];function x(o,A){if(o&1){let n=LD();_i(0,"nz-icon",1),gh("click",function(e){Pu(n);let i=VD();return Lu(i.closeTag(e))}),Kc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Le).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...fr,...pr].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=N7(this.nzColor)||B7(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=QE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&gh("click",function(){return e.updateCheckedStatus()}),t&2&&(_h("background-color",e.isPresetColor?"":e.nzColor),Mh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",Z0],nzBordered:[2,"nzBordered","nzBordered",Z0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&(BD(),$D(0),bD(1,x,1,0,"nz-icon",0)),t&2&&(gI(),_D(e.nzMode==="closeable"?1:-1));},dependencies:[pt,Se],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=YE({type:o});static \u0275inj=uu({imports:[I]})}return o})();export{I,W};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a0 as $0,a1 as B0,s,r,Q as QE,
|
|
1
|
+
import {a0 as $0,a1 as B0,s,r,Q as QE,M as Mi,aW as Jc,N as ND,aX as Xc,p as gI,A as xD,v as vw,m as bD,w as nl,B as _D,F as LD,df as mh,E as VD,cG as ph,a5 as ah,S as SD,a6 as Nw,P as Ph,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var P=()=>[],$=(t,r)=>r.name;function S(t,r){t&1&&(Jc(0,"span",1),vw(1,"*"),Xc());}function O(t,r){if(t&1){let e=LD();Jc(0,"input",6),mh("change",function(o){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,o))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("checked",n.checked(e)),ah("data-testid","input-"+e.name);}}function D(t,r){if(t&1){let e=LD();Jc(0,"input",7),mh("input",function(o){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,o))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name);}}function L(t,r){if(t&1&&(Jc(0,"option",4),vw(1),Xc()),t&2){let e=r.$implicit;ph("value",e),gI(),Ph(e);}}function q(t,r){if(t&1){let e=LD();Jc(0,"select",8),mh("change",function(o){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,o))}),ND(1,L,2,2,"option",4,SD),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name),gI(),xD(e.options??Nw(2,P));}}function N(t,r){if(t&1){let e=LD();Jc(0,"input",9),mh("input",function(o){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,o))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name);}}function B(t,r){if(t&1&&(Jc(0,"label"),vw(1),bD(2,S,2,0,"span",1),bD(3,O,1,2,"input",2)(4,D,1,2,"input",3)(5,q,3,3,"select",4)(6,N,1,2,"input",5),Xc()),t&2){let e,n=r.$implicit;gI(),nl(" ",n.label," "),gI(),_D(n.required?2:-1),gI(),_D((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=$0([]),this.values=$0({}),this.valuesChange=B0();}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=QE({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&&(Jc(0,"div",0),ND(1,B,7,3,"label",null,$),Xc()),n&2&&(gI(),xD(o.fields()));},dependencies:[Mi],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};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {G as Gn,u as un}from'./chunk-bi3jOaJV.js';import {U as U$1}from'./chunk-MRIst_Tv.js';import {f}from'./chunk-CoKTfrti.js';import {e as et,U as U$2,G,i as it,v as vt}from'./chunk-BEvII7Hn.js';import {W,I}from'./chunk-DjiFAEo3.js';import'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';import {C,a as ae,U,V as Ve$1,b as at,q as qo,H as Hw,u as ue,X as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,a0 as $0,a1 as B0,v as vw,R as Rw,P as Ph,O as Ow,E as VD,F as LD,h as gh,w as nl,a2 as Pw,a3 as xw,x as ch,N as ND,A as xD,l as lh,G as Pu,I as Lu,a4 as Mh,a5 as ah,a6 as Nw,a7 as MD}from'./main-R7YQQZVK.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=LD();_i(0,"div",1)(1,"button",2),gh("click",function(){Pu(e);let o=VD();return Lu(o.closeIteration())}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",3),vw(5),Rw(6,"transloco"),Kc(),_i(7,"app-job-step-workspace",4),gh("selectExecution",function(o){Pu(e);let m=VD();return Lu(m.onNestedSelect(o))}),Kc()();}if(t&2){let e=s,i=VD();gI(2),nl(" ",Ow(3,9,"jobs.detail.loopBack")," "),gI(3),nl(" ",Pw(6,11,"jobs.detail.loopIteration",xw(14,de,e.index+1))," "),gI(2),ch("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&&(_i(0,"nz-tag"),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD().$implicit,i=VD(2);ah("data-testid","step-status-"+e.definition.id),gI(),Ph(Ow(2,2,i.stepStatusKey(s.status)));}}function ve(t,s){if(t&1){let e=LD();_i(0,"li")(1,"button",9),gh("click",function(){let o=Pu(e).$implicit,m=VD(2);return Lu(m.onStepClick(o))}),_i(2,"span",10),vw(3),Kc(),_i(4,"span",11)(5,"span",12),vw(6),Rw(7,"transloco"),Kc(),bD(8,he,3,4,"nz-tag"),Kc()()();}if(t&2){let e,i=s.$implicit,o=VD(2);gI(),Mh("selected",o.isSelected(i))("current",o.isCurrent(i))("unreached",!i.reached),ch("disabled",!i.reached),ah("data-testid","step-"+i.definition.id),gI(2),Ph(i.definition.name),gI(3),Ph(Ow(7,11,o.stepTypeKey(i.definition.type))),gI(2),_D((e=i.execution)?8:-1,e);}}function Ee(t,s){t&1&&(_i(0,"p",8),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.noStepSelected")," "));}function Se(t,s){t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"jobs.detail.inProgress.loop")));}function we(t,s){if(t&1){let e=LD();_i(0,"li")(1,"button",19),gh("click",function(){let o=Pu(e).$implicit,m=VD(4);return Lu(m.openIteration(m.selectedDefinition(),o))}),vw(2),Rw(3,"transloco"),Kc()();}if(t&2){let e=s.$implicit;gI(),ah("data-testid","loop-iteration-"+e.index),gI(),nl(" ",Pw(3,2,"jobs.detail.loopIteration",xw(5,de,e.index+1))," ");}}function Ie(t,s){t&1&&(_i(0,"li",12),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"jobs.detail.noIterations")));}function Te(t,s){if(t&1&&(_i(0,"p",18),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function ke(t,s){if(t&1&&(_i(0,"div",13)(1,"h3"),vw(2),Kc(),bD(3,Se,3,3,"p",16),_i(4,"ul",17),ND(5,we,4,7,"li",null,ge,false,Ie,3,3,"li",12),Kc(),bD(8,Te,2,1,"p",18),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(2),xD(e.selectedExecution().iterations??Nw(4,ce)),gI(3),_D(e.selectedExecution().error?8:-1);}}function Me(t,s){t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.sub_workflow")," "));}function ye(t,s){if(t&1&&(_i(0,"p",18),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function je(t,s){if(t&1&&(_i(0,"div",14)(1,"h3"),vw(2),Kc(),bD(3,Me,3,3,"p",16),lh(4,"app-job-status-table",20),bD(5,ye,2,1,"p",18),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(),ch("jobIds",e.selectedExecution().childJobIds??Nw(4,ce)),gI(),_D(e.selectedExecution().error?5:-1);}}function De(t,s){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=s.$implicit;gI(),Ph(e);}}function Je(t,s){t&1&&(_i(0,"li",12),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"jobs.resume.noQuestions")));}function Pe(t,s){if(t&1&&(_i(0,"p",25),vw(1),Kc()),t&2){let e=VD(5);gI(),Ph(e.resumeParseError());}}function Ne(t,s){if(t&1){let e=LD();_i(0,"section",21)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul",23),ND(5,De,2,1,"li",null,MD,false,Je,3,3,"li",12),Kc(),_i(8,"label"),vw(9),Rw(10,"transloco"),_i(11,"textarea",24),gh("input",function(o){Pu(e);let m=VD(4);return Lu(m.onResumeTextInput(o))}),Kc()(),bD(12,Pe,2,1,"p",25),_i(13,"button",26),gh("click",function(){Pu(e);let o=VD(4);return Lu(o.resumeSubmit.emit())}),vw(14),Rw(15,"transloco"),Kc()();}if(t&2){let e=VD(4);gI(2),Ph(Ow(3,7,"jobs.resume.heading")),gI(3),xD(e.waitingPrompts()),gI(4),nl(" ",Ow(10,9,"jobs.resume.jsonLabel")," "),gI(2),ch("value",e.resumeText()),gI(),_D(e.resumeParseError()?12:-1),gI(),ch("disabled",e.resuming()),gI(),nl(" ",Ow(15,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function Oe(t,s){if(t&1&&(_i(0,"pre",22),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function We(t,s){if(t&1&&(_i(0,"div",15)(1,"h3"),vw(2),Kc(),bD(3,Ne,16,13,"section",21)(4,Oe,2,1,"pre",22),Kc()),t&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.showResume()?3:4);}}function ze(t,s){if(t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD(4);gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress."+e.selectedExecution().type)," ");}}function Re(t,s){if(t&1&&(_i(0,"p",27),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function Be(t,s){if(t&1&&(_i(0,"pre",22),vw(1),Kc()),t&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function Fe(t,s){if(t&1&&(_i(0,"div")(1,"h3"),vw(2),Kc(),bD(3,ze,3,3,"p",16)(4,Re,2,1,"p",27)(5,Be,2,1,"pre",22),Kc()),t&2){let e=VD(3);ah("data-testid",e.selectedExecution().type+"-view"),gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:e.selectedExecution().error?4:5);}}function Ve(t,s){if(t&1&&bD(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=VD(2);_D((e=i.selectedExecution().type)==="loop"?0:e==="sub_workflow"?1:e==="interaction"?2:3);}}function Le(t,s){if(t&1&&(_i(0,"aside",5)(1,"h3"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul",6),ND(5,ve,9,13,"li",null,Ce),Kc()(),_i(7,"section",7),bD(8,Ee,3,3,"p",8)(9,Ve,4,1),Kc()),t&2){let e=VD();gI(2),Ph(Ow(3,2,"jobs.detail.stepsHeading")),gI(3),xD(e.rows()),gI(3),_D(e.selectedExecution()?9:8);}}var pe=(()=>{class t{constructor(){this.definitions=$0.required(),this.executions=$0.required(),this.job=$0.required(),this.selectedExecutionId=$0(null),this.currentExecutionId=$0(null),this.waitingEvent=$0(null),this.resumeText=$0(`{
|
|
2
|
+
|
|
3
|
+
}`),this.resumeParseError=$0(null),this.resuming=$0(false),this.canResume=$0(false),this.selectExecution=B0(),this.resumeTextChange=B0(),this.resumeSubmit=B0(),this.nestedIteration=qo(null),this.nestedLoopDefinition=qo(null),this.nestedSelectedId=qo(null),this.rows=Hw(()=>it(this.definitions(),this.executions())),this.selectedExecution=Hw(()=>{let e=this.selectedExecutionId();return e?this.executions().find(i=>i.id===e)??null:null}),this.selectedDefinition=Hw(()=>{let e=this.selectedExecution();return e?this.definitions().find(i=>i.id===e.stepDefinitionId)??null:null}),this.waitingPrompts=Hw(()=>{let e=this.waitingEvent();return e?e.questions.length>0?e.questions:e.data!=null?[JSON.stringify(e.data,null,2)]:[]:[]}),this.showResume=Hw(()=>{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=QE({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&&(_i(0,"div",0),bD(1,be,8,16,"div",1)(2,Le,10,4),Kc()),i&2){let m;gI(),_D((m=o.nestedIteration())?1:2,m);}},dependencies:[t,Mi,sd,zc,t7,y7,W,I,vt,Kt],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&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function $e(t,s){if(t&1&&(_i(0,"p",2),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function qe(t,s){if(t&1){let e=LD();_i(0,"button",15),gh("click",function(){Pu(e);let o=VD(2);return Lu(o.jumpToCurrent())}),vw(1),Rw(2,"transloco"),Kc();}t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.jumpToCurrent")," "));}function Ke(t,s){if(t&1&&(_i(0,"p",11),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.actionError());}}function Qe(t,s){t&1&&(lh(0,"nz-alert",12),Rw(1,"transloco")),t&2&&ch("nzMessage",Ow(1,1,"jobs.detail.queued"));}function He(t,s){if(t&1){let e=LD();_i(0,"app-job-step-workspace",16),gh("selectExecution",function(o){Pu(e);let m=VD(2);return Lu(m.onSelectExecution(o))})("resumeTextChange",function(o){Pu(e);let m=VD(2);return Lu(m.setResumeText(o))})("resumeSubmit",function(){Pu(e);let o=VD(2);return Lu(o.submitResume())}),Kc();}if(t&2){let e=VD(),i=VD();ch("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&&(_i(0,"p",14),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.workflowMissing")," "));}function Ge(t,s){if(t&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"span",7),vw(9),Kc(),vw(10," \xB7 "),_i(11,"nz-tag",8),vw(12),Rw(13,"transloco"),Kc(),vw(14," \xB7 "),_i(15,"span",9),vw(16),Kc()()(),bD(17,qe,3,3,"button",10),Kc(),bD(18,Ke,2,1,"p",11),bD(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=VD();gI(3),Ph(Ow(4,8,"jobs.detail.backToStart")),gI(3),Ph(i.id),gI(3),Ph(i.workflowId),gI(3),Ph(Ow(13,10,o.statusKey(i.status))),gI(4),Ph(o.subjectText()),gI(),_D(o.showJumpToCurrent()?17:-1),gI(),_D(o.actionError()?18:-1),gI(),_D(o.showQueued()?19:(e=o.workflow())?20:21,e);}}var Et=(()=>{class t{constructor(){this.route=C(ae),this.jobsApi=C(U),this.workflowsApi=C(U$1),this.eventsService=C(f),this.transloco=C(Ve$1),this.destroyRef=C(at),this.job=qo(null),this.workflow=qo(null),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.eventStream=qo(null),this.eventsSnapshot=qo([]),this.autoFollow=qo(true),this.viewedExecutionId=qo(null),this.resumeText=qo(`{
|
|
4
|
+
|
|
5
|
+
}`),this.resumeParseError=qo(null),this.resuming=qo(false),this.currentStep=Hw(()=>{let e=this.job();return e?et(e):null}),this.showQueued=Hw(()=>{let e=this.job();return e!=null&&et(e)==null}),this.showJumpToCurrent=Hw(()=>{let e=this.currentStep();return e?this.viewedExecutionId()!==e.id:false}),this.eventLog=Hw(()=>this.eventStream()?.events()??this.eventsSnapshot()),this.waitingEvent=Hw(()=>{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(ue(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);}),rd(()=>{let e=this.eventStream();if(!e)return;let i=e.latest();i&&Bw(()=>{(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();});}),rd(()=>{let e=this.currentStep();this.autoFollow()&&Bw(()=>{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(ue(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=QE({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&&(_i(0,"main",0),bD(1,Ae,3,3,"p",1)(2,$e,2,1,"p",2)(3,Ge,22,12),Kc()),i&2){let m;gI(),_D(o.loading()?1:o.loadError()?2:(m=o.job())?3:-1,m);}},dependencies:[Mi,Ln,Gn,un,sd,zc,t7,y7,W,I,pe,Kt],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};
|