@knoflows/engine 0.1.0-alpha.9 → 0.1.0-beta.16
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 +5 -10
- package/dist/engine.js +110 -10
- package/dist/migrations/20260918025930_context_files/migration.sql +7 -0
- package/dist/migrations/20260918025930_context_files/snapshot.json +1275 -0
- package/dist/migrations/20260918074816_large_kate_bishop/migration.sql +8 -0
- package/dist/migrations/20260918074816_large_kate_bishop/snapshot.json +1338 -0
- package/dist/migrations/20260919073531_tense_grey_gargoyle/migration.sql +1 -0
- package/dist/migrations/20260919073531_tense_grey_gargoyle/snapshot.json +1348 -0
- package/dist/migrations/20260919081637_fearless_warlock/migration.sql +1 -0
- package/dist/migrations/20260919081637_fearless_warlock/snapshot.json +1358 -0
- package/package.json +4 -4
- package/static/apple-touch-icon.png +0 -0
- package/static/assets/i18n/en.json +216 -12
- package/static/assets/i18n/es.json +216 -12
- package/static/chunk-9U0WIegY.js +1 -0
- package/static/chunk-B0kZCuEt.js +1 -0
- package/static/chunk-B2Xol2Un.js +1 -0
- package/static/chunk-B7WkIFy0.js +1 -0
- package/static/chunk-BW9BdLk-.js +1 -0
- package/static/chunk-Bgl02GNl.js +1 -0
- package/static/chunk-BhF-m2HP.js +70 -0
- package/static/chunk-BhTujCrk.js +1 -0
- package/static/chunk-Bu6_39Nh.js +1 -0
- package/static/chunk-C0HCwfa5.js +1 -0
- package/static/chunk-C2BVYtVN.js +66 -0
- package/static/chunk-C7h8oMzu.js +1 -0
- package/static/chunk-CRdEWPUM.js +1 -0
- package/static/chunk-CRv0PDB7.js +1 -0
- package/static/chunk-CecXf-CU.js +1 -0
- package/static/chunk-CenXuPs5.js +1 -0
- package/static/chunk-CeywzbyD.js +1 -0
- package/static/{chunk-WzBVBHEz.js → chunk-Cg2E0vnT.js} +1 -1
- package/static/chunk-CsQ_HDGC.js +1 -0
- package/static/chunk-D19C8Gcb.js +1 -0
- package/static/chunk-DGC4TkAL.js +1 -0
- package/static/chunk-DUkiyf7y.js +1 -0
- package/static/chunk-DYzSLsNo.js +1 -0
- package/static/chunk-DZJZYEZl.js +1 -0
- package/static/chunk-DfcFBVF4.js +1 -0
- package/static/chunk-DixyYfV_.js +1 -0
- package/static/chunk-Dp4H7MY0.js +1 -0
- package/static/chunk-DtQtDE8q.js +1 -0
- package/static/chunk-Dv5GyY6h.js +1 -0
- package/static/chunk-Edaw7VGW.js +1 -0
- package/static/chunk-FOJfn_t9.js +1 -0
- package/static/chunk-Fwpw-z7T.js +1 -0
- package/static/chunk-HUIPNwd9.js +1 -0
- package/static/chunk-NZ-CPWJ2.js +1 -0
- package/static/chunk-Th9whP36.js +1 -0
- package/static/chunk-bCuvpgQS.js +1 -0
- package/static/{chunk-BmSmqIC7.js → chunk-iE460Kz5.js} +1 -1
- package/static/chunk-p6dftaf8.js +5 -0
- package/static/chunk-yoe_30RI.js +1 -0
- package/static/chunk-z2vvQAle.js +1 -0
- package/static/favicon-16x16.png +0 -0
- package/static/favicon-32x32.png +0 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.svg +12 -0
- package/static/icon-192.png +0 -0
- package/static/icon-512.png +0 -0
- package/static/index.html +30 -5
- package/static/main-CHQMTVIP.js +248 -0
- package/static/media/inter-latin-400-normal-55WT6UWF.woff2 +0 -0
- package/static/media/inter-latin-400-normal-FR5HOXA4.woff +0 -0
- package/static/media/inter-latin-500-normal-W62DVTXI.woff2 +0 -0
- package/static/media/inter-latin-500-normal-ZNGIZ2YB.woff +0 -0
- package/static/media/inter-latin-600-normal-R6Y2SZCR.woff2 +0 -0
- package/static/media/inter-latin-600-normal-ZYHV6QZT.woff +0 -0
- package/static/media/jetbrains-mono-latin-500-normal-ETEQEOVZ.woff +0 -0
- package/static/media/jetbrains-mono-latin-500-normal-V4XIP5OW.woff2 +0 -0
- package/static/media/space-grotesk-latin-500-normal-GESQWJQV.woff2 +0 -0
- package/static/media/space-grotesk-latin-500-normal-HV4TE4RA.woff +0 -0
- package/static/media/space-grotesk-latin-700-normal-6Z7GHSI6.woff +0 -0
- package/static/media/space-grotesk-latin-700-normal-I3MXRIUZ.woff2 +0 -0
- package/static/nz-theme-dark.css +1 -0
- package/static/nz-theme.css +1 -0
- package/static/styles-JGCTKGGH.css +1 -0
- package/static/chunk-1SlEtaMr.js +0 -1
- package/static/chunk-5H-9s7GP.js +0 -7
- package/static/chunk-B-P3MXAn.js +0 -1
- package/static/chunk-B76UD1mt.js +0 -1
- package/static/chunk-BFYi_kYd.js +0 -1
- package/static/chunk-BG0Azip9.js +0 -1
- package/static/chunk-BWr0M-hk.js +0 -1
- package/static/chunk-Bpxo3nwV.js +0 -1
- package/static/chunk-Bw9D3p4h.js +0 -1
- package/static/chunk-C-T2O6LE.js +0 -1
- package/static/chunk-C1E15gBW.js +0 -5
- package/static/chunk-C1V4WljN.js +0 -1
- package/static/chunk-C3wpjxgW.js +0 -1
- package/static/chunk-C4yhGGeB.js +0 -1
- package/static/chunk-C5hSEJdm.js +0 -1
- package/static/chunk-CTkRZ4w1.js +0 -1
- package/static/chunk-CYX8w88D.js +0 -1
- package/static/chunk-Cq4-aSSE.js +0 -1
- package/static/chunk-Cwf9CcBI.js +0 -1
- package/static/chunk-D32ZkSz4.js +0 -1
- package/static/chunk-DE9IK0Os.js +0 -1
- package/static/chunk-DNtWpE65.js +0 -1
- package/static/chunk-DdVQ8Ilm.js +0 -66
- package/static/chunk-W0OF0P_2.js +0 -1
- package/static/chunk-XvSvuf-k.js +0 -1
- package/static/chunk-aWIxMbtR.js +0 -1
- package/static/chunk-f1UVptf5.js +0 -1
- package/static/chunk-vj0RDTCf.js +0 -1
- package/static/main-BRWQ5RNE.js +0 -249
- package/static/styles-6MW3GE4V.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {$}from'./chunk-Cg2E0vnT.js';import {s,r as r$1,ch as Sy,i as ie,C,bt as Ee,d5 as go,dg as Ul,dh as Fd,di as kn,aC as zt,bQ as Wr,Z as ZE,c3 as th,j as _i,x as xD,N as ND,J as Jc,aP as Mh,al as Sh,o as gI,B as AD,ap as re,a9 as Z0,be as E3,bR as eD,ae as Le$1,bs as G0,bf as _r,a3 as Ah,a4 as Th,as as st,at as Ee$1,m as mh,l as _D,aw as rh,aQ as aw,aG as lw,M as MD,w as lh,cM as Rw,bH as wh,bI as zD,G as FD,b as at,n as uh,aJ as tl,aK as nl,H as HD,O as Fu,Q as ju,aU as vv}from'./main-CHQMTVIP.js';var ce=["animationElement"],me=(n,o)=>({$implicit:n,data:o});function le(n,o){n&1&&uh(0,"nz-icon",4);}function pe(n,o){n&1&&uh(0,"nz-icon",5);}function de(n,o){n&1&&uh(0,"nz-icon",6);}function he(n,o){n&1&&uh(0,"nz-icon",7);}function fe(n,o){n&1&&uh(0,"nz-icon",8);}function ue(n,o){if(n&1&&(tl(0),uh(1,"span",10),nl()),n&2){let e=HD();gI(),lh("innerHTML",e.instance.content,vv);}}function ge(n,o){if(n&1){let e=FD();_i(0,"nz-message",2),mh("destroyed",function(i){Fu(e);let s=HD();return ju(s.remove(i.id,i.userAction))}),Jc();}if(n&2){let e=o.$implicit;lh("instance",e);}}var ve=0,M=class{container;nzSingletonService=C($);injector=C(Ee);remove(o){this.container&&(o?this.container.remove(o):this.container.removeAll());}getInstanceId(){return `${this.componentPrefix}-${ve++}`}withContainer(o){let e=this.nzSingletonService.getSingletonWithKey(this.componentPrefix);if(e)return e;let t=go(this.injector,{hasBackdrop:false,scrollStrategy:Fd(),positionStrategy:Ul(this.injector)}),i=new kn(o,null,this.injector),s=t.attach(i),re=t.hostElement;return re.style.zIndex="1010",e||(this.container=e=s.instance,this.nzSingletonService.registerSingletonWithKey(this.componentPrefix,e),this.container.afterAllInstancesRemoved.subscribe(()=>{this.container=void 0,this.nzSingletonService.unregisterSingletonWithKey(this.componentPrefix),t.dispose();})),e}},Ce=(()=>{class n{config;instances=[];_afterAllInstancesRemoved=new re;afterAllInstancesRemoved=this._afterAllInstancesRemoved.asObservable();cdr=C(Z0);nzConfigService=C(E3);constructor(){this.subscribeConfigChange();}create(e){let t=this.onCreate(e);return this.instances.length>=this.config.nzMaxStack&&(this.instances=this.instances.slice(1)),this.instances=[...this.instances,t],this.readyInstances(),t}remove(e,t=false){this.instances.map((i,s)=>({index:s,instance:i})).filter(({instance:i})=>i.messageId===e).forEach(({index:i,instance:s})=>{this.instances.splice(i,1),this.instances=[...this.instances],this.onRemove(s,t),this.readyInstances();}),this.instances.length||this.onAllInstancesRemoved();}removeAll(){this.instances.forEach(e=>this.onRemove(e,false)),this.instances=[],this.readyInstances(),this.onAllInstancesRemoved();}onCreate(e){return e.options=this.mergeOptions(e.options),e.onClose=new re,e}onRemove(e,t){e.onClose.next(t),e.onClose.complete();}onAllInstancesRemoved(){this._afterAllInstancesRemoved.next(),this._afterAllInstancesRemoved.complete();}readyInstances(){this.cdr.detectChanges();}mergeOptions(e){let{nzDuration:t,nzAnimate:i,nzPauseOnHover:s}=this.config;return r$1({nzDuration:t,nzAnimate:i,nzPauseOnHover:s},e)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=eD({type:n})}return n})(),ye=(()=>{class n{destroyRef=C(at);elementRef=C(_r);options;autoClose;userAction=false;eraseTimer;eraseTimingStart;eraseTTL;constructor(){this.destroyRef.onDestroy(()=>{this.autoClose&&this.clearEraseTimeout();});}ngOnInit(){this.options=this.instance.options,this.options.nzAnimate&&this._startEnterAnimation(),this.autoClose=this.options.nzDuration>0,this.autoClose&&(this.initErase(),this.startEraseTimeout());}onEnter(){this.autoClose&&this.options.nzPauseOnHover&&(this.clearEraseTimeout(),this.updateTTL());}onLeave(){this.autoClose&&this.options.nzPauseOnHover&&this.startEraseTimeout();}destroy(e=false){this.userAction=e,this.options.nzAnimate?this._startLeaveAnimation(()=>this.destroyed.next({id:this.instance.messageId,userAction:e})):this.destroyed.next({id:this.instance.messageId,userAction:e});}initErase(){this.eraseTTL=this.options.nzDuration,this.eraseTimingStart=Date.now();}updateTTL(){this.autoClose&&(this.eraseTTL-=Date.now()-this.eraseTimingStart);}startEraseTimeout(){this.eraseTTL>0?(this.clearEraseTimeout(),this.eraseTimer=setTimeout(()=>this.destroy(),this.eraseTTL),this.eraseTimingStart=Date.now()):this.destroy();}clearEraseTimeout(){this.eraseTimer!==null&&(clearTimeout(this.eraseTimer),this.eraseTimer=void 0);}_startEnterAnimation(){let e=this.animationElement().nativeElement;e.classList.add(this._animationClassMap.enter);let t=i=>{this.matchAnimationKeyframe(i,this._animationKeyframeMap.enter)&&(e.removeEventListener("animationend",t),e.classList.remove(this._animationClassMap.enter));};e.addEventListener("animationend",t);}_startLeaveAnimation(e){let t=this.animationElement().nativeElement;t.classList.remove(this._animationClassMap.enter),t.classList.add(this._animationClassMap.leave);let i=s=>{this.matchAnimationKeyframe(s,this._animationKeyframeMap.leave)&&(t.removeEventListener("animationend",i),e());};t.addEventListener("animationend",i);}matchAnimationKeyframe(e,t){return typeof t=="string"?e.animationName===t:t.includes(e.animationName)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=eD({type:n})}return n})(),ze=(()=>{class n extends ye{instance;destroyed=new Le$1;index;animationElement=G0.required("animationElement",{read:_r});_animationKeyframeMap={enter:"MessageMoveIn",leave:"MessageMoveOut"};_animationClassMap={enter:"ant-message-move-up-enter",leave:"ant-message-move-up-leave"};static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275cmp=ZE({type:n,selectors:[["nz-message"]],viewQuery:function(t,i){t&1&&wh(i.animationElement,ce,5,_r),t&2&&zD();},inputs:{instance:"instance"},outputs:{destroyed:"destroyed"},exportAs:["nzMessage"],features:[th],decls:10,vars:12,consts:[["animationElement",""],[1,"ant-message-notice",3,"mouseenter","mouseleave"],[1,"ant-message-notice-content"],[1,"ant-message-custom-content"],["nzType","check-circle"],["nzType","info-circle"],["nzType","exclamation-circle"],["nzType","close-circle"],["nzType","loading"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[3,"innerHTML"]],template:function(t,i){if(t&1&&(_i(0,"div",1,0),mh("mouseenter",function(){return i.onEnter()})("mouseleave",function(){return i.onLeave()}),_i(2,"div",2)(3,"div",3),_D(4,le,1,0,"nz-icon",4)(5,pe,1,0,"nz-icon",5)(6,de,1,0,"nz-icon",6)(7,he,1,0,"nz-icon",7)(8,fe,1,0,"nz-icon",8),rh(9,ue,2,1,"ng-container",9),Jc()()()),t&2){let s;aw(i.instance.options?.nzStyle),lw(i.instance.options?.nzClass),gI(3),lw("ant-message-"+i.instance.type),gI(),MD((s=i.instance.type)==="success"?4:s==="info"?5:s==="warning"?6:s==="error"?7:s==="loading"?8:-1),gI(5),lh("nzStringTemplateOutlet",i.instance.content)("nzStringTemplateOutletContext",Rw(9,me,i,i.instance.options?.nzData));}},dependencies:[Ah,Th,st,Ee$1],encapsulation:2})}return n})(),f="message",_e={nzAnimate:true,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:true,nzTop:24,nzDirection:"ltr"},Te=(()=>{class n extends Ce{dir=this.nzConfigService.getConfigForComponent(f)?.nzDirection||"ltr";top;constructor(){super(),this.updateConfig();}subscribeConfigChange(){zt(f,()=>{this.updateConfig(),this.dir=this.nzConfigService.getConfigForComponent(f)?.nzDirection||this.dir;});}updateConfig(){this.config=r$1(r$1(r$1({},_e),this.config),this.nzConfigService.getConfigForComponent(f)),this.top=Wr(this.config.nzTop),this.cdr.markForCheck();}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ZE({type:n,selectors:[["nz-message-container"]],exportAs:["nzMessageContainer"],features:[th],decls:3,vars:4,consts:[[1,"ant-message"],[3,"instance"],[3,"destroyed","instance"]],template:function(t,i){t&1&&(_i(0,"div",0),xD(1,ge,1,1,"nz-message",1,ND),Jc()),t&2&&(Mh("top",i.top),Sh("ant-message-rtl",i.dir==="rtl"),gI(),AD(i.instances));},dependencies:[ze],encapsulation:2})}return n})(),He=(()=>{class n extends M{componentPrefix="message-";success(e,t){return this.createInstance({type:"success",content:e},t)}error(e,t){return this.createInstance({type:"error",content:e},t)}info(e,t){return this.createInstance({type:"info",content:e},t)}warning(e,t){return this.createInstance({type:"warning",content:e},t)}loading(e,t){return this.createInstance({type:"loading",content:e},t)}create(e,t,i){return this.createInstance({type:e,content:t},i)}createInstance(e,t){return this.container=this.withContainer(Te),this.container.create(s(r$1({},e),{createdAt:new Date,messageId:this.getInstanceId(),options:t}))}static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{He as H};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f}from'./chunk-z2vvQAle.js';import {C,b as at,a5 as q0,a6 as U0,q as qo,u as ue,s,r as r$1,Z as ZE,d as $8,K as Kt,bm as Xc,x as xD,bn as el,o as gI,B as AD,I as Iw,l as _D,z as rl,M as MD,G as FD,bL as yh,O as Fu,H as HD,Q as ju,c_ as hh,D as ch,N as ND,aR as xw,P as Pw,L as Lh,p as Fw}from'./main-CHQMTVIP.js';var q=()=>[],A=(t,o)=>o.name,B=(t,o)=>o.id;function j(t,o){t&1&&(Xc(0,"span",1),Iw(1,"*"),el());}function z(t,o){if(t&1){let e=FD();Xc(0,"input",6),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("checked",n.checked(e)),ch("data-testid","input-"+e.name);}}function U(t,o){if(t&1){let e=FD();Xc(0,"input",7),yh("input",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name);}}function G(t,o){if(t&1&&(Xc(0,"option",4),Iw(1),el()),t&2){let e=o.$implicit;hh("value",e),gI(),Lh(e);}}function H(t,o){if(t&1){let e=FD();Xc(0,"select",8),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),xD(1,G,2,2,"option",4,ND),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name),gI(),AD(e.options??xw(2,q));}}function J(t,o){if(t&1&&(Xc(0,"option",4),Iw(1),el()),t&2){let e=o.$implicit;hh("value",e.id),gI(),Lh(e.name);}}function K(t,o){if(t&1){let e=FD();Xc(0,"select",8),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),Xc(1,"option",9),Iw(2),Pw(3,"transloco"),el(),xD(4,J,2,2,"option",4,B),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name),gI(2),Lh(Fw(3,3,"workflow-input.localRepositoryPlaceholder")),gI(2),AD(n.localRepositories());}}function Q(t,o){if(t&1){let e=FD();Xc(0,"input",10),yh("input",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name);}}function X(t,o){if(t&1&&(Xc(0,"label"),Iw(1),_D(2,j,2,0,"span",1),_D(3,z,1,2,"input",2)(4,U,1,2,"input",3)(5,H,3,3,"select",4)(6,K,6,5,"select",4)(7,Q,1,2,"input",5),el()),t&2){let e,n=o.$implicit;gI(),rl(" ",n.label," "),gI(),MD(n.required?2:-1),gI(),MD((e=n.type)==="boolean"?3:e==="number"?4:e==="select"?5:e==="localRepository"?6:7);}}function Y(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 ae(t){let o={};for(let e of t)o[e.name]=Y(e);return o}var le=(()=>{class t{constructor(){this.reposApi=C(f),this.destroyRef=C(at),this.fields=q0([]),this.values=q0({}),this.valuesChange=U0(),this.localRepositories=qo([]),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.localRepositories.set(e),error:()=>this.localRepositories.set([])});}displayValue(e){let n=this.values()[e.name];return n==null?"":String(n)}checked(e){return !!this.values()[e.name]}setValue(e,n){let r=n.target,a=r.value;e.type==="boolean"?a=r.checked:e.type==="number"&&(a=r.value===""?"":Number(r.value)),this.valuesChange.emit(s(r$1({},this.values()),{[e.name]:a}));}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({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"],["value",""],["type","text",3,"input","value"]],template:function(n,r){n&1&&(Xc(0,"div",0),xD(1,X,8,3,"label",null,A),el()),n&2&&(gI(),AD(r.fields()));},dependencies:[$8,Kt],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{ae as a,le as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {C,b6 as U,b7 as m,b8 as y,V as Ve,b as at,q as qo,u as ue,aW as Ng,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,l as _D,o as gI,L as Lh,p as Fw,z as rl,M as MD,H as HD,x as xD,w as lh,B as AD,G as FD,m as mh,D as ch,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {W,I}from'./chunk-iE460Kz5.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';function ee(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 te=(t,p)=>p.type+p.id;function ie(t,p){t&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ne(t,p){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function oe(t,p){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function ae(t,p){t&1&&(_i(0,"section",8)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"a",10),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",11),Iw(9),Pw(10,"transloco"),Jc()()()),t&2&&(gI(2),Lh(Fw(3,3,"manage.views.emptyState")),gI(4),rl(" ",Fw(7,5,"manage.views.createView")," "),gI(3),rl(" ",Fw(10,7,"manage.views.createShortcut")," "));}function re(t,p){if(t&1&&(Iw(0),Pw(1,"transloco")),t&2){let e=HD().$implicit,i=HD(3);rl(" ",Fw(1,1,i.subjectTypeKey(e.subjectType))," ");}}function se(t,p){t&1&&(Iw(0),Pw(1,"transloco")),t&2&&rl(" ",Fw(1,1,"manage.views.noSubjectType")," ");}function de(t,p){if(t&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td")(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"td"),Iw(8),Jc(),_i(9,"td"),_D(10,re,2,3)(11,se,2,3),Jc(),_i(12,"td",12)(13,"a",13),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",14),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let c=Fu(e).$implicit,v=HD(3);return ju(v.deleteItem(c))}),Iw(20),Pw(21,"transloco"),Jc()()();}if(t&2){let e=p.$implicit,i=HD(3);ch("data-testid","item-"+e.type+"-"+e.id),gI(),ch("data-testid","name-"+e.type+"-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","type-"+e.type+"-"+e.id),gI(),Lh(Fw(6,17,i.typeKey(e.type))),gI(2),ch("data-testid","workflow-"+e.type+"-"+e.id),gI(),rl(" ",i.workflowName(e)," "),gI(),ch("data-testid","subject-type-"+e.type+"-"+e.id),gI(),MD(e.subjectType?10:11),gI(3),lh("routerLink",i.editLink(e)),ch("data-testid","edit-"+e.type+"-"+e.id),gI(),rl(" ",Fw(15,19,"manage.views.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,21,i.deleteConfirmKey(e)))("nzOkText",Fw(18,23,"manage.views.delete"))("nzCancelText",Fw(19,25,"common.cancel")),ch("data-testid","delete-"+e.type+"-"+e.id),gI(4),rl(" ",Fw(21,27,"manage.views.delete")," ");}}function pe(t,p){if(t&1&&(_i(0,"nz-table",9)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,de,22,29,"tr",null,te),Jc()()),t&2){let e=HD(2);lh("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,8,"manage.views.column.name")),gI(3),Lh(Fw(8,10,"manage.views.column.type")),gI(3),Lh(Fw(11,12,"manage.views.column.workflow")),gI(3),Lh(Fw(14,14,"manage.views.column.subjectType")),gI(3),Lh(Fw(17,16,"manage.views.column.actions")),gI(3),AD(e.items());}}function le(t,p){if(t&1&&(_D(0,oe,2,1,"p",7),_D(1,ae,11,9,"section",8)(2,pe,21,18,"nz-table",9)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.items().length===0?1:2);}}var Pe=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),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.nav.refresh(),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(ee(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 bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({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"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",2)(6,"a",3),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"a",4),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,ie,3,3,"p",5)(13,ne,2,1,"p",6)(14,le,3,2),Jc()),i&2&&(gI(3),Lh(Fw(4,4,"manage.views.title")),gI(4),rl(" ",Fw(8,6,"manage.views.createView")," "),gI(3),rl(" ",Fw(11,8,"manage.views.createShortcut")," "),gI(2),MD(c.loading()?12:c.loadError()?13:14));},dependencies:[$8,v3,pf,bd,sp,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{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{Pe as ViewsAndShortcutsManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {x,h,b,w,O}from'./chunk-9U0WIegY.js';import {W,I}from'./chunk-iE460Kz5.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import {C,$,R as J1,V as Ve,b as at,S as p,a5 as q0,q as qo,T as id,W as qw,aW as Ng,aX as es,aY as Dg,u as ue,c as bi,s,r as r$1,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,K as Kt,l as _D,M as MD,j as _i,I as Iw,P as Pw,J as Jc,o as gI,L as Lh,p as Fw,H as HD,x as xD,w as lh,B as AD,D as ch,E as Aw,z as rl,G as FD,m as mh,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var bt=o=>["/jobs",o],mt=(o,u)=>u.id;function ut(o,u){o&1&&(_i(0,"p",0),Iw(1),Pw(2,"transloco"),Jc()),o&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ht(o,u){if(o&1&&(_i(0,"p",1),Iw(1),Jc()),o&2){let t=HD();gI(),Lh(t.loadError());}}function gt(o,u){if(o&1){let t=FD();_i(0,"button",8),mh("click",function(i){Fu(t);let d=HD().$implicit,g=HD(2);return ju(g.retryJob(d,i))}),Iw(1),Pw(2,"transloco"),Jc();}if(o&2){let t=HD().$implicit,e=HD(2);lh("disabled",e.retryingJobId()===t.id),ch("data-testid","job-retry-"+t.id),gI(),rl(" ",Fw(2,3,e.retryingJobId()===t.id?"jobs.detail.retrying":"jobs.table.retry")," ");}}function xt(o,u){if(o&1){let t=FD();_i(0,"button",9),mh("click",function(i){Fu(t);let d=HD().$implicit,g=HD(2);return ju(g.cancelJob(d,i))}),Iw(1),Pw(2,"transloco"),Jc();}if(o&2){let t=HD().$implicit,e=HD(2);lh("disabled",e.cancellingJobId()===t.id),ch("data-testid","job-cancel-"+t.id),gI(),rl(" ",Fw(2,3,e.cancellingJobId()===t.id?"jobs.detail.cancelling":"jobs.table.cancel")," ");}}function ft(o,u){if(o&1&&(_i(0,"tr")(1,"td")(2,"a",3),Iw(3),Jc(),_i(4,"div",4),Iw(5),Jc()(),_i(6,"td")(7,"nz-tag",5),Iw(8),Pw(9,"transloco"),Jc()(),_i(10,"td")(11,"span"),Iw(12),Jc()(),_i(13,"td")(14,"span"),Iw(15),Jc()(),_i(16,"td")(17,"span"),Iw(18),Jc()(),_i(19,"td"),_D(20,gt,3,5,"button",6),_D(21,xt,3,5,"button",7),Jc()()),o&2){let t=u.$implicit,e=HD(2);ch("data-testid","job-row-"+t.id),gI(2),lh("routerLink",Aw(19,bt,t.id)),ch("data-testid","job-link-"+t.id),gI(),rl(" ",e.composeJobTitle(t)," "),gI(2),Lh(t.id),gI(2),lh("nzColor",e.jobStatusTagColor(t.status,e.theme.theme()))("ngClass",e.jobStatusTagClass(t.status,e.theme.theme())),ch("data-testid","job-status-"+t.id),gI(),Lh(Fw(9,17,e.statusKey(t.status))),gI(3),ch("data-testid","job-subject-"+t.id),gI(),Lh(e.subjectText(t)),gI(2),ch("data-testid","job-started-"+t.id),gI(),Lh(t.createdAt),gI(2),ch("data-testid","job-completed-"+t.id),gI(),Lh(t.completedAt??"\u2014"),gI(2),MD(t.status==="failed"?20:-1),gI(),MD(e.isTerminalStatus(t.status)?-1:21);}}function _t(o,u){if(o&1&&(_i(0,"nz-table",2)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,ft,22,21,"tr",null,mt),Jc()()),o&2){let t=HD();lh("nzData",t.displayJobs())("nzFrontPagination",false)("nzShowPagination",false)("nzSize","middle"),gI(4),Lh(Fw(5,10,"jobs.table.column.id")),gI(3),Lh(Fw(8,12,"jobs.table.column.status")),gI(3),Lh(Fw(11,14,"jobs.table.column.subject")),gI(3),Lh(Fw(14,16,"jobs.table.column.started")),gI(3),Lh(Fw(17,18,"jobs.table.column.completed")),gI(3),Lh(Fw(20,20,"jobs.table.column.actions")),gI(3),AD(t.displayJobs());}}var Lt=(()=>{class o{constructor(){this.jobsApi=C($),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.theme=C(p),this.jobStatusTagClass=x,this.jobStatusTagColor=h,this.composeJobTitle=b,this.jobs=q0(null),this.jobIds=q0([]),this.loaded=qo([]),this.loading=qo(false),this.loadError=qo(null),this.retryingJobId=qo(null),this.cancellingJobId=qo(null),this.patched=qo({}),id(()=>{let t=this.jobs(),e=this.jobIds();if(t!=null){qw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null),this.patched.set({});});return}if(e.length===0){qw(()=>{this.loaded.set([]),this.loading.set(false);});return}qw(()=>{this.loading.set(true),this.loadError.set(null),Ng(e.map(i=>this.jobsApi.get(i).pipe(es(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.loaded.set(i.filter(d=>d!=null)),this.loading.set(false);},error:()=>{this.loading.set(false),this.loadError.set("Failed to load jobs");}});});});}displayJobs(){let t=this.jobs(),e=t??this.loaded(),i=this.patched();return e.map(d=>i[d.id]??d)}isTerminalStatus(t){return w(t)}statusKey(t){return `jobs.status.${t}`}subjectText(t){return O(t.subjectContext)??"\u2014"}retryJob(t,e){e.preventDefault(),e.stopPropagation(),!(t.status!=="failed"||this.retryingJobId()===t.id)&&(this.retryingJobId.set(t.id),this.loadError.set(null),this.jobsApi.retry(t.id).subscribe({next:i=>{this.retryingJobId.set(null),this.router.navigate(["/jobs",i.id]);},error:i=>{this.retryingJobId.set(null),this.loadError.set(i instanceof bi||i instanceof Error?i.message:this.transloco.translate("jobs.errors.retryFailed"));}}));}cancelJob(t,e){e.preventDefault(),e.stopPropagation(),!(w(t.status)||this.cancellingJobId()===t.id)&&(this.cancellingJobId.set(t.id),this.loadError.set(null),this.jobsApi.cancel(t.id).subscribe({next:i=>{this.cancellingJobId.set(null),this.patched.update(d=>s(r$1({},d),{[i.id]:i})),this.loaded.update(d=>d.map(g=>g.id===i.id?i:g));},error:i=>{this.cancellingJobId.set(null),this.loadError.set(i instanceof bi||i instanceof Error?i.message:this.transloco.translate("jobs.errors.cancelFailed"));}}));}static{this.\u0275fac=function(e){return new(e||o)};}static{this.\u0275cmp=ZE({type:o,selectors:[["app-job-status-table"]],inputs:{jobs:[1,"jobs"],jobIds:[1,"jobIds"]},decls:3,vars:1,consts:[["data-testid","job-status-loading"],["data-testid","job-status-error",1,"error"],["data-testid","job-status-table",3,"nzData","nzFrontPagination","nzShowPagination","nzSize"],[3,"routerLink"],[1,"job-row-id","mono"],[3,"nzColor","ngClass"],["nz-button","","nzType","link","type","button",3,"disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"disabled"],["nz-button","","nzType","link","type","button",3,"click","disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&_D(0,ut,3,3,"p",0)(1,ht,2,1,"p",1)(2,_t,24,22,"nz-table",2),e&2&&MD(i.loading()&&i.jobs()==null?0:i.loadError()?1:2);},dependencies:[$8,M5,v3,pf,bd,sp,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:["[_nghost-%COMP%]{display:block;min-width:0;max-width:100%}.error[_ngcontent-%COMP%]{color:#9f1239}.job-row-id[_ngcontent-%COMP%]{margin-top:.2rem;font-size:.75rem;color:var(--knoflows-text-secondary, #6b6558)}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return o})();export{Lt as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {aZ as H,Z as ZE,a_ as D6,v as v3,a$ as Yc,a3 as Ah,a4 as Th,K as Kt,j as _i,x as xD,J as Jc,n as uh,o as gI,B as AD,I as Iw,P as Pw,aH as QD,H as HD,w as lh,E as Aw,aR as xw,D as ch,z as rl,p as Fw}from'./main-CHQMTVIP.js';var A=e=>["/manage",e],z=()=>({exact:true}),K=(e,i)=>i.path;function L(e,i){if(e&1&&(_i(0,"a",3,0),uh(2,"span",4),Iw(3),Pw(4,"transloco"),Jc()),e&2){let t=i.$implicit,n=QD(1),r=HD();lh("routerLink",Aw(8,A,t.path))("routerLinkActiveOptions",xw(10,z)),ch("data-testid","manage-tab-"+t.path),gI(2),lh("nzType",t.icon)("nzTheme",r.navIconTheme(n.isActive,t.icon)),gI(),rl(" ",Fw(4,6,t.labelKey)," ");}}var I=[{path:"workflows",labelKey:"manage.tab.workflows",icon:"partition"},{path:"views",labelKey:"manage.tab.views",icon:"appstore"},{path:"providers",labelKey:"manage.tab.providers",icon:"api"},{path:"context-files",labelKey:"manage.tab.contextFiles",icon:"file"},{path:"local-repositories",labelKey:"manage.tab.localRepositories",icon:"database"},{path:"worktrees",labelKey:"manage.tab.worktrees",icon:"deployment-unit"},{path:"preferences",labelKey:"manage.tab.preferences",icon:"setting"}],B=(()=>{class e{constructor(){this.tabs=I,this.navIconTheme=H;}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-manage-shell"]],decls:5,vars:0,consts:[["rla","routerLinkActive"],["data-testid","manage-shell",1,"manage-shell"],["data-testid","manage-tabs","role","tablist",1,"manage-tabs"],["role","tab","routerLinkActive","active",3,"routerLink","routerLinkActiveOptions"],["nz-icon","",1,"tab-icon",3,"nzType","nzTheme"]],template:function(n,r){n&1&&(_i(0,"section",1)(1,"nav",2),xD(2,L,5,11,"a",3,K),Jc(),uh(4,"router-outlet"),Jc()),n&2&&(gI(2),AD(r.tabs));},dependencies:[D6,v3,Yc,Ah,Th,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 var(--knoflows-border, #e1dacb);background:var(--knoflows-surface, #fff)}.manage-tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.65rem .9rem;color:var(--knoflows-text-secondary, inherit);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}.tab-icon[_ngcontent-%COMP%]{font-size:16px;color:currentColor}.manage-tabs[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:var(--knoflows-text, inherit)}.manage-tabs[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{color:var(--knoflows-link, inherit);font-weight:600;border-bottom-color:var(--knoflows-link, currentColor)}"]});}}return e})();export{I as MANAGE_TABS,B as ManageShellComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q as qo,U as Uw,aV as ix,i as ie}from'./main-CHQMTVIP.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=`${ix.apiBaseUrl}/events${r?`?${r}`:""}`,a=qo([]),b=Uw(()=>{let o=a();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.update(d=>[...d,c]);},{events:a.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 {C,
|
|
1
|
+
import {C,dv as yh,u as ue,ag as Ql,ba as Se,co as Kg,i as ie,aa as oe,b as at,ap as re,dw as Dr,d3 as Qg,c7 as Gl}from'./main-CHQMTVIP.js';var u=()=>{},R=(()=>{class e{ngZone=C(oe);destroyRef=C(at);resizeSource$=new re;listeners=0;renderer=C(Dr).createRenderer(null,null);disposeHandle=u;handler=()=>{this.ngZone.run(()=>{this.resizeSource$.next();});};constructor(){this.destroyRef.onDestroy(()=>{this.handler=u;});}connect(){return this.registerListener(),this.resizeSource$.pipe(Qg(16),Gl(()=>this.unregisterListener()))}disconnet(){this.unregisterListener();}registerListener(){this.listeners===0&&this.ngZone.runOutsideAngular(()=>{this.disposeHandle=this.renderer.listen("window","resize",this.handler);}),this.listeners+=1;}unregisterListener(){this.listeners-=1,this.listeners===0&&(this.disposeHandle(),this.disposeHandle=u);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),$=(()=>{class e{get singletonRegistry(){return this._singletonRegistry}_singletonRegistry=new Map;registerSingletonWithKey(t,n){let i=this.singletonRegistry.has(t),r=i?this.singletonRegistry.get(t):this.withNewTarget(n);i||this.singletonRegistry.set(t,r);}unregisterSingletonWithKey(t){this.singletonRegistry.has(t)&&this.singletonRegistry.delete(t);}getSingletonWithKey(t){return this.singletonRegistry.has(t)?this.singletonRegistry.get(t).target:null}withNewTarget(t){return {target:t}}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var M=(function(e){return e.xxxl="xxxl",e.xxl="xxl",e.xl="xl",e.lg="lg",e.md="md",e.sm="sm",e.xs="xs",e})(M||{});var b={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)",xxxl:"(min-width: 1920px)"};var z=(()=>{class e{resizeService=C(R);mediaMatcher=C(yh);constructor(){this.resizeService.connect().pipe(ue()).subscribe();}subscribe(t,n){return n?this.resizeService.connect().pipe(Ql(void 0),Se(()=>this.matchMedia(t,true)),Kg((i,r)=>i[0]===r[0]),Se(i=>i[1])):this.resizeService.connect().pipe(Ql(void 0),Se(()=>this.matchMedia(t)),Kg())}matchMedia(t,n){let i=M.md,r={};return Object.keys(t).map(S=>{let d=S,g=this.mediaMatcher.matchMedia(b[d]).matches;r[d]=g,g&&(i=d);}),n?[i,r]:i}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{$,M,R,b,z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {D,B,L,h,v,H,Q,G,J,Y,X as X$1,Z}from'./chunk-DUkiyf7y.js';import {H as He}from'./chunk-C7h8oMzu.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {G as Gn,u as un}from'./chunk-Dp4H7MY0.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';import {I as I_,k as k_,t as tm}from'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,a7 as KE,a8 as fu,aA as mT,be as E3,bf as _r,aa as oe,a9 as Z0,bg as Ci,aB as yT,ab as Oe,bh as Bt$1,aq as el,bi as cl,a3 as Ah,a4 as Th,as as st,at as Ee,ai as ly,av as K0,n as uh,al as Sh,w as lh,D as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,x as xD,B as AD,G as FD,k as iE,y as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var Tt=["switchElement"];function wt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function kt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,kt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Ot="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Ot;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,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(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(Tt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),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(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,wt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,Nt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ft(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Bt(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Bt,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"button",38),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Jt(n,m){if(n&1&&(_i(0,"p",41),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Yt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Jt,2,5,"p",40),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function Xt(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ti(n,m){if(n&1&&(_i(0,"p",43),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ii(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",42),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,Xt,1,2,"nz-option",27),xD(7,ei,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ti,2,1,"p",43),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",44),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",45)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",46),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_i(29,"label",21)(30,"span"),Iw(31),Pw(32,"transloco"),Jc$1(),_i(33,"div",28)(34,"input",29),Pw(35,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(36,Qt,3,5,"button",30),_D(37,Gt,3,5,"button",31),Jc$1(),_D(38,Yt,5,5,"div",32),Jc$1(),_D(39,ii,26,23),_i(40,"label",21)(41,"span"),Iw(42),Pw(43,"transloco"),Jc$1(),_i(44,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(45,"p",25),Iw(46),Pw(47,"transloco"),Jc$1()(),_i(48,"div",34)(49,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(50),Pw(51,"transloco"),Jc$1(),_i(52,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(53),Pw(54,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,23,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,25,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,27,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,29,"settings.instanceIdHint")),gI(4),Lh(Fw(23,31,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(4),Lh(Fw(32,33,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(35,35,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?36:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?37:-1),gI(),MD((e=t.modalTestResult())?38:-1,e),gI(),MD(t.draft().kind==="agent"?39:-1),gI(3),Lh(Fw(43,37,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(47,39,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(51,41,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(54,43,"common.save")," ");}}var Xi=(()=>{class n{constructor(){this.api=C(D),this.providersApi=C(B),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(L()),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.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=h,this.configFields=v,this.typeLabelKey=H,this.isAgent=I_,this.supportsTestConnection=k_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return I_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return k_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(L());}openEdit(e){this.resetModal(Q(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>G(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>J(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=Y(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){k_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}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 t=tm.safeParse(X$1(e));if(!t.success){this.validationErrors.set(Z(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,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.modalTestRunning.set(false),this.modalTestResult.set(null),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(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,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"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["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-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["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"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Ft,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,ni,55,45,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{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%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.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 n})();export{Xi as ProvidersManageComponent,Xi as SettingsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(t,c,n){let r=new Blob([c],{type:n}),o=URL.createObjectURL(r),e=document.createElement("a");e.href=o,e.download=t,document.body.appendChild(e),e.click(),e.remove(),URL.revokeObjectURL(o);}export{l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {Z as ZE,K as Kt,bm as Xc,I as Iw,P as Pw,bn as el,o as gI,L as Lh,p as Fw}from'./main-CHQMTVIP.js';var x=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({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&&(Xc(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),el(),Xc(6,"p",2),Iw(7),Pw(8,"transloco"),el()()()()),t&2&&(gI(4),Lh(Fw(5,2,"manage.preferences.title")),gI(3),Lh(Fw(8,4,"manage.preferences.body")));},dependencies:[Kt],styles:[".list-page[_ngcontent-%COMP%]{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 {g as f_,w as w_,I as I_,Y as Y$,S as S_}from'./chunk-C2BVYtVN.js';import {C,b4 as N2,aV as ix,b5 as cx,ba as Se,i as ie,s,r as r$1}from'./main-CHQMTVIP.js';var B=(()=>{class e{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/providers`;}listQueryTemplates(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates`).pipe(cx())}listExtendedActions(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/actions`).pipe(cx())}resolveQueryTemplate(t,i,s){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates/${encodeURIComponent(i)}/resolve`,{params:s}).pipe(cx())}previewModels(t){return this.http.post(`${this.baseUrl}/preview-models`,t).pipe(cx())}testConnection(t){return this.http.post(`${this.baseUrl}/test-connection`,t).pipe(cx())}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();var D=(()=>{class e{constructor(){this.http=C(N2),this.apiBase=ix.apiBaseUrl;}getSettings(){return this.http.get(`${this.apiBase}/settings`).pipe(cx())}updateSettings(t){return this.http.patch(`${this.apiBase}/settings`,t).pipe(cx())}listProviderInstances(){return this.http.get(`${this.apiBase}/provider-instances`).pipe(cx())}createProviderInstance(t){return this.http.post(`${this.apiBase}/provider-instances`,t).pipe(cx())}updateProviderInstance(t,i){return this.http.patch(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}`,i).pipe(cx())}deleteProviderInstance(t){return this.http.delete(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}`).pipe(cx())}testProviderConnection(t){return this.http.post(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}/test-connection`,{}).pipe(cx())}getProviderStatus(){return this.http.get(`${this.apiBase}/providers/status`).pipe(cx())}setSecret(t,i){return this.http.post(`${this.apiBase}/secrets/${encodeURIComponent(t)}`,{value:i},{responseType:"text"}).pipe(Se(()=>{}),cx())}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();var h=[{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"}],V=["ticket","pull_request","documentation"];function k(e){return h.find(n=>n.id===e)??h[0]}function T(e){return h.find(t=>t.kind!==e.kind||t.type!==e.type?false:t.kind==="agent"?true:S_(e)&&t.subjectType===e.subjectType)?.id??e.type}function H(e){let n=T(e);return k(n).labelKey}function v(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 L(){let e=h[0];return {originalId:null,id:"",idAutoSync:true,optionId:e.id,kind:e.kind,type:e.type,subjectType:e.subjectType??null,displayName:"",config:{},secretKey:w_("instance",e.kind),secretValue:"",expiresOn:"",defaultAgent:false,maxConcurrent:f_}}function Q(e,n=false){let t={};for(let o of v(e.type)){let p=e.config[o.key];typeof p=="string"&&(t[o.key]=p);}if(I_(e)){let o=e.config.model;typeof o=="string"&&o.trim()&&(t.model=o.trim());}let i=T(e),s=k(i);return {originalId:e.id,id:e.id,idAutoSync:false,optionId:i,kind:s.kind,type:s.type,subjectType:s.subjectType??null,displayName:e.displayName,config:t,secretKey:e.secretKey,secretValue:"",expiresOn:e.expiresOn??"",defaultAgent:s.kind==="agent"?n:false,maxConcurrent:I_(e)?e.maxConcurrent??f_:f_}}function Y(e,n){let t=k(n);return s(r$1({},e),{optionId:t.id,kind:t.kind,type:t.type,subjectType:t.subjectType??null,config:{},secretKey:w_(e.id||"instance",t.kind),defaultAgent:t.kind==="agent"?e.defaultAgent:false,maxConcurrent:t.kind==="agent"?e.maxConcurrent||f_:e.maxConcurrent})}function G(e,n,t){if(!e.idAutoSync)return s(r$1({},e),{displayName:n});let i=n.trim().length>0?Y$(n,t):"";return s(r$1({},e),{displayName:n,id:i,secretKey:w_(i||"instance",e.kind)})}function J(e,n){return s(r$1({},e),{id:n,idAutoSync:false,secretKey:w_(n.trim()||"instance",e.kind)})}function X(e){let n={};for(let p of v(e.type)){let I=(e.config[p.key]??"").trim();I&&(n[p.key]=I);}let t=e.id.trim(),i=e.displayName.trim()||t,s=e.secretKey.trim()||w_(t,e.kind),o=e.expiresOn.trim()||void 0;if(e.kind==="agent"){let p=(e.config.model??"").trim();return p&&(n.model=p),r$1({id:t,kind:"agent",type:e.type,displayName:i,config:n,secretKey:s,maxConcurrent:Math.max(1,Math.floor(Number(e.maxConcurrent)||f_))},o?{expiresOn:o}:{})}return r$1({id:t,kind:"subject",type:e.type,subjectType:e.subjectType??"ticket",displayName:i,config:n,secretKey:s},o?{expiresOn:o}:{})}function Z(e){return e.issues.map(n=>`${n.path.length>0?n.path.map(String).join("."):"(root)"}: ${n.message}`)}function $(e){return (e?.providerInstances??[]).filter(S_)}function z(e,n){return $(e).filter(t=>S_(t)&&n.includes(t.subjectType))}export{B,D,G,H,J,L,Q,V,X,Y,Z,h,v,z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as ae,l as le}from'./chunk-CRdEWPUM.js';import {T}from'./chunk-FOJfn_t9.js';import {H as He}from'./chunk-C7h8oMzu.js';import'./chunk-z2vvQAle.js';import {C,a as C1,R as J1,b7 as m,b8 as y,b as at,V as Ve,bo as O,bp as de,ba as Se,q as qo,U as Uw,u as ue$1,r as r$1,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,J as Jc,P as Pw,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,H as HD,G as FD,k as iE,x as xD,y as aE,B as AD,N as ND,n as uh,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';import {u as u_}from'./chunk-C2BVYtVN.js';import'./chunk-Cg2E0vnT.js';var ue=(t,s)=>s.id;function he(t,s){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function fe(t,s){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function ge(t,s){if(t&1&&(_i(0,"li"),Iw(1),Jc()),t&2){let e=s.$implicit;gI(),Lh(e);}}function _e(t,s){if(t&1&&(_i(0,"section",8)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"ul"),xD(5,ge,2,1,"li",null,ND),Jc()()),t&2){let e=HD(2);gI(2),Lh(Fw(3,1,"shortcuts.editor.validation")),gI(3),AD(e.validationErrors());}}function ve(t,s){if(t&1&&uh(0,"nz-option",12),t&2){let e=s.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=FD();_i(0,"app-workflow-input-form",14),mh("valuesChange",function(i){Fu(e);let u=HD(2);return ju(u.setInputValues(i))}),Jc();}if(t&2){let e=HD(2);lh("fields",s.inputSchema)("values",e.inputValues());}}function Ce(t,s){if(t&1){let e=FD();_D(0,_e,7,3,"section",8),_i(1,"label",9)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"input",10),mh("ngModelChange",function(i){Fu(e);let u=HD();return ju(u.name.set(i))}),Jc(),iE(),Jc(),_i(6,"div",9)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"nz-select",11),mh("ngModelChange",function(i){Fu(e);let u=HD();return ju(u.onWorkflowChange(i))}),xD(11,ve,1,2,"nz-option",12,ue),Jc(),iE(),Jc(),_D(13,we,1,2,"app-workflow-input-form",13);}if(t&2){let e,o=HD();MD(o.validationErrors().length>0?0:-1),gI(3),Lh(Fw(4,6,"shortcuts.editor.name")),gI(2),lh("ngModel",o.name()),aE(),gI(3),Lh(Fw(9,8,"shortcuts.editor.workflow")),gI(2),lh("ngModel",o.workflowId()),aE(),gI(),AD(o.eligibleWorkflows()),gI(2),MD((e=o.selectedWorkflow())?13:-1,e);}}function be(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 Ge=(()=>{class t{constructor(){this.route=C(C1),this.router=C(J1),this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),this.message=C(He),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=Uw(()=>!this.routeId()),this.pageTitle=Uw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{name:this.name().trim()}))),this.eligibleWorkflows=Uw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.subjectHandling==="per-subject")),this.selectedWorkflow=Uw(()=>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(ae(o?.inputSchema??[]));}setInputValues(e){this.inputValues.set(e);}save(){let e=this.routeId(),o=r$1({id:e??be(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=u_.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.nav.refresh(),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){return e instanceof bi||e instanceof Error?e.message:o}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-shortcut-editor"]],decls:15,vars:10,consts:[["data-testid","shortcut-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[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",2),Iw(4),Jc()(),_i(5,"div",3)(6,"a",4),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"button",5),mh("click",function(){return i.save()}),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,he,3,3,"p",6)(13,fe,2,1,"p",7)(14,Ce,14,10),Jc()),o&2&&(gI(4),Lh(i.pageTitle()),gI(3),Lh(Fw(8,6,"shortcuts.editor.backToList")),gI(2),lh("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),rl$1(" ",Fw(11,8,"common.save")," "),gI(2),MD(i.loading()?12:i.loadError()?13:14));},dependencies:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z,ex,Fm,Am,le,Kt],styles:[".editor[_ngcontent-%COMP%]{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{Ge as ShortcutEditorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-FOJfn_t9.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {N as Nt,K as Ke}from'./chunk-Edaw7VGW.js';import {n as ng,i as i_}from'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}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(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ng(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=i_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}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:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["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"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["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","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{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:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.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}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.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 i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {U}from'./chunk-Fwpw-z7T.js';import {f}from'./chunk-CeywzbyD.js';import {L as Lt}from'./chunk-CecXf-CU.js';import {y,S}from'./chunk-9U0WIegY.js';import'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=y,this.batchStatusTagColor=S,this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),v(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),v(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),v(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||v(t.status)){this.stopPolling();return}this.refreshMembers();},ot));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status",3,"nzColor","ngClass"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{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}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Dt as BatchDetailComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {S as St}from'./chunk-Bgl02GNl.js';import'./chunk-C0HCwfa5.js';import'./chunk-NZ-CPWJ2.js';import {Z as ZE,n as uh}from'./main-CHQMTVIP.js';import'./chunk-B2Xol2Un.js';import'./chunk-iE460Kz5.js';import'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a7 as KE,a8 as fu,aA as mT,C,a9 as Z0,b$ as Gm,ab as Oe,aB as yT,ae as Le$1,aC as zt,Z as ZE,a3 as Ah,a4 as Th,as as st,at as Ee,c0 as Mn,ai as ly,av as K0,l as _D,M as MD,aM as Yl,G as FD,j as _i,c1 as tc,J as Jc,H as HD,al as Sh,w as lh,o as gI,aw as rh,m as mh,n as uh,aJ as tl,I as Iw,aK as nl,L as Lh,O as Fu,Q as ju,c2 as ph}from'./main-CHQMTVIP.js';function X(n,i){n&1&&ph(0);}function $(n,i){if(n&1&&rh(0,X,1,0,"ng-container",7),n&2){let e=HD(3);lh("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&uh(0,"nz-icon",6),n&2){let e=HD(3);lh("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(_i(0,"div",2),_D(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),Jc()),n&2){let e=HD(2);gI(),MD(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(4);gI(),Lh(e.nzMessage);}}function on(n,i){if(n&1&&(_i(0,"span",8),rh(1,tn,2,1,"ng-container",7),Jc()),n&2){let e=HD(3);gI(),lh("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(4);gI(),Lh(e.nzDescription);}}function rn(n,i){if(n&1&&(_i(0,"span",9),rh(1,an,2,1,"ng-container",7),Jc()),n&2){let e=HD(3);gI(),lh("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(_i(0,"div",3),_D(1,on,2,1,"span",8),_D(2,rn,2,1,"span",9),Jc()),n&2){let e=HD(2);gI(),MD(e.nzMessage?1:-1),gI(),MD(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(3);gI(),Lh(e.nzAction);}}function sn(n,i){if(n&1&&(_i(0,"div",4),rh(1,cn,2,1,"ng-container",7),Jc()),n&2){let e=HD(2);gI(),lh("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(tl(0),_i(1,"span",12),Iw(2),Jc(),nl()),n&2){let e=HD(4);gI(2),Lh(e.nzCloseText);}}function mn(n,i){if(n&1&&rh(0,dn,3,1,"ng-container",7),n&2){let e=HD(3);lh("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&uh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=FD();_i(0,"button",10),mh("click",function(){Fu(e);let z=HD(2);return ju(z.closeAlert())}),_D(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),Jc();}if(n&2){let e=HD(2);gI(),MD(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=FD();_i(0,"div",1),tc(function(z){Fu(e);let T=HD();return ju(T.onLeaveAnimationDone(z))}),_D(1,en,3,1,"div",2),_D(2,ln,3,2,"div",3),_D(3,sn,2,1,"div",4),_D(4,_n,3,1,"button",5),Jc();}if(n&2){let e=HD();Sh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),lh("nzNoAnimation",e.nzNoAnimation),gI(),MD(e.nzShowIcon?1:-1),gI(),MD(e.nzMessage||e.nzDescription?2:-1),gI(),MD(e.nzAction?3:-1),gI(),MD(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],_=[Yl()],mT(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),mT(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(Z0);animationType=C(Gm,{optional:true});dir=C(Oe).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=yT(this,i,false);nzShowIcon=(yT(this,e),yT(this,z,false));nzBanner=(yT(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Le$1;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){zt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=ZE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",K0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",K0],nzBanner:[2,"nzBanner","nzBanner",K0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",K0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ly],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&_D(0,zn,5,23,"div",0),t&2&&MD(l.closed?-1:0);},dependencies:[Ah,Th,st,Ee,Mn],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[un]})}return n})();export{Gn as G,un as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {o as ot}from'./chunk-C0HCwfa5.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {f}from'./chunk-z2vvQAle.js';import {Z as ZE,n as uh,C,V as Ve,b as at,q as qo,r as r$1,u as ue$1,c as bi,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,H as HD,G as FD,k as iE,w as lh,y as aE,x as xD,B as AD,D as ch,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var ce=(i,h)=>h.id;function de(i,h){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function me(i,h){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function fe(i,h){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let e=HD(2);gI(),Lh(e.deleteError());}}function he(i,h){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let e=HD(3);gI(),Lh(e.saveError());}}function ue(i,h){if(i&1){let e=FD();_i(0,"section",6),_D(1,he,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formName.set(l))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formLocalPath.set(l))}),Jc()(),_i(12,"div",10)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"p",13),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formWorktreeBasePath.set(l))}),Jc()(),_i(20,"label",10)(21,"span"),Iw(22),Pw(23,"transloco"),Jc(),_i(24,"input",14),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formDefaultBranch.set(l))}),Jc(),iE(),Jc(),_i(25,"div",15)(26,"button",16),mh("click",function(){Fu(e);let l=HD(2);return ju(l.submitForm())}),Iw(27),Pw(28,"transloco"),Jc(),_i(29,"button",17),mh("click",function(){Fu(e);let l=HD(2);return ju(l.cancelForm())}),Iw(30),Pw(31,"transloco"),Jc()()();}if(i&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,13,"local-repos.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,15,"local-repos.form.localPath")),gI(2),lh("path",e.formLocalPath()),gI(3),Lh(Fw(15,17,"local-repos.form.worktreeBasePath")),gI(3),Lh(Fw(18,19,"local-repos.form.worktreeBaseHint")),gI(2),lh("path",e.formWorktreeBasePath()),gI(3),Lh(Fw(23,21,"local-repos.form.defaultBranch")),gI(2),lh("ngModel",e.formDefaultBranch()),aE(),gI(2),lh("disabled",e.saving()),gI(),rl$1(" ",Fw(28,23,"common.save")," "),gI(3),rl$1(" ",Fw(31,25,"common.cancel")," ");}}function _e(i,h){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Ce(i,h){if(i&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",18),Iw(4),Jc(),_i(5,"td",18),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td",19)(10,"button",20),mh("click",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.openEditForm(l))}),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"button",21),Pw(14,"transloco"),mh("nzOnConfirm",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.deleteRepo(l))}),Iw(15),Pw(16,"transloco"),Jc()()();}if(i&2){let e=h.$implicit;ch("data-testid","local-repo-row-"+e.id),gI(2),Lh(e.name),gI(2),Lh(e.localPath),gI(2),Lh(e.worktreeBasePath||"\u2014"),gI(2),Lh(e.defaultBranch||"\u2014"),gI(2),ch("data-testid","edit-local-repo-"+e.id),gI(),rl$1(" ",Fw(12,10,"local-repos.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(14,12,"local-repos.deleteConfirm")),ch("data-testid","delete-local-repo-"+e.id),gI(2),rl$1(" ",Fw(16,14,"local-repos.delete")," ");}}function ge(i,h){if(i&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,Ce,17,16,"tr",null,ce),Jc()()),i&2){let e=HD(2);lh("nzData",e.repos())("nzShowPagination",false),gI(4),Lh(Fw(5,7,"local-repos.column.name")),gI(3),Lh(Fw(8,9,"local-repos.column.localPath")),gI(3),Lh(Fw(11,11,"local-repos.column.worktreeBasePath")),gI(3),Lh(Fw(14,13,"local-repos.column.defaultBranch")),gI(3),Lh(Fw(17,15,"local-repos.column.actions")),gI(3),AD(e.repos());}}function xe(i,h){if(i&1&&(_D(0,fe,2,1,"p",5),_D(1,ue,32,27,"section",6),_D(2,_e,3,3,"p",7)(3,ge,21,17,"nz-table",8)),i&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.formOpen()?1:-1),gI(),MD(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class i{constructor(){this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.formName=qo(""),this.formLocalPath=qo(""),this.formWorktreeBasePath=qo(""),this.formDefaultBranch=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),this.formDefaultBranch.set(e.defaultBranch??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1(r$1({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),this.formDefaultBranch().trim()?{defaultBranch:this.formDefaultBranch().trim()}:{defaultBranch:void 0}),a=this.editingId();(a?this.reposApi.update(a,e):this.reposApi.create(e)).pipe(ue$1(this.destroyRef)).subscribe({next:d=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(le=>[...le.filter(M=>M.id!==d.id),d].sort((M,se)=>M.name.localeCompare(se.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set("");},error:d=>{this.saving.set(false),this.saveError.set(this.errorMessage(d,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.repos.update(a=>a.filter(l=>l.id!==e.id));},error:a=>{this.deleteError.set(this.errorMessage(a,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.repos.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("local-repos.loadFailed")));}});}errorMessage(e,a){return e instanceof bi||e instanceof Error?e.message:a}static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repository-list"]],decls:11,vars:7,consts:[["data-testid","local-repos-manage",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","type","button","data-testid","create-local-repo",3,"click"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","local-repo-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","local-repo-table",3,"nzData","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","local-repo-name",3,"ngModelChange","ngModel"],["mode","directories",3,"pathChange","path"],[1,"hint"],["nz-input","","data-testid","local-repo-default-branch",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","save-local-repo",3,"click","disabled"],["nz-button","","type","button","data-testid","cancel-local-repo",3,"click"],[1,"path-cell"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"]],template:function(a,l){a&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.openCreateForm()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Jc()),a&2&&(gI(3),Lh(Fw(4,3,"local-repos.title")),gI(3),rl$1(" ",Fw(7,5,"local-repos.create")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{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}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return i})();var qe=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(a,l){a&1&&uh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return i})();export{qe as LocalRepositoriesManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-B7WkIFy0.js';import {L as Lt$1}from'./chunk-CecXf-CU.js';import'./chunk-C2BVYtVN.js';import'./chunk-iE460Kz5.js';import {L as Lt,u as ut,D as Di,m as mn}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';import {C,$,a as C1,V as Ve,b as at,q as qo,U as Uw,u as ue$1,s,r as r$1,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,k as iE,l as _D,n as uh,x as xD,N as ND,o as gI,L as Lh,p as Fw,w as lh,y as aE,z as rl$1,M as MD,B as AD,H as HD,D as ch,E as Aw,G as FD,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import'./chunk-9U0WIegY.js';var re=t=>["/jobs",t],oe=(t,a)=>a.id,ae=(t,a)=>a.jobId+a.stepExecutionId;function le(t,a){t&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function de(t,a){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.queuedError());}}function pe(t,a){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.queuedEmpty")," "));}function ue(t,a){if(t&1&&(_i(0,"tr")(1,"td")(2,"a",25),Iw(3),Jc()(),_i(4,"td",26),Iw(5),Jc(),_i(6,"td",27),Iw(7),Jc()()),t&2){let e=a.$implicit,s=HD(2);ch("data-testid","queued-row-"+e.jobId),gI(2),lh("routerLink",Aw(6,re,e.jobId)),ch("data-testid","queued-job-link-"+e.jobId),gI(),rl$1(" ",e.jobId," "),gI(2),Lh(e.agentInstanceId),gI(2),Lh(s.queuedWaitLabel(e.enqueuedAt));}}function ce(t,a){if(t&1&&(_i(0,"table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc()()(),_i(12,"tbody"),xD(13,ue,8,8,"tr",null,ae),Jc()()),t&2){let e=HD();gI(4),Lh(Fw(5,3,"jobs.table.column.id")),gI(3),Lh(Fw(8,5,"jobs.list.queuedAgent")),gI(3),Lh(Fw(11,7,"jobs.list.queuedWait")),gI(3),AD(e.queuedSteps());}}function he(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function me(t,a){t&1&&(_i(0,"p",15),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ge(t,a){if(t&1&&(_i(0,"p",16),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.runningError());}}function fe(t,a){t&1&&(_i(0,"p",17),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.runningEmpty")," "));}function be(t,a){if(t&1&&uh(0,"app-job-status-table",18),t&2){let e=HD();lh("jobs",e.runningJobs());}}function _e(t,a){if(t&1&&(uh(0,"nz-option",14),Pw(1,"transloco"),Pw(2,"transloco")),t&2){let e=a.$implicit,s=HD();lh("nzValue",e)("nzLabel",e==="all"?Fw(1,2,"jobs.list.filterAll"):Fw(2,4,s.statusKey(e)));}}function ye(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function Ce(t,a){t&1&&(_i(0,"p",22),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function xe(t,a){if(t&1&&(_i(0,"p",23),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.historyError());}}function Me(t,a){t&1&&(_i(0,"p",24),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.historyEmpty")," "));}function ve(t,a){if(t&1){let e=FD();_i(0,"nz-pagination",29),mh("nzPageIndexChange",function(o){Fu(e);let m=HD(2);return ju(m.setHistoryPage(o))}),Jc();}if(t&2){let e=HD(2);lh("nzPageIndex",e.historyPageIndex())("nzPageSize",e.pageSize)("nzTotal",e.historyTotal());}}function Ie(t,a){if(t&1&&(uh(0,"app-job-status-table",18),_D(1,ve,1,3,"nz-pagination",28)),t&2){let e=HD();lh("jobs",e.historyJobs()),gI(),MD(e.historyTotal()>e.pageSize||e.historyPageIndex()>1?1:-1);}}var we=20,Se=50,Ee=3e3,se=["completed","failed","cancelled"],Qe=(()=>{class t{constructor(){this.jobsApi=C($),this.workflowsApi=C(b),this.route=C(C1),this.transloco=C(Ve),this.destroyRef=C(at),this.pageSize=we,this.historyStatusOptions=["all",...se],this.runningJobs=qo([]),this.queuedSteps=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.queuedLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.queuedError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Uw(()=>{let e=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?e+s:e+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let s=e.get("status");s&&se.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadQueued(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(e){return `jobs.status.${e}`}isPolling(){return this.polling()}setHistoryStatusFilter(e){this.historyStatusFilter.set(e),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(e){this.runningWorkflowId.set(e),this.loadRunning();}setHistoryWorkflowId(e){this.historyWorkflowId.set(e),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(e){this.showChildJobs.set(e),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(e){this.historyPageIndex.set(e),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e);},error:()=>{this.workflows.set([]);}});}loadRunning(e={}){let s$1=this.runningWorkflowId();e.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r$1({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Se,offset:0})).pipe(ue$1(this.destroyRef)).subscribe({next:o=>{this.runningJobs.set(o),this.runningLoading.set(false);},error:o=>{this.runningLoading.set(false),!e.silent&&this.runningError.set(this.errorMessage(o,this.transloco.translate("jobs.list.loadFailed")));}});}queuedWaitLabel(e){let s=Date.now()-Date.parse(e),o=Number.isFinite(s)?Math.max(0,Math.floor(s/1e3)):0;if(o<60)return `${o}s`;let m=Math.floor(o/60);return m<60?`${m}m`:`${Math.floor(m/60)}h`}loadQueued(e={}){e.silent||(this.queuedLoading.set(true),this.queuedError.set(null)),this.jobsApi.listQueued().pipe(ue$1(this.destroyRef)).subscribe({next:s=>{this.queuedSteps.set(s),this.queuedLoading.set(false);},error:s=>{this.queuedLoading.set(false),!e.silent&&this.queuedError.set(this.errorMessage(s,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(e={}){let s$1=this.historyStatusFilter(),o=this.historyWorkflowId();e.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r$1(r$1({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),o?{workflowId:o}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue$1(this.destroyRef)).subscribe({next:m=>{this.historyJobs.set(m),this.historyLoading.set(false);},error:m=>{this.historyLoading.set(false),!e.silent&&this.historyError.set(this.errorMessage(m,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true});},Ee),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(e,s){return e instanceof bi||e instanceof Error?e.message:s}static{this.\u0275fac=function(s){return new(s||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-job-list"]],decls:62,vars:37,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-queued",1,"section"],[1,"section-header"],["data-testid","queued-loading"],["data-testid","queued-error",1,"error"],["data-testid","queued-empty",1,"section-empty"],["data-testid","jobs-queued-table",1,"queued-table"],["data-testid","jobs-running",1,"section"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],[3,"routerLink"],["data-testid","queued-agent"],["data-testid","queued-wait"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,o){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc()(),_i(5,"label",2),mh("ngModelChange",function(b){return o.setShowChildJobs(b)}),Iw(6),Pw(7,"transloco"),Jc(),iE(),_i(8,"section",3)(9,"header",4)(10,"h2"),Iw(11),Pw(12,"transloco"),Jc()(),_D(13,le,3,3,"p",5)(14,de,2,1,"p",6)(15,pe,3,3,"p",7)(16,ce,15,9,"table",8),Jc(),_i(17,"section",9)(18,"header",4)(19,"h2"),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"div",10)(23,"div",11)(24,"span"),Iw(25),Pw(26,"transloco"),Jc(),_i(27,"nz-select",12),mh("ngModelChange",function(b){return o.setRunningWorkflowId(b)}),uh(28,"nz-option",13),Pw(29,"transloco"),xD(30,he,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(32,me,3,3,"p",15)(33,ge,2,1,"p",16)(34,fe,3,3,"p",17)(35,be,1,1,"app-job-status-table",18),Jc(),_i(36,"section",19)(37,"header",4)(38,"h2"),Iw(39),Pw(40,"transloco"),Jc()(),_i(41,"div",10)(42,"div",11)(43,"span"),Iw(44),Pw(45,"transloco"),Jc(),_i(46,"nz-select",20),mh("ngModelChange",function(b){return o.setHistoryStatusFilter(b)}),xD(47,_e,3,6,"nz-option",14,ND),Jc(),iE(),Jc(),_i(49,"div",11)(50,"span"),Iw(51),Pw(52,"transloco"),Jc(),_i(53,"nz-select",21),mh("ngModelChange",function(b){return o.setHistoryWorkflowId(b)}),uh(54,"nz-option",13),Pw(55,"transloco"),xD(56,ye,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(58,Ce,3,3,"p",22)(59,xe,2,1,"p",23)(60,Me,3,3,"p",24)(61,Ie,2,2),Jc()()),s&2&&(gI(3),Lh(Fw(4,17,"jobs.list.title")),gI(2),lh("ngModel",o.showChildJobs()),aE(),gI(),rl$1(" ",Fw(7,19,"jobs.list.showChildJobs")," "),gI(5),Lh(Fw(12,21,"jobs.list.queued")),gI(2),MD(o.queuedLoading()?13:o.queuedError()?14:o.queuedSteps().length===0?15:16),gI(7),Lh(Fw(21,23,"jobs.list.running")),gI(5),Lh(Fw(26,25,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.runningWorkflowId()),aE(),gI(),lh("nzLabel",Fw(29,27,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.runningLoading()?32:o.runningError()?33:o.runningJobs().length===0?34:35),gI(7),Lh(Fw(40,29,"jobs.list.history")),gI(5),Lh(Fw(45,31,"jobs.list.filterByStatus")),gI(2),lh("ngModel",o.historyStatusFilter()),aE(),gI(),AD(o.historyStatusOptions),gI(4),Lh(Fw(52,33,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.historyWorkflowId()),aE(),gI(),lh("nzLabel",Fw(55,35,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.historyLoading()?58:o.historyError()?59:o.historyJobs().length===0?60:61));},dependencies:[$8,al,rl,$i,v3,Lt,ut,Di,mn,ex,Fm,Am,Lt$1,Kt],styles:[".list-page[_ngcontent-%COMP%]{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:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.queued-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .queued-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.5rem .75rem .5rem 0;border-bottom:1px solid #e7e5e4}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e;font-weight:600}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{we as JOB_LIST_PAGE_SIZE,Se as JOB_RUNNING_LIMIT,Ee as JOB_RUNNING_POLL_MS,Qe as JobListComponent,se as TERMINAL_JOB_STATUSES};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a7 as KE,a8 as fu,bP as hn,aA as mT,C,a9 as Z0,ab as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,aj as $D,l as _D,j as _i,J as Jc,M as MD,o as gI,aQ as aw,al as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,ai as ly,H as HD,aw as rh,w as lh,n as uh,aR as xw,ak as UD,x as xD,aO as SD,B as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ac as Er,N as ND}from'./main-CHQMTVIP.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {H as H$,Y as Y$}from'./chunk-C2BVYtVN.js';import {s,r as r$1,t as t$1}from'./main-CHQMTVIP.js';var y=["agent","interaction","shell","extract","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 _(t,e){return t.map(n=>{let r=s(r$1({},n),{_key:d(),_idAutoSync:e.idAutoSync});return n.type==="loop"?s(r$1({},r),{steps:_(n.steps,e)}):r})}function h(t,e){let n=e?.id??"",r=e?.name??"",i={_key:e?.key??d(),_idAutoSync:e?.idAutoSync??true};switch(t){case "agent":return r$1({type:t,id:n,name:r,objective:"",outputFormat:"free_text"},i);case "interaction":return r$1({type:t,id:n,name:r,interaction:"questionnaire"},i);case "shell":return r$1({type:t,id:n,name:r,command:""},i);case "extract":return r$1({type:t,id:n,name:r,source:"",onNoMatch:"fail"},i);case "git":return r$1({type:t,id:n,name:r,operation:"create_worktree",params:{}},i);case "provider_action":return r$1({type:t,id:n,name:r,action:"get_subject",params:{}},i);case "sub_workflow":return r$1({type:t,id:n,name:r,workflowId:"",forEach:"selection"},i);case "loop":return r$1({type:t,id:n,name:r,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=t$1(i,["_key","_idAutoSync"]);return r.type==="loop"?s(r$1({},r),{steps:r.steps.map(a=>m(a))}):r}function v(t,e={}){let n=t.steps.map(x=>{let u=m(x);if(!u.id){let p=u,{id:g}=p;return t$1(p,["id"])}return u}),a=t,{id:r}=a,i=t$1(a,["id"]);return e.omitWorkflowId||!r?s(r$1({},i),{steps:n}):s(r$1({},i),{id:r,steps:n})}function E(t,e,n){if(!t._idAutoSync)return s(r$1({},t),{name:e});let r=H$(n);t.id&&r.delete(t.id);let i=e.trim().length>0?Y$(e,r):"";return s(r$1({},t),{name:e,id:i})}function P(t,e){return s(r$1({},t),{id:e,_idAutoSync:false})}export{A,E,I,P,T,_,b,h,j,v,y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {C,b4 as N2,aV as ix,b_ as u,b5 as cx,i as ie}from'./main-CHQMTVIP.js';var U=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(cx())}launch(t){return this.http.post(this.baseUrl,t).pipe(cx())}cancel(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/cancel`,{}).pipe(cx())}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 {f}from'./chunk-z2vvQAle.js';import {x,h,w}from'./chunk-9U0WIegY.js';import'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';import {Z as ZE,n as uh,C,$,V as Ve,b as at,S as p,q as qo,U as Uw,u as ue$1,aW as Ng,c as bi,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl,M as MD,H as HD,x as xD,B as AD,G as FD,D as ch,E as Aw,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var pe=t=>["/jobs",t],ce=(t,d)=>d.id;function me(t,d){t&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function he(t,d){if(t&1&&(_i(0,"p",4),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function ue(t,d){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.actionError());}}function fe(t,d){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"worktrees.activeWarning")));}function ge(t,d){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"worktrees.emptyState")));}function Ce(t,d){if(t&1){let e=FD();_i(0,"tr")(1,"td")(2,"label",9),mh("nzCheckedChange",function(l){let b=Fu(e).$implicit,le=HD(3);return ju(le.toggleSelected(b.id,l))}),Jc()(),_i(3,"td")(4,"a",10),Iw(5),Jc()(),_i(6,"td"),Iw(7),Jc(),_i(8,"td"),Iw(9),Jc(),_i(10,"td",11),Iw(11),Jc(),_i(12,"td")(13,"nz-tag",12),Iw(14),Pw(15,"transloco"),Jc()(),_i(16,"td"),Iw(17),Jc()();}if(t&2){let e=d.$implicit,i=HD(3);ch("data-testid","worktree-row-"+e.id),gI(2),lh("nzChecked",i.isSelected(e.id)),ch("data-testid","worktree-select-"+e.id),gI(2),lh("routerLink",Aw(16,pe,e.id)),ch("data-testid","worktree-job-"+e.id),gI(),Lh(e.id),gI(2),Lh(i.repoName(e)),gI(2),Lh(e.branch??"\u2014"),gI(2),Lh(e.worktreePath),gI(2),lh("nzColor",i.jobStatusTagColor(e.status,i.theme.theme()))("ngClass",i.jobStatusTagClass(e.status,i.theme.theme())),ch("data-testid","worktree-status-"+e.id),gI(),Lh(Fw(15,14,i.statusKey(e.status))),gI(3),Lh(e.createdAt);}}function xe(t,d){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),uh(3,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"th"),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"th"),Iw(20),Pw(21,"transloco"),Jc()()(),_i(22,"tbody"),xD(23,Ce,18,18,"tr",null,ce),Jc()()),t&2){let e=HD(2);lh("nzData",e.jobs())("nzShowPagination",false),gI(5),Lh(Fw(6,8,"worktrees.column.job")),gI(3),Lh(Fw(9,10,"worktrees.column.repository")),gI(3),Lh(Fw(12,12,"worktrees.column.branch")),gI(3),Lh(Fw(15,14,"worktrees.column.path")),gI(3),Lh(Fw(18,16,"worktrees.column.status")),gI(3),Lh(Fw(21,18,"worktrees.column.created")),gI(3),AD(e.jobs());}}function be(t,d){if(t&1&&(_D(0,ue,2,1,"p",5),_D(1,fe,3,3,"p",6),_D(2,ge,3,3,"p",7)(3,xe,25,20,"nz-table",8)),t&2){let e=HD();MD(e.actionError()?0:-1),gI(),MD(e.selectedHasActive()?1:-1),gI(),MD(e.jobs().length===0?2:3);}}var se=(()=>{class t{constructor(){this.jobsApi=C($),this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.theme=C(p),this.jobStatusTagClass=x,this.jobStatusTagColor=h,this.jobs=qo([]),this.repos=qo([]),this.selectedIds=qo([]),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.deleting=qo(false),this.selectedHasActive=Uw(()=>this.selectedJobs().some(e=>!w(e.status))),this.selectedJobs=Uw(()=>{let e=new Set(this.selectedIds());return this.jobs().filter(i=>e.has(i.id))}),this.reload();}statusKey(e){return `jobs.status.${e}`}repoName(e){return this.repos().find(l=>_e(e,l))?.name??"\u2014"}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,i){this.selectedIds.update(l=>i?l.includes(e)?l:[...l,e]:l.filter(b=>b!==e)),this.actionError.set(null);}deleteSelected(){if(!(this.deleting()||this.selectedIds().length===0)){if(this.selectedHasActive()){this.actionError.set(this.transloco.translate("worktrees.activeWarning"));return}this.deleting.set(true),this.actionError.set(null),this.jobsApi.deleteWorktrees(this.selectedIds()).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.deleting.set(false),this.selectedIds.set([]),this.reload();},error:e=>{this.deleting.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("worktrees.deleteFailed")));}});}}reload(){this.loading.set(true),this.loadError.set(null),Ng({jobs:this.jobsApi.list({liveWorktree:true}),repos:this.reposApi.list()}).pipe(ue$1(this.destroyRef)).subscribe({next:({jobs:e,repos:i})=>{this.jobs.set(e),this.repos.set(i),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("worktrees.loadFailed")));}});}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-worktree-list"]],decls:11,vars:8,consts:[["data-testid","worktrees-manage",1,"list-page"],[1,"header"],["nz-button","","nzDanger","","type","button","data-testid","delete-worktrees",3,"click","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","active-warning",1,"warn"],["data-testid","empty-state",1,"empty"],["data-testid","worktree-table",3,"nzData","nzShowPagination"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],[3,"routerLink"],[1,"path-cell"],[3,"nzColor","ngClass"]],template:function(i,l){i&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.deleteSelected()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,me,3,3,"p",3)(9,he,2,1,"p",4)(10,be,4,3),Jc()),i&2&&(gI(3),Lh(Fw(4,4,"worktrees.title")),gI(2),lh("disabled",l.deleting()||l.selectedIds().length===0),gI(),rl(" ",Fw(7,6,"worktrees.deleteSelected")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,M5,v3,pf,bd,sp,fp,Lt,ut,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{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}.error[_ngcontent-%COMP%]{color:#9f1239}.warn[_ngcontent-%COMP%]{color:#92400e}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();function _e(t,d){let e=(t.worktreePath??"").replaceAll("\\","/"),i=d.localPath.replaceAll("\\","/").replace(/\/+$/,""),l=(d.worktreeBasePath??ke(i)).replaceAll("\\","/");return e.startsWith(l)||e.startsWith(i)}function ke(t){let d=t.split("/"),e=d.pop()??"repo";return `${d.join("/")}/${e}-worktrees`}var qe=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-worktrees-manage"]],decls:1,vars:0,template:function(i,l){i&1&&uh(0,"app-worktree-list");},dependencies:[se],encapsulation:2});}}return t})();export{qe as WorktreesManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a7 as KE,a8 as fu,aA as mT,aB as yT,a5 as q0,av as K0,U as Uw,s,r as r$1,ae as Le$1,u as ue,bR as eD,c3 as th,al as Sh,q as qo,ap as re,C,c4 as Uo,c5 as Q0,c6 as em,ar as sn,c7 as Gl,Z as ZE,c8 as vo,c9 as Wt,ca as _o,cb as Gl$1,cc as zh,cd as Fh,c0 as Mn,as as st,at as Ee,a3 as Ah,a4 as Th,Y as pf,a0 as bd,a1 as sp,a2 as fp,ce as $b,cf as Zb,aw as rh,m as mh,w as lh,ax as Eh,bf as _r,an as WD,ao as GD,aM as Yl,cg as oc,bW as Bl,ch as Sy,G as FD,j as _i,ci as oi,cj as ri,l as _D,J as Jc,ck as $h,P as Pw,I as Iw,H as HD,aQ as aw,aG as lw,o as gI,M as MD,D as ch,p as Fw,z as rl,cl as Vi,bV as XI,be as E3,b as at,cm as Wm,cn as S2,co as Kg,cp as Yg,cq as kg,cr as kr,cs as xy,ai as ly,ab as Oe,a9 as Z0,ct as Sr,cu as Cr,cv as me,cw as Rg,cx as yo,cy as _n$1,ac as Er,aD as Nr,n as uh,aJ as tl,aK as nl,ad as jr,L as Lh,aT as Vw,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var lt=["overlay"];function ct(i,m){if(i&1&&(tl(0),Iw(1),nl()),i&2){let e=HD(2);gI(),Lh(e.nzTitle);}}function pt(i,m){if(i&1){let e=FD();_i(0,"div",2),oi(function(){Fu(e);let n=HD();return ju(n.zoomAnimationLeave())}),ri(function(){Fu(e);let n=HD();return ju(n.zoomAnimationEnter())}),uh(1,"div",3),_i(2,"div",4)(3,"div",5),rh(4,ct,2,1,"ng-container",6),Jc()()();}if(i&2){let e=HD();aw(e.nzOverlayStyle),lw(e._classMap),Sh("ant-tooltip-rtl",e.dir()==="rtl"),lh("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),aw(e._arrowStyleMap),gI(2),aw(e._contentStyleMap),gI(),lh("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext);}}var tt=(()=>{class i{componentType;elementRef=C(_r);hostView=C(Vi);renderer=C(XI);noAnimation=C(Mn,{host:true,optional:true});nzConfigService=C(E3);destroyRef=C(at);platformId=C(Wm);config;visibleChange=new Le$1;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(){S2(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(sn(Boolean),Yg(0,kg),sn(()=>!!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$1({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=eD({type:i,features:[ly]})}return i})(),mt=(()=>{class i{noAnimation=C(Mn,{host:true,optional:true});dir=C(Oe).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=jr(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=>Sr(me[n],Cr[n]));this._positions=[...t,...Rg];}preferredPlacement="top";origin;_classMap={};_prefix="ant-tooltip";_positions=[...Rg];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=yo(e),this.updateStyles(),this.cdr.detectChanges();}setOverlayOrigin(e){this.origin=e,this.cdr.markForCheck();}onClickOutside(e){if(!this.nzOverlayClickable)return;let t=_n$1(e);!this.origin.nativeElement.contains(t)&&this.nzTrigger!==null&&this.hide();}updateVisibilityByTitle(){this.isEmpty()&&this.hide();}updateStyles(){this._classMap=s(r$1({},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=eD({type:i,viewQuery:function(t,n){if(t&1&&Eh(lt,5),t&2){let o;WD(o=GD())&&(n.overlay=o.first);}}})}return i})();function ut(i){return i instanceof Er?false:i===""||!Nr(i)}var nt=(()=>{class i extends mt{_animationPrefix="ant-zoom-big-fast";nzTitle=null;nzTitleContext=null;nzColor;_arrowStyleMap={};_contentStyleMap={};zoomAnimationEnter=oc(()=>`${this._animationPrefix}-enter ${this._animationPrefix}-enter-active`);zoomAnimationLeave=oc(()=>`${this._animationPrefix}-leave ${this._animationPrefix}-leave-active`);isEmpty(){return ut(this.nzTitle)}updateStyles(){let e=this.nzColor&&Bl(this.nzColor);this._classMap=s(r$1({},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=ZE({type:i,selectors:[["nz-tooltip"]],exportAs:["nzTooltipComponent"],features:[th],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&&(rh(0,pt,5,13,"ng-template",1,0,Vw),mh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&lh("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayOpen",n._visible)("cdkConnectedOverlayPositions",n._positions)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[vo,Wt,Mn,st,Ee,_o,Gl$1],encapsulation:2})}return i})();var dt=["okBtn"],ft=["cancelBtn"];function zt(i,m){i&1&&uh(0,"div",5);}function ht(i,m){if(i&1&&(tl(0),uh(1,"nz-icon",17),nl()),i&2){let e=m.$implicit;gI(),lh("nzType",e||"exclamation-circle");}}function vt(i,m){if(i&1&&(_i(0,"span",10),rh(1,ht,2,1,"ng-container",16),Jc()),i&2){let e=HD(2);gI(),lh("nzStringTemplateOutlet",e.nzIcon);}}function yt(i,m){if(i&1&&(tl(0),Iw(1),nl()),i&2){let e=HD(2);gI(),rl(" ",e.nzTitle," ");}}function gt(i,m){if(i&1){let e=FD();_i(0,"div",4),oi(function(){Fu(e);let n=HD();return ju(n.zoomAnimationLeave())}),ri(function(){Fu(e);let n=HD();return ju(n.zoomAnimationEnter())}),_D(1,zt,1,0,"div",5),_i(2,"div",6)(3,"div",7)(4,"div")(5,"div",8)(6,"div",9),_D(7,vt,2,1,"span",10),_i(8,"div",11),rh(9,yt,2,1,"ng-container",12),Jc()(),_i(10,"div",13)(11,"button",14,1),mh("click",function(){Fu(e);let n=HD();return ju(n.onCancel())}),$h(13),Pw(14,"nzI18n"),Iw(15),Jc(),_i(16,"button",15,2),mh("click",function(){Fu(e);let n=HD();return ju(n.onConfirm())}),$h(18),Pw(19,"nzI18n"),Iw(20),Jc()()()()()()();}if(i&2){let e=HD();aw(e.nzOverlayStyle),lw(e._classMap),Sh("ant-popover-rtl",e.dir()==="rtl"),lh("cdkTrapFocusAutoCapture",e.nzAutoFocus!==null)("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),MD(e.nzPopconfirmShowArrow?1:-1),gI(6),MD(e.nzIcon!==null?7:-1),gI(2),lh("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext),gI(2),lh("nzDanger",e.nzCancelButtonProps()?.nzDanger)("disabled",e.nzCancelButtonProps()?.nzDisabled),ch("cdkFocusInitial",e.nzAutoFocus==="cancel"||null);let t=e.nzCancelText()||Fw(14,22,"Modal.cancelText");gI(4),rl(" ",t," "),gI(),lh("nzType",e.nzOkButtonProps().nzType)("nzDanger",e.nzOkButtonProps().nzDanger)("nzLoading",e.confirmLoading)("disabled",e.nzOkButtonProps().nzDisabled),ch("cdkFocusInitial",e.nzAutoFocus==="ok"||null);let n=e.nzOkText()||Fw(19,24,"Modal.okText");gI(4),rl(" ",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=[Yl()],n=[Yl()],mT(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),mT(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=yT(this,e,false);nzAutofocus=(yT(this,t),yT(this,o,null));nzOkText=(yT(this,c),q0(null));nzOkType=q0("primary");nzCancelText=q0(null);nzOkButtonProps=q0(null);nzCancelButtonProps=q0(null);nzOkDisabled=q0(false,{transform:K0});nzOkDanger=q0(false,{transform:K0});okButtonProps=Uw(()=>s(r$1({},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=Uw(()=>r$1({},this.nzCancelButtonProps()));directiveContent=null;content=null;overlayClickable;visibleChange=new Le$1;nzOnCancel=new Le$1;nzOnConfirm=new Le$1;getProxyPropertyMap(){return r$1({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=eD({type:he,selectors:[["","nz-popconfirm",""]],hostVars:2,hostBindings:function(a,N){a&2&&Sh("ant-popover-open",N.visible);},inputs:{arrowPointAtCenter:[2,"nzPopconfirmArrowPointAtCenter","arrowPointAtCenter",K0],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",K0],nzPopconfirmShowArrow:[2,"nzPopconfirmShowArrow","nzPopconfirmShowArrow",K0],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:[th]})}})(),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(),Q0(this.nzBeforeConfirm()).pipe(em(),sn(Boolean),Gl(()=>{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=ZE({type:i,selectors:[["nz-popconfirm"]],viewQuery:function(t,n){if(t&1&&Eh(dt,5,_r)(ft,5,_r),t&2){let o;WD(o=GD())&&(n.okBtn=o),WD(o=GD())&&(n.cancelBtn=o);}},exportAs:["nzPopconfirmComponent"],features:[th],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&&(rh(0,gt,21,26,"ng-template",3,0,Vw),mh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&lh("cdkConnectedOverlayHasBackdrop",n.nzBackdrop)("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayOpen",n._visible)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[vo,Wt,_o,Gl$1,zh,Fh,Mn,st,Ee,Ah,Th,pf,bd,sp,fp,$b,Zb],encapsulation:2})}return i})(),_n=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=KE({type:i});static \u0275inj=fu({imports:[it]})}return i})();export{Cn as C,_n as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as ae,l as le}from'./chunk-CRdEWPUM.js';import {H as He}from'./chunk-C7h8oMzu.js';import {C,$ as $$1,b0 as jn,R as J1,V as Ve,s,r as r$1,c as bi,i as ie,b2 as Le,b3 as Wn,q as qo,U as Uw,Z as ZE,d as $8,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,m as mh,I as Iw,P as Pw,J as Jc,o as gI,M as MD,w as lh,z as rl,p as Fw,G as FD,H as HD,L as Lh,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';function M(e){return e.inputSchema.filter(a=>a.required)}function A(e,a){return e.appliesTo!=="none"&&!a.subjectId?.trim()}function Y(e,a){return A(e,a)||M(e).length>0}function x(e,a){return e.appliesTo==="none"?void 0:a.subjectId?.trim()||void 0}function et(e,a){if(e&1){let t=FD();_i(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"input",7),Pw(5,"transloco"),mh("input",function(o){Fu(t);let n=HD();return ju(n.setSubjectId(o))}),Jc()();}if(e&2){let t=HD();gI(2),Lh(Fw(3,3,"jobs.start.subjectId")),gI(2),lh("value",t.subjectId())("placeholder",Fw(5,5,"jobs.start.subjectIdPlaceholder"));}}function it(e,a){if(e&1){let t=FD();_i(0,"app-workflow-input-form",8),mh("valuesChange",function(o){Fu(t);let n=HD();return ju(n.inputValues.set(o))}),Jc();}if(e&2){let t=HD();lh("fields",t.requiredFields())("values",t.inputValues());}}function ot(e,a){if(e&1&&(_i(0,"p",3),Iw(1),Jc()),e&2){let t=HD();gI(),Lh(t.actionError());}}var $=(()=>{class e{constructor(){this.jobsApi=C($$1),this.router=C(J1),this.transloco=C(Ve),this.modalRef=C(Le),this.data=C(Wn),this.subjectId=qo(this.data.subjectId??""),this.inputValues=qo(ae(M(this.data.workflow))),this.starting=qo(false),this.actionError=qo(null),this.showSubjectPicker=Uw(()=>A(this.data.workflow,this.context())),this.requiredFields=Uw(()=>M(this.data.workflow));}setSubjectId(t){this.subjectId.set(t.target.value);}start(){let t=this.data.workflow;if(this.showSubjectPicker()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}let i={workflowId:t.id,subjectId:this.subjectId().trim()||this.data.subjectId},o=x(t,i);this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r$1({workflowId:t.id},o?{subjectId:o}:{}),{inputValues:r$1({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.modalRef.close(),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}cancel(){this.modalRef.close();}context(){return {workflowId:this.data.workflow.id,subjectId:this.data.subjectId}}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-start-job-modal"]],decls:11,vars:12,consts:[["data-testid","start-job-modal"],[1,"field"],[3,"fields","values"],["data-testid","action-error",1,"error"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","start-job-cancel",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","start-button",3,"click","nzLoading","disabled"],["nz-input","","data-testid","subject-id","type","text",3,"input","value","placeholder"],[3,"valuesChange","fields","values"]],template:function(i,o){i&1&&(_i(0,"div",0),_D(1,et,6,7,"label",1),_D(2,it,1,2,"app-workflow-input-form",2),_D(3,ot,2,1,"p",3),_i(4,"div",4)(5,"button",5),mh("click",function(){return o.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",6),mh("click",function(){return o.start()}),Iw(9),Pw(10,"transloco"),Jc()()()),i&2&&(gI(),MD(o.showSubjectPicker()?1:-1),gI(),MD(o.requiredFields().length>0?2:-1),gI(),MD(o.actionError()?3:-1),gI(2),lh("disabled",o.starting()),gI(),rl(" ",Fw(7,8,"common.cancel")," "),gI(2),lh("nzLoading",o.starting())("disabled",o.starting()),gI(),rl(" ",Fw(10,10,o.starting()?"jobs.start.starting":"jobs.start.button")," "));},dependencies:[$8,pf,bd,sp,fp,ai,z,le,Kt],styles:[".field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 1rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239;margin:0 0 1rem}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.5rem}"]});}}return e})();var At=(()=>{class e{constructor(){this.workflowsApi=C(b),this.jobsApi=C($$1),this.modal=C(jn),this.router=C(J1),this.transloco=C(Ve),this.message=C(He);}start(t){this.workflowsApi.get(t.workflowId).subscribe({next:i=>{if(!Y(i,t)){this.launch(i,t,{});return}this.modal.create({nzTitle:this.transloco.translate("jobs.start.heading"),nzContent:$,nzData:{workflow:i,subjectId:t.subjectId},nzFooter:null});},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("jobs.errors.loadWorkflows")));}});}launch(t,i,o){let n=x(t,i);this.jobsApi.start(s(r$1({workflowId:t.id},n?{subjectId:n}:{}),{inputValues:o})).subscribe({next:k=>{this.router.navigate(["/jobs",k.id]);},error:k=>{this.message.error(this.errorMessage(k,this.transloco.translate("jobs.errors.startFailed")));}});}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{At as A};
|