import{a as $}from"./chunk-I56L7YBT.js";import{a as R}from"./chunk-HRMKDPOR.js";import"./chunk-3CWO2EV5.js";import"./chunk-3NUWESLC.js";import"./chunk-IWMMFNSQ.js";import"./chunk-B27FY76R.js";import"./chunk-25A34CYL.js";import"./chunk-EEWVYRVF.js";import{b as k}from"./chunk-F7TB6D2I.js";import{a as A,d as N}from"./chunk-EMAOG2GJ.js";import"./chunk-CKZXQWC5.js";import{a as B,g as O}from"./chunk-KYG6FTJ2.js";import"./chunk-BE77QZG7.js";import"./chunk-OXZWBTVI.js";import"./chunk-KB62MNQB.js";import{Ab as F,Bb as a,Cb as r,Kc as M,Mb as _,Nb as c,Ob as u,Qa as i,Rb as T,Sb as I,X as m,db as C,fc as E,hc as L,ib as p,ta as l,wb as s,xb as f,yb as S,zb as g}from"./chunk-5ONOZUNN.js";import"./chunk-C6Q5SG76.js";function b(e,t){e&1&&u(0,2,1)}function P(e,t){e&1&&u(0,2,2)}function h(e,t){e&1&&u(0,2,3)}function v(e,t){e&1&&u(0,2,4)}function U(e,t){if(e&1&&(E(0),r(1,"br")),e&2){let n=t.$implicit;L(" ",n," ")}}var D=class e{#t=m(k);#e=m(A);#n=$(this.#e.params);runId=M(()=>this.#n()?.runId);offset=l(0);status=l("starting");messageLog=l([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(n=>[...n,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=C({type:e,selectors:[["app-commandline-result"]],decls:18,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let n;n=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let o;return o=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,o=T(o),[t,n,o,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],["type","button","spk-button","",1,"small",3,"click"],[1,"status"]]},template:function(n,o){n&1&&(r(0,"app-status-bar"),F(1,"section")(2,"div",3)(3,"button",4),_(4,0),r(5,"spk-icon"),c(),a()(),F(6,"h3"),_(7,1),F(8,"button",5),I("click",function(){return o.abort()}),a(),c(),a(),F(9,"div",6),_(10,2),p(11,b,1,0)(12,P,1,0)(13,h,1,0)(14,v,1,0),c(),a(),F(15,"code"),S(16,U,2,1,null,null,f),a()()),n&2&&(i(11),s(o.status()==="starting"?11:-1),i(),s(o.status()==="started"?12:-1),i(),s(o.status()==="finished"?13:-1),i(),s(o.status()==="aborted"?14:-1),i(2),g(o.messageLog()))},dependencies:[R,B,O,N],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background-color:var(--grey-800);color:var(--grey-100);padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{D as default};
