@hpcc-js/comms 3.19.0 → 3.20.1

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.
@@ -1,4 +1,4 @@
1
- var Ni=Object.create;var Nn=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var Li=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Bt=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var ki=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Qi(e))!Gi.call(n,r)&&r!==t&&Nn(n,r,{get:()=>e[r],enumerable:!(s=Bi(e,r))||s.enumerable});return n};var mt=(n,e,t)=>(t=n!=null?Ni(Li(n)):{},ki(e||!n||!n.__esModule?Nn(t,"default",{value:n,enumerable:!0}):t,n));var Kn=Bt((Kt,Jn)=>{(function(n,e){typeof Kt=="object"&&typeof Jn<"u"?e(Kt):typeof define=="function"&&define.amd?define(["exports"],e):e(n.d3=n.d3||{})})(Kt,(function(n){"use strict";function e(u,D){return u<D?-1:u>D?1:u>=D?0:NaN}function t(u){return u.length===1&&(u=s(u)),{left:function(D,y,f,p){for(f==null&&(f=0),p==null&&(p=D.length);f<p;){var S=f+p>>>1;u(D[S],y)<0?f=S+1:p=S}return f},right:function(D,y,f,p){for(f==null&&(f=0),p==null&&(p=D.length);f<p;){var S=f+p>>>1;u(D[S],y)>0?p=S:f=S+1}return f}}}function s(u){return function(D,y){return e(u(D),y)}}var r=t(e),i=r.right,o=r.left;function c(u,D){D==null&&(D=d);for(var y=0,f=u.length-1,p=u[0],S=new Array(f<0?0:f);y<f;)S[y]=D(p,p=u[++y]);return S}function d(u,D){return[u,D]}function C(u,D,y){var f=u.length,p=D.length,S=new Array(f*p),U,G,q,ue;for(y==null&&(y=d),U=q=0;U<f;++U)for(ue=u[U],G=0;G<p;++G,++q)S[q]=y(ue,D[G]);return S}function l(u,D){return D<u?-1:D>u?1:D>=u?0:NaN}function E(u){return u===null?NaN:+u}function A(u,D){var y=u.length,f=0,p=-1,S=0,U,G,q=0;if(D==null)for(;++p<y;)isNaN(U=E(u[p]))||(G=U-S,S+=G/++f,q+=G*(U-S));else for(;++p<y;)isNaN(U=E(D(u[p],p,u)))||(G=U-S,S+=G/++f,q+=G*(U-S));if(f>1)return q/(f-1)}function P(u,D){var y=A(u,D);return y&&Math.sqrt(y)}function N(u,D){var y=u.length,f=-1,p,S,U;if(D==null){for(;++f<y;)if((p=u[f])!=null&&p>=p)for(S=U=p;++f<y;)(p=u[f])!=null&&(S>p&&(S=p),U<p&&(U=p))}else for(;++f<y;)if((p=D(u[f],f,u))!=null&&p>=p)for(S=U=p;++f<y;)(p=D(u[f],f,u))!=null&&(S>p&&(S=p),U<p&&(U=p));return[S,U]}var V=Array.prototype,j=V.slice,X=V.map;function w(u){return function(){return u}}function M(u){return u}function T(u,D,y){u=+u,D=+D,y=(p=arguments.length)<2?(D=u,u=0,1):p<3?1:+y;for(var f=-1,p=Math.max(0,Math.ceil((D-u)/y))|0,S=new Array(p);++f<p;)S[f]=u+f*y;return S}var ne=Math.sqrt(50),_=Math.sqrt(10),m=Math.sqrt(2);function F(u,D,y){var f,p=-1,S,U,G;if(D=+D,u=+u,y=+y,u===D&&y>0)return[u];if((f=D<u)&&(S=u,u=D,D=S),(G=L(u,D,y))===0||!isFinite(G))return[];if(G>0)for(u=Math.ceil(u/G),D=Math.floor(D/G),U=new Array(S=Math.ceil(D-u+1));++p<S;)U[p]=(u+p)*G;else for(u=Math.floor(u*G),D=Math.ceil(D*G),U=new Array(S=Math.ceil(u-D+1));++p<S;)U[p]=(u-p)/G;return f&&U.reverse(),U}function L(u,D,y){var f=(D-u)/Math.max(0,y),p=Math.floor(Math.log(f)/Math.LN10),S=f/Math.pow(10,p);return p>=0?(S>=ne?10:S>=_?5:S>=m?2:1)*Math.pow(10,p):-Math.pow(10,-p)/(S>=ne?10:S>=_?5:S>=m?2:1)}function k(u,D,y){var f=Math.abs(D-u)/Math.max(0,y),p=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),S=f/p;return S>=ne?p*=10:S>=_?p*=5:S>=m&&(p*=2),D<u?-p:p}function Q(u){return Math.ceil(Math.log(u.length)/Math.LN2)+1}function se(){var u=M,D=N,y=Q;function f(p){var S,U=p.length,G,q=new Array(U);for(S=0;S<U;++S)q[S]=u(p[S],S,p);var ue=D(q),Re=ue[0],me=ue[1],Z=y(q,Re,me);Array.isArray(Z)||(Z=k(Re,me,Z),Z=T(Math.ceil(Re/Z)*Z,me,Z));for(var le=Z.length;Z[0]<=Re;)Z.shift(),--le;for(;Z[le-1]>me;)Z.pop(),--le;var re=new Array(le+1),Be;for(S=0;S<=le;++S)Be=re[S]=[],Be.x0=S>0?Z[S-1]:Re,Be.x1=S<le?Z[S]:me;for(S=0;S<U;++S)G=q[S],Re<=G&&G<=me&&re[i(Z,G,0,le)].push(p[S]);return re}return f.value=function(p){return arguments.length?(u=typeof p=="function"?p:w(p),f):u},f.domain=function(p){return arguments.length?(D=typeof p=="function"?p:w([p[0],p[1]]),f):D},f.thresholds=function(p){return arguments.length?(y=typeof p=="function"?p:Array.isArray(p)?w(j.call(p)):w(p),f):y},f}function ie(u,D,y){if(y==null&&(y=E),!!(f=u.length)){if((D=+D)<=0||f<2)return+y(u[0],0,u);if(D>=1)return+y(u[f-1],f-1,u);var f,p=(f-1)*D,S=Math.floor(p),U=+y(u[S],S,u),G=+y(u[S+1],S+1,u);return U+(G-U)*(p-S)}}function de(u,D,y){return u=X.call(u,E).sort(e),Math.ceil((y-D)/(2*(ie(u,.75)-ie(u,.25))*Math.pow(u.length,-1/3)))}function H(u,D,y){return Math.ceil((y-D)/(3.5*P(u)*Math.pow(u.length,-1/3)))}function we(u,D){var y=u.length,f=-1,p,S;if(D==null){for(;++f<y;)if((p=u[f])!=null&&p>=p)for(S=p;++f<y;)(p=u[f])!=null&&p>S&&(S=p)}else for(;++f<y;)if((p=D(u[f],f,u))!=null&&p>=p)for(S=p;++f<y;)(p=D(u[f],f,u))!=null&&p>S&&(S=p);return S}function je(u,D){var y=u.length,f=y,p=-1,S,U=0;if(D==null)for(;++p<y;)isNaN(S=E(u[p]))?--f:U+=S;else for(;++p<y;)isNaN(S=E(D(u[p],p,u)))?--f:U+=S;if(f)return U/f}function J(u,D){var y=u.length,f=-1,p,S=[];if(D==null)for(;++f<y;)isNaN(p=E(u[f]))||S.push(p);else for(;++f<y;)isNaN(p=E(D(u[f],f,u)))||S.push(p);return ie(S.sort(e),.5)}function Fe(u){for(var D=u.length,y,f=-1,p=0,S,U;++f<D;)p+=u[f].length;for(S=new Array(p);--D>=0;)for(U=u[D],y=U.length;--y>=0;)S[--p]=U[y];return S}function Se(u,D){var y=u.length,f=-1,p,S;if(D==null){for(;++f<y;)if((p=u[f])!=null&&p>=p)for(S=p;++f<y;)(p=u[f])!=null&&S>p&&(S=p)}else for(;++f<y;)if((p=D(u[f],f,u))!=null&&p>=p)for(S=p;++f<y;)(p=D(u[f],f,u))!=null&&S>p&&(S=p);return S}function ce(u,D){for(var y=D.length,f=new Array(y);y--;)f[y]=u[D[y]];return f}function We(u,D){if(y=u.length){var y,f=0,p=0,S,U=u[p];for(D==null&&(D=e);++f<y;)(D(S=u[f],U)<0||D(U,U)!==0)&&(U=S,p=f);if(D(U,U)===0)return p}}function Ue(u,D,y){for(var f=(y??u.length)-(D=D==null?0:+D),p,S;f;)S=Math.random()*f--|0,p=u[f+D],u[f+D]=u[S+D],u[S+D]=p;return u}function Ee(u,D){var y=u.length,f=-1,p,S=0;if(D==null)for(;++f<y;)(p=+u[f])&&(S+=p);else for(;++f<y;)(p=+D(u[f],f,u))&&(S+=p);return S}function Pe(u){if(!(S=u.length))return[];for(var D=-1,y=Se(u,De),f=new Array(y);++D<y;)for(var p=-1,S,U=f[D]=new Array(S);++p<S;)U[p]=u[p][D];return f}function De(u){return u.length}function Ne(){return Pe(arguments)}n.bisect=i,n.bisectRight=i,n.bisectLeft=o,n.ascending=e,n.bisector=t,n.cross=C,n.descending=l,n.deviation=P,n.extent=N,n.histogram=se,n.thresholdFreedmanDiaconis=de,n.thresholdScott=H,n.thresholdSturges=Q,n.max=we,n.mean=je,n.median=J,n.merge=Fe,n.min=Se,n.pairs=c,n.permute=ce,n.quantile=ie,n.range=T,n.scan=We,n.shuffle=Ue,n.sum=Ee,n.ticks=F,n.tickIncrement=L,n.tickStep=k,n.transpose=Pe,n.variance=A,n.zip=Ne,Object.defineProperty(n,"__esModule",{value:!0})}))});var nr=Bt((ss,sr)=>{(function(n,e){typeof ss=="object"&&typeof sr<"u"?e(ss):typeof define=="function"&&define.amd?define(["exports"],e):(n=n||self,e(n.d3=n.d3||{}))})(ss,function(n){"use strict";var e=new Date,t=new Date;function s(g,R,ee,Pt){function oe(B){return g(B=arguments.length===0?new Date:new Date(+B)),B}return oe.floor=function(B){return g(B=new Date(+B)),B},oe.ceil=function(B){return g(B=new Date(B-1)),R(B,1),g(B),B},oe.round=function(B){var z=oe(B),Ce=oe.ceil(B);return B-z<Ce-B?z:Ce},oe.offset=function(B,z){return R(B=new Date(+B),z==null?1:Math.floor(z)),B},oe.range=function(B,z,Ce){var dt=[],It;if(B=oe.ceil(B),Ce=Ce==null?1:Math.floor(Ce),!(B<z)||!(Ce>0))return dt;do dt.push(It=new Date(+B)),R(B,Ce),g(B);while(It<B&&B<z);return dt},oe.filter=function(B){return s(function(z){if(z>=z)for(;g(z),!B(z);)z.setTime(z-1)},function(z,Ce){if(z>=z)if(Ce<0)for(;++Ce<=0;)for(;R(z,-1),!B(z););else for(;--Ce>=0;)for(;R(z,1),!B(z););})},ee&&(oe.count=function(B,z){return e.setTime(+B),t.setTime(+z),g(e),g(t),Math.floor(ee(e,t))},oe.every=function(B){return B=Math.floor(B),!isFinite(B)||!(B>0)?null:B>1?oe.filter(Pt?function(z){return Pt(z)%B===0}:function(z){return oe.count(0,z)%B===0}):oe}),oe}var r=s(function(){},function(g,R){g.setTime(+g+R)},function(g,R){return R-g});r.every=function(g){return g=Math.floor(g),!isFinite(g)||!(g>0)?null:g>1?s(function(R){R.setTime(Math.floor(R/g)*g)},function(R,ee){R.setTime(+R+ee*g)},function(R,ee){return(ee-R)/g}):r};var i=r.range,o=1e3,c=6e4,d=36e5,C=864e5,l=6048e5,E=s(function(g){g.setTime(g-g.getMilliseconds())},function(g,R){g.setTime(+g+R*o)},function(g,R){return(R-g)/o},function(g){return g.getUTCSeconds()}),A=E.range,P=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o)},function(g,R){g.setTime(+g+R*c)},function(g,R){return(R-g)/c},function(g){return g.getMinutes()}),N=P.range,V=s(function(g){g.setTime(g-g.getMilliseconds()-g.getSeconds()*o-g.getMinutes()*c)},function(g,R){g.setTime(+g+R*d)},function(g,R){return(R-g)/d},function(g){return g.getHours()}),j=V.range,X=s(function(g){g.setHours(0,0,0,0)},function(g,R){g.setDate(g.getDate()+R)},function(g,R){return(R-g-(R.getTimezoneOffset()-g.getTimezoneOffset())*c)/C},function(g){return g.getDate()-1}),w=X.range;function M(g){return s(function(R){R.setDate(R.getDate()-(R.getDay()+7-g)%7),R.setHours(0,0,0,0)},function(R,ee){R.setDate(R.getDate()+ee*7)},function(R,ee){return(ee-R-(ee.getTimezoneOffset()-R.getTimezoneOffset())*c)/l})}var T=M(0),ne=M(1),_=M(2),m=M(3),F=M(4),L=M(5),k=M(6),Q=T.range,se=ne.range,ie=_.range,de=m.range,H=F.range,we=L.range,je=k.range,J=s(function(g){g.setDate(1),g.setHours(0,0,0,0)},function(g,R){g.setMonth(g.getMonth()+R)},function(g,R){return R.getMonth()-g.getMonth()+(R.getFullYear()-g.getFullYear())*12},function(g){return g.getMonth()}),Fe=J.range,Se=s(function(g){g.setMonth(0,1),g.setHours(0,0,0,0)},function(g,R){g.setFullYear(g.getFullYear()+R)},function(g,R){return R.getFullYear()-g.getFullYear()},function(g){return g.getFullYear()});Se.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(R){R.setFullYear(Math.floor(R.getFullYear()/g)*g),R.setMonth(0,1),R.setHours(0,0,0,0)},function(R,ee){R.setFullYear(R.getFullYear()+ee*g)})};var ce=Se.range,We=s(function(g){g.setUTCSeconds(0,0)},function(g,R){g.setTime(+g+R*c)},function(g,R){return(R-g)/c},function(g){return g.getUTCMinutes()}),Ue=We.range,Ee=s(function(g){g.setUTCMinutes(0,0,0)},function(g,R){g.setTime(+g+R*d)},function(g,R){return(R-g)/d},function(g){return g.getUTCHours()}),Pe=Ee.range,De=s(function(g){g.setUTCHours(0,0,0,0)},function(g,R){g.setUTCDate(g.getUTCDate()+R)},function(g,R){return(R-g)/C},function(g){return g.getUTCDate()-1}),Ne=De.range;function u(g){return s(function(R){R.setUTCDate(R.getUTCDate()-(R.getUTCDay()+7-g)%7),R.setUTCHours(0,0,0,0)},function(R,ee){R.setUTCDate(R.getUTCDate()+ee*7)},function(R,ee){return(ee-R)/l})}var D=u(0),y=u(1),f=u(2),p=u(3),S=u(4),U=u(5),G=u(6),q=D.range,ue=y.range,Re=f.range,me=p.range,Z=S.range,le=U.range,re=G.range,Be=s(function(g){g.setUTCDate(1),g.setUTCHours(0,0,0,0)},function(g,R){g.setUTCMonth(g.getUTCMonth()+R)},function(g,R){return R.getUTCMonth()-g.getUTCMonth()+(R.getUTCFullYear()-g.getUTCFullYear())*12},function(g){return g.getUTCMonth()}),Ls=Be.range,pt=s(function(g){g.setUTCMonth(0,1),g.setUTCHours(0,0,0,0)},function(g,R){g.setUTCFullYear(g.getUTCFullYear()+R)},function(g,R){return R.getUTCFullYear()-g.getUTCFullYear()},function(g){return g.getUTCFullYear()});pt.every=function(g){return!isFinite(g=Math.floor(g))||!(g>0)?null:s(function(R){R.setUTCFullYear(Math.floor(R.getUTCFullYear()/g)*g),R.setUTCMonth(0,1),R.setUTCHours(0,0,0,0)},function(R,ee){R.setUTCFullYear(R.getUTCFullYear()+ee*g)})};var Gs=pt.range;n.timeDay=X,n.timeDays=w,n.timeFriday=L,n.timeFridays=we,n.timeHour=V,n.timeHours=j,n.timeInterval=s,n.timeMillisecond=r,n.timeMilliseconds=i,n.timeMinute=P,n.timeMinutes=N,n.timeMonday=ne,n.timeMondays=se,n.timeMonth=J,n.timeMonths=Fe,n.timeSaturday=k,n.timeSaturdays=je,n.timeSecond=E,n.timeSeconds=A,n.timeSunday=T,n.timeSundays=Q,n.timeThursday=F,n.timeThursdays=H,n.timeTuesday=_,n.timeTuesdays=ie,n.timeWednesday=m,n.timeWednesdays=de,n.timeWeek=T,n.timeWeeks=Q,n.timeYear=Se,n.timeYears=ce,n.utcDay=De,n.utcDays=Ne,n.utcFriday=U,n.utcFridays=le,n.utcHour=Ee,n.utcHours=Pe,n.utcMillisecond=r,n.utcMilliseconds=i,n.utcMinute=We,n.utcMinutes=Ue,n.utcMonday=y,n.utcMondays=ue,n.utcMonth=Be,n.utcMonths=Ls,n.utcSaturday=G,n.utcSaturdays=re,n.utcSecond=E,n.utcSeconds=A,n.utcSunday=D,n.utcSundays=q,n.utcThursday=S,n.utcThursdays=Z,n.utcTuesday=f,n.utcTuesdays=Re,n.utcWednesday=p,n.utcWednesdays=me,n.utcWeek=D,n.utcWeeks=q,n.utcYear=pt,n.utcYears=Gs,Object.defineProperty(n,"__esModule",{value:!0})})});var Os=Bt((ns,rr)=>{(function(n,e){typeof ns=="object"&&typeof rr<"u"?e(ns,nr()):typeof define=="function"&&define.amd?define(["exports","d3-time"],e):(n=n||self,e(n.d3=n.d3||{},n.d3))})(ns,function(n,e){"use strict";function t(a){if(0<=a.y&&a.y<100){var h=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);return h.setFullYear(a.y),h}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function s(a){if(0<=a.y&&a.y<100){var h=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));return h.setUTCFullYear(a.y),h}return new Date(Date.UTC(a.y,a.m,a.d,a.H,a.M,a.S,a.L))}function r(a,h,W){return{y:a,m:h,d:W,H:0,M:0,S:0,L:0}}function i(a){var h=a.dateTime,W=a.date,x=a.time,Qe=a.periods,Oe=a.days,Mt=a.shortDays,Tt=a.months,wt=a.shortMonths,ni=A(Qe),ri=P(Qe),ii=A(Oe),oi=P(Oe),ai=A(Mt),ci=P(Mt),ui=A(Tt),li=P(Tt),gi=A(wt),pi=P(wt),_e={a:yi,A:Wi,b:xi,B:bi,c:null,d:J,e:J,f:Ue,g:U,G:q,H:Fe,I:Se,j:ce,L:We,m:Ee,M:Pe,p:Ui,q:Ei,Q:Fn,s:Pn,S:De,u:Ne,U:u,V:y,w:f,W:p,x:null,X:null,y:S,Y:G,Z:ue,"%":En},Ye={a:Fi,A:Pi,b:Ii,B:Mi,c:null,d:Re,e:Re,f:Be,g:Ce,G:It,H:me,I:Z,j:le,L:re,m:Ls,M:pt,p:Ti,q:wi,Q:Fn,s:Pn,S:Gs,u:g,U:R,V:Pt,w:oe,W:B,x:null,X:null,y:z,Y:dt,Z:Zr,"%":En},di={a:hi,A:fi,b:Si,B:Di,c:Ri,d:F,e:F,f:de,g:T,G:M,H:k,I:k,j:L,L:ie,m,M:Q,p:mi,q:_,Q:we,s:je,S:se,u:V,U:j,V:X,w:N,W:w,x:Ci,X:Ai,y:T,Y:M,Z:ne,"%":H};_e.x=Le(W,_e),_e.X=Le(x,_e),_e.c=Le(h,_e),Ye.x=Le(W,Ye),Ye.X=Le(x,Ye),Ye.c=Le(h,Ye);function Le(I,O){return function(Y){var b=[],Ae=-1,K=0,xe=I.length,be,Xe,wn;for(Y instanceof Date||(Y=new Date(+Y));++Ae<xe;)I.charCodeAt(Ae)===37&&(b.push(I.slice(K,Ae)),(Xe=o[be=I.charAt(++Ae)])!=null?be=I.charAt(++Ae):Xe=be==="e"?" ":"0",(wn=O[be])&&(be=wn(Y,Xe)),b.push(be),K=Ae+1);return b.push(I.slice(K,Ae)),b.join("")}}function Tn(I,O){return function(Y){var b=r(1900,void 0,1),Ae=Nt(b,I,Y+="",0),K,xe;if(Ae!=Y.length)return null;if("Q"in b)return new Date(b.Q);if("s"in b)return new Date(b.s*1e3+("L"in b?b.L:0));if(O&&!("Z"in b)&&(b.Z=0),"p"in b&&(b.H=b.H%12+b.p*12),b.m===void 0&&(b.m="q"in b?b.q:0),"V"in b){if(b.V<1||b.V>53)return null;"w"in b||(b.w=1),"Z"in b?(K=s(r(b.y,0,1)),xe=K.getUTCDay(),K=xe>4||xe===0?e.utcMonday.ceil(K):e.utcMonday(K),K=e.utcDay.offset(K,(b.V-1)*7),b.y=K.getUTCFullYear(),b.m=K.getUTCMonth(),b.d=K.getUTCDate()+(b.w+6)%7):(K=t(r(b.y,0,1)),xe=K.getDay(),K=xe>4||xe===0?e.timeMonday.ceil(K):e.timeMonday(K),K=e.timeDay.offset(K,(b.V-1)*7),b.y=K.getFullYear(),b.m=K.getMonth(),b.d=K.getDate()+(b.w+6)%7)}else("W"in b||"U"in b)&&("w"in b||(b.w="u"in b?b.u%7:"W"in b?1:0),xe="Z"in b?s(r(b.y,0,1)).getUTCDay():t(r(b.y,0,1)).getDay(),b.m=0,b.d="W"in b?(b.w+6)%7+b.W*7-(xe+5)%7:b.w+b.U*7-(xe+6)%7);return"Z"in b?(b.H+=b.Z/100|0,b.M+=b.Z%100,s(b)):t(b)}}function Nt(I,O,Y,b){for(var Ae=0,K=O.length,xe=Y.length,be,Xe;Ae<K;){if(b>=xe)return-1;if(be=O.charCodeAt(Ae++),be===37){if(be=O.charAt(Ae++),Xe=di[be in o?O.charAt(Ae++):be],!Xe||(b=Xe(I,Y,b))<0)return-1}else if(be!=Y.charCodeAt(b++))return-1}return b}function mi(I,O,Y){var b=ni.exec(O.slice(Y));return b?(I.p=ri[b[0].toLowerCase()],Y+b[0].length):-1}function hi(I,O,Y){var b=ai.exec(O.slice(Y));return b?(I.w=ci[b[0].toLowerCase()],Y+b[0].length):-1}function fi(I,O,Y){var b=ii.exec(O.slice(Y));return b?(I.w=oi[b[0].toLowerCase()],Y+b[0].length):-1}function Si(I,O,Y){var b=gi.exec(O.slice(Y));return b?(I.m=pi[b[0].toLowerCase()],Y+b[0].length):-1}function Di(I,O,Y){var b=ui.exec(O.slice(Y));return b?(I.m=li[b[0].toLowerCase()],Y+b[0].length):-1}function Ri(I,O,Y){return Nt(I,h,O,Y)}function Ci(I,O,Y){return Nt(I,W,O,Y)}function Ai(I,O,Y){return Nt(I,x,O,Y)}function yi(I){return Mt[I.getDay()]}function Wi(I){return Oe[I.getDay()]}function xi(I){return wt[I.getMonth()]}function bi(I){return Tt[I.getMonth()]}function Ui(I){return Qe[+(I.getHours()>=12)]}function Ei(I){return 1+~~(I.getMonth()/3)}function Fi(I){return Mt[I.getUTCDay()]}function Pi(I){return Oe[I.getUTCDay()]}function Ii(I){return wt[I.getUTCMonth()]}function Mi(I){return Tt[I.getUTCMonth()]}function Ti(I){return Qe[+(I.getUTCHours()>=12)]}function wi(I){return 1+~~(I.getUTCMonth()/3)}return{format:function(I){var O=Le(I+="",_e);return O.toString=function(){return I},O},parse:function(I){var O=Tn(I+="",!1);return O.toString=function(){return I},O},utcFormat:function(I){var O=Le(I+="",Ye);return O.toString=function(){return I},O},utcParse:function(I){var O=Tn(I+="",!0);return O.toString=function(){return I},O}}}var o={"-":"",_:" ",0:"0"},c=/^\s*\d+/,d=/^%/,C=/[\\^$*+?|[\]().{}]/g;function l(a,h,W){var x=a<0?"-":"",Qe=(x?-a:a)+"",Oe=Qe.length;return x+(Oe<W?new Array(W-Oe+1).join(h)+Qe:Qe)}function E(a){return a.replace(C,"\\$&")}function A(a){return new RegExp("^(?:"+a.map(E).join("|")+")","i")}function P(a){for(var h={},W=-1,x=a.length;++W<x;)h[a[W].toLowerCase()]=W;return h}function N(a,h,W){var x=c.exec(h.slice(W,W+1));return x?(a.w=+x[0],W+x[0].length):-1}function V(a,h,W){var x=c.exec(h.slice(W,W+1));return x?(a.u=+x[0],W+x[0].length):-1}function j(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.U=+x[0],W+x[0].length):-1}function X(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.V=+x[0],W+x[0].length):-1}function w(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.W=+x[0],W+x[0].length):-1}function M(a,h,W){var x=c.exec(h.slice(W,W+4));return x?(a.y=+x[0],W+x[0].length):-1}function T(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.y=+x[0]+(+x[0]>68?1900:2e3),W+x[0].length):-1}function ne(a,h,W){var x=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(h.slice(W,W+6));return x?(a.Z=x[1]?0:-(x[2]+(x[3]||"00")),W+x[0].length):-1}function _(a,h,W){var x=c.exec(h.slice(W,W+1));return x?(a.q=x[0]*3-3,W+x[0].length):-1}function m(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.m=x[0]-1,W+x[0].length):-1}function F(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.d=+x[0],W+x[0].length):-1}function L(a,h,W){var x=c.exec(h.slice(W,W+3));return x?(a.m=0,a.d=+x[0],W+x[0].length):-1}function k(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.H=+x[0],W+x[0].length):-1}function Q(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.M=+x[0],W+x[0].length):-1}function se(a,h,W){var x=c.exec(h.slice(W,W+2));return x?(a.S=+x[0],W+x[0].length):-1}function ie(a,h,W){var x=c.exec(h.slice(W,W+3));return x?(a.L=+x[0],W+x[0].length):-1}function de(a,h,W){var x=c.exec(h.slice(W,W+6));return x?(a.L=Math.floor(x[0]/1e3),W+x[0].length):-1}function H(a,h,W){var x=d.exec(h.slice(W,W+1));return x?W+x[0].length:-1}function we(a,h,W){var x=c.exec(h.slice(W));return x?(a.Q=+x[0],W+x[0].length):-1}function je(a,h,W){var x=c.exec(h.slice(W));return x?(a.s=+x[0],W+x[0].length):-1}function J(a,h){return l(a.getDate(),h,2)}function Fe(a,h){return l(a.getHours(),h,2)}function Se(a,h){return l(a.getHours()%12||12,h,2)}function ce(a,h){return l(1+e.timeDay.count(e.timeYear(a),a),h,3)}function We(a,h){return l(a.getMilliseconds(),h,3)}function Ue(a,h){return We(a,h)+"000"}function Ee(a,h){return l(a.getMonth()+1,h,2)}function Pe(a,h){return l(a.getMinutes(),h,2)}function De(a,h){return l(a.getSeconds(),h,2)}function Ne(a){var h=a.getDay();return h===0?7:h}function u(a,h){return l(e.timeSunday.count(e.timeYear(a)-1,a),h,2)}function D(a){var h=a.getDay();return h>=4||h===0?e.timeThursday(a):e.timeThursday.ceil(a)}function y(a,h){return a=D(a),l(e.timeThursday.count(e.timeYear(a),a)+(e.timeYear(a).getDay()===4),h,2)}function f(a){return a.getDay()}function p(a,h){return l(e.timeMonday.count(e.timeYear(a)-1,a),h,2)}function S(a,h){return l(a.getFullYear()%100,h,2)}function U(a,h){return a=D(a),l(a.getFullYear()%100,h,2)}function G(a,h){return l(a.getFullYear()%1e4,h,4)}function q(a,h){var W=a.getDay();return a=W>=4||W===0?e.timeThursday(a):e.timeThursday.ceil(a),l(a.getFullYear()%1e4,h,4)}function ue(a){var h=a.getTimezoneOffset();return(h>0?"-":(h*=-1,"+"))+l(h/60|0,"0",2)+l(h%60,"0",2)}function Re(a,h){return l(a.getUTCDate(),h,2)}function me(a,h){return l(a.getUTCHours(),h,2)}function Z(a,h){return l(a.getUTCHours()%12||12,h,2)}function le(a,h){return l(1+e.utcDay.count(e.utcYear(a),a),h,3)}function re(a,h){return l(a.getUTCMilliseconds(),h,3)}function Be(a,h){return re(a,h)+"000"}function Ls(a,h){return l(a.getUTCMonth()+1,h,2)}function pt(a,h){return l(a.getUTCMinutes(),h,2)}function Gs(a,h){return l(a.getUTCSeconds(),h,2)}function g(a){var h=a.getUTCDay();return h===0?7:h}function R(a,h){return l(e.utcSunday.count(e.utcYear(a)-1,a),h,2)}function ee(a){var h=a.getUTCDay();return h>=4||h===0?e.utcThursday(a):e.utcThursday.ceil(a)}function Pt(a,h){return a=ee(a),l(e.utcThursday.count(e.utcYear(a),a)+(e.utcYear(a).getUTCDay()===4),h,2)}function oe(a){return a.getUTCDay()}function B(a,h){return l(e.utcMonday.count(e.utcYear(a)-1,a),h,2)}function z(a,h){return l(a.getUTCFullYear()%100,h,2)}function Ce(a,h){return a=ee(a),l(a.getUTCFullYear()%100,h,2)}function dt(a,h){return l(a.getUTCFullYear()%1e4,h,4)}function It(a,h){var W=a.getUTCDay();return a=W>=4||W===0?e.utcThursday(a):e.utcThursday.ceil(a),l(a.getUTCFullYear()%1e4,h,4)}function Zr(){return"+0000"}function En(){return"%"}function Fn(a){return+a}function Pn(a){return Math.floor(+a/1e3)}var rt;In({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function In(a){return rt=i(a),n.timeFormat=rt.format,n.timeParse=rt.parse,n.utcFormat=rt.utcFormat,n.utcParse=rt.utcParse,rt}var Mn="%Y-%m-%dT%H:%M:%S.%LZ";function $r(a){return a.toISOString()}var ei=Date.prototype.toISOString?$r:n.utcFormat(Mn);function ti(a){var h=new Date(a);return isNaN(h)?null:h}var si=+new Date("2000-01-01T00:00:00.000Z")?ti:n.utcParse(Mn);n.isoFormat=ei,n.isoParse=si,n.timeFormatDefaultLocale=In,n.timeFormatLocale=i,Object.defineProperty(n,"__esModule",{value:!0})})});var Ys=Bt((cs,lr)=>{(function(n,e){typeof cs=="object"&&typeof lr<"u"?e(cs):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.d3=n.d3||{}))})(cs,(function(n){"use strict";function e(m){return Math.abs(m=Math.round(m))>=1e21?m.toLocaleString("en").replace(/,/g,""):m.toString(10)}function t(m,F){if((L=(m=F?m.toExponential(F-1):m.toExponential()).indexOf("e"))<0)return null;var L,k=m.slice(0,L);return[k.length>1?k[0]+k.slice(2):k,+m.slice(L+1)]}function s(m){return m=t(Math.abs(m)),m?m[1]:NaN}function r(m,F){return function(L,k){for(var Q=L.length,se=[],ie=0,de=m[0],H=0;Q>0&&de>0&&(H+de+1>k&&(de=Math.max(1,k-H)),se.push(L.substring(Q-=de,Q+de)),!((H+=de+1)>k));)de=m[ie=(ie+1)%m.length];return se.reverse().join(F)}}function i(m){return function(F){return F.replace(/[0-9]/g,function(L){return m[+L]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function c(m){if(!(F=o.exec(m)))throw new Error("invalid format: "+m);var F;return new d({fill:F[1],align:F[2],sign:F[3],symbol:F[4],zero:F[5],width:F[6],comma:F[7],precision:F[8]&&F[8].slice(1),trim:F[9],type:F[10]})}c.prototype=d.prototype;function d(m){this.fill=m.fill===void 0?" ":m.fill+"",this.align=m.align===void 0?">":m.align+"",this.sign=m.sign===void 0?"-":m.sign+"",this.symbol=m.symbol===void 0?"":m.symbol+"",this.zero=!!m.zero,this.width=m.width===void 0?void 0:+m.width,this.comma=!!m.comma,this.precision=m.precision===void 0?void 0:+m.precision,this.trim=!!m.trim,this.type=m.type===void 0?"":m.type+""}d.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function C(m){e:for(var F=m.length,L=1,k=-1,Q;L<F;++L)switch(m[L]){case".":k=Q=L;break;case"0":k===0&&(k=L),Q=L;break;default:if(!+m[L])break e;k>0&&(k=0);break}return k>0?m.slice(0,k)+m.slice(Q+1):m}var l;function E(m,F){var L=t(m,F);if(!L)return m+"";var k=L[0],Q=L[1],se=Q-(l=Math.max(-8,Math.min(8,Math.floor(Q/3)))*3)+1,ie=k.length;return se===ie?k:se>ie?k+new Array(se-ie+1).join("0"):se>0?k.slice(0,se)+"."+k.slice(se):"0."+new Array(1-se).join("0")+t(m,Math.max(0,F+se-1))[0]}function A(m,F){var L=t(m,F);if(!L)return m+"";var k=L[0],Q=L[1];return Q<0?"0."+new Array(-Q).join("0")+k:k.length>Q+1?k.slice(0,Q+1)+"."+k.slice(Q+1):k+new Array(Q-k.length+2).join("0")}var P={"%":function(m,F){return(m*100).toFixed(F)},b:function(m){return Math.round(m).toString(2)},c:function(m){return m+""},d:e,e:function(m,F){return m.toExponential(F)},f:function(m,F){return m.toFixed(F)},g:function(m,F){return m.toPrecision(F)},o:function(m){return Math.round(m).toString(8)},p:function(m,F){return A(m*100,F)},r:A,s:E,X:function(m){return Math.round(m).toString(16).toUpperCase()},x:function(m){return Math.round(m).toString(16)}};function N(m){return m}var V=Array.prototype.map,j=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function X(m){var F=m.grouping===void 0||m.thousands===void 0?N:r(V.call(m.grouping,Number),m.thousands+""),L=m.currency===void 0?"":m.currency[0]+"",k=m.currency===void 0?"":m.currency[1]+"",Q=m.decimal===void 0?".":m.decimal+"",se=m.numerals===void 0?N:i(V.call(m.numerals,String)),ie=m.percent===void 0?"%":m.percent+"",de=m.minus===void 0?"-":m.minus+"",H=m.nan===void 0?"NaN":m.nan+"";function we(J){J=c(J);var Fe=J.fill,Se=J.align,ce=J.sign,We=J.symbol,Ue=J.zero,Ee=J.width,Pe=J.comma,De=J.precision,Ne=J.trim,u=J.type;u==="n"?(Pe=!0,u="g"):P[u]||(De===void 0&&(De=12),Ne=!0,u="g"),(Ue||Fe==="0"&&Se==="=")&&(Ue=!0,Fe="0",Se="=");var D=We==="$"?L:We==="#"&&/[boxX]/.test(u)?"0"+u.toLowerCase():"",y=We==="$"?k:/[%p]/.test(u)?ie:"",f=P[u],p=/[defgprs%]/.test(u);De=De===void 0?6:/[gprs]/.test(u)?Math.max(1,Math.min(21,De)):Math.max(0,Math.min(20,De));function S(U){var G=D,q=y,ue,Re,me;if(u==="c")q=f(U)+q,U="";else{U=+U;var Z=U<0||1/U<0;if(U=isNaN(U)?H:f(Math.abs(U),De),Ne&&(U=C(U)),Z&&+U==0&&ce!=="+"&&(Z=!1),G=(Z?ce==="("?ce:de:ce==="-"||ce==="("?"":ce)+G,q=(u==="s"?j[8+l/3]:"")+q+(Z&&ce==="("?")":""),p){for(ue=-1,Re=U.length;++ue<Re;)if(me=U.charCodeAt(ue),48>me||me>57){q=(me===46?Q+U.slice(ue+1):U.slice(ue))+q,U=U.slice(0,ue);break}}}Pe&&!Ue&&(U=F(U,1/0));var le=G.length+U.length+q.length,re=le<Ee?new Array(Ee-le+1).join(Fe):"";switch(Pe&&Ue&&(U=F(re+U,re.length?Ee-q.length:1/0),re=""),Se){case"<":U=G+U+q+re;break;case"=":U=G+re+U+q;break;case"^":U=re.slice(0,le=re.length>>1)+G+U+q+re.slice(le);break;default:U=re+G+U+q;break}return se(U)}return S.toString=function(){return J+""},S}function je(J,Fe){var Se=we((J=c(J),J.type="f",J)),ce=Math.max(-8,Math.min(8,Math.floor(s(Fe)/3)))*3,We=Math.pow(10,-ce),Ue=j[8+ce/3];return function(Ee){return Se(We*Ee)+Ue}}return{format:we,formatPrefix:je}}var w;M({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function M(m){return w=X(m),n.format=w.format,n.formatPrefix=w.formatPrefix,w}function T(m){return Math.max(0,-s(Math.abs(m)))}function ne(m,F){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(s(F)/3)))*3-s(Math.abs(m)))}function _(m,F){return m=Math.abs(m),F=Math.abs(F)-m,Math.max(0,s(F)-s(m))+1}n.FormatSpecifier=d,n.formatDefaultLocale=M,n.formatLocale=X,n.formatSpecifier=c,n.precisionFixed=T,n.precisionPrefix=ne,n.precisionRound=_,Object.defineProperty(n,"__esModule",{value:!0})}))});import{root as Ft}from"@hpcc-js/util";import{DOMParser as Qa}from"@xmldom/xmldom";import*as ye from"node:https";import{Buffer as Kr}from"node:buffer";import{fetch as La,Agent as Ga}from"undici";var Bn=`
1
+ import{root as at}from"@hpcc-js/util";import{DOMParser as Ac}from"@xmldom/xmldom";import*as _ from"node:https";import{Buffer as Zn}from"node:buffer";import{fetch as Wc,Agent as yc}from"undici";var cr=`
2
2
  Trustwave Secure Global Extended Validation CA, Level 1
3
3
  SecureTrust Corporation
4
4
  00F6F61CE4A3635BB0CA8AACEEFCB2D0F0
@@ -907,20 +907,20 @@ AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsC
907
907
  MGclCrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVu
908
908
  Sw==
909
909
  -----END CERTIFICATE-----
910
- `;var Va="__PACKAGE_NAME__",Ha="__PACKAGE_VERSION__",ja="__BUILD_VERSION__";import{join as ft}from"@hpcc-js/util";import{join as ks,promiseTimeout as vi,root as ht,scopedLogger as Vi,utf8ToBase64 as Hi}from"@hpcc-js/util";var Qn=Vi("comms/connection.ts");function Ya(n){return"baseUrl"in n}var ji={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function Xa(n){return typeof n.opts=="function"&&typeof n.send=="function"&&typeof n.clone=="function"}function Ie(n,e){return e===void 0||e===!0?encodeURIComponent(n):""+n}function qe(n,e=!0,t=""){if(t&&(t+="."),typeof n!="object")return Ie(n,e);let s=[];for(let r in n)if(n.hasOwnProperty(r))if(n[r]instanceof Array){let i=!1;n[r].forEach((o,c)=>{typeof o=="object"?(i=!0,s.push(qe(o,e,t+Ie(`${r}.${c}`,e)))):s.push(t+Ie(`${r}_i${c}`,e)+"="+qe(o,e))}),i&&s.push(t+Ie(`${r}.itemcount`,e)+"="+n[r].length)}else typeof n[r]=="object"?n[r]&&n[r].Item instanceof Array?(s.push(qe(n[r].Item,e,t+Ie(r,e))),s.push(t+Ie(`${r}.itemcount`,e)+"="+n[r].Item.length)):s.push(qe(n[r],e,t+Ie(r,e))):n[r]!==void 0?s.push(t+Ie(r,e)+"="+Ie(n[r],e)):s.push(t+Ie(r,e));return s.join("&")}function Oi(n){return JSON.parse(n)}function _i(n,e,t={},s="json",r){return r&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let c=n.timeoutSecs*1e3,d=5e3,C="jsonp_callback_"+Math.round(Math.random()*999999);window[C]=function(N){c=0,P(),i(s==="json"&&typeof N=="string"?Oi(N):N)};let l=document.createElement("script"),E=ks(n.baseUrl,e);E+=E.indexOf("?")>=0?"&":"?",l.src=E+"jsonp="+C+"&"+qe(t,n.encodeRequest),document.body.appendChild(l);let A=setInterval(function(){c<=0?clearInterval(A):(c-=d,c<=0?(clearInterval(A),Qn.error("Request timeout: "+l.src),P(),o(Error("Request timeout: "+l.src))):Qn.debug("Request pending ("+c/1e3+" sec): "+l.src))},d);function P(){delete window[C],document.body.removeChild(l)}})}function Yi(n){return n.userID?{Authorization:`Basic ${Hi(`${n.userID}:${n.password}`)}`}:{}}var Qt={};function Ln(n,e,t,s,r){s={...Yi(n),...s},t={credentials:Qt[n.baseUrl]?"omit":"include",...t,headers:s},n.baseUrl.indexOf("https:")===0&&(n.rejectUnauthorized===!1&&ht.__hpcc_rejectUnauthorizedAgent?t.dispatcher=ht.__hpcc_rejectUnauthorizedAgent:ht.__hpcc_trustwaveAgent&&(t.agent=ht.__hpcc_trustwaveAgent));function i(c){if(c.ok)switch(r){case"json":return c.json();case"arraybuffer":return c.arrayBuffer();default:return c.text()}throw new Error(c.statusText)}let o=ht.__hpcc_undiciFetch??fetch;return vi(n.timeoutSecs*1e3,o(ks(n.baseUrl,e),t).then(i).catch(c=>(t.credentials=Qt[n.baseUrl]?"include":"omit",o(ks(n.baseUrl,e),t).then(i).then(d=>(Qt[n.baseUrl]=!Qt[n.baseUrl],d)))))}function Xi(n,e,t,s="json",r){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Ln(n,e,{method:"post",body:qe(t,n.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function qi(n,e,t,s="json",r){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),Ln(n,`${e}?${qe(t,n.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function zi(n,e,t,s="json",r){let i;switch(n.type){case"jsonp":i=_i(n,e,t,s,r);break;case"get":i=qi(n,e,t,s,r);break;default:i=Xi(n,e,t,s,r);break}return i}var Lt=zi;function qa(n){let e=Lt;return n&&(Lt=n),e}var vs=class n{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...ji,...e},this)}send(e,t,s="json",r){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,Lt,r):Lt(this._opts,e,t,s,r)}clone(){return new n(this.opts())}},Gt=function(n){return new vs(n)};function za(n){let e=Gt;return Gt=n,e}function Ji(n){return Object.prototype.toString.call(n)==="[object Array]"}var ze=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};function sc(n){return n instanceof ze||n.isESPExceptions&&Array.isArray(n.Exception)}function Ki(n){return n.send!==void 0}var Vs=class n{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=Ki(e)?e:Gt(e),this._service=t,this._version=s}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,t){if(Ji(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},s="json",r=!1,i,o){let c={...t,ver_:this._version};r&&(c.upload_=!0),i&&(c.abortSignal_=i);let d,C="json";switch(s){case"text":d=ft(this._service,e),C="text";break;case"arraybuffer":d=ft(this._service,e+".json"),C="arraybuffer";break;case"xsd":d=ft(this._service,e+".xsd"),C="text";break;case"json2":d=ft(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:d=ft(this._service,e+".json")}return this._connection.send(d,c,C).then(l=>{if(s==="json"){let E;if(l&&l.Exceptions)throw new ze(e,c,l.Exceptions);if(l&&(E=l[o||e+"Response"]),!E)throw new ze(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return E}return l})}clone(){return new n(this._connection.clone(),this._service,this._version)}},v=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new Vs(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var St;(t=>{let n;(C=>(C.Delete="Delete",C.Protect="Protect",C.Unprotect="Unprotect",C.Restore="Restore",C.SetToFailed="SetToFailed",C.Archive="Archive"))(n=t.DFUWUActions||={});let e;(N=>(N.copy="copy",N.remove="remove",N.move="move",N.rename="rename",N.replicate="replicate",N.import="import",N.export="export",N.monitor="monitor",N.copymerge="copymerge",N.supercopy="supercopy",N.publish="publish"))(e=t.DFUCommand||={})})(St||={});var kt=class extends v{constructor(e){super(e,"FileSpray","1.29")}AbortDFUWorkunit(e,t){return this._connection.send("AbortDFUWorkunit",e,"json",!1,t,"AbortDFUWorkunitResponse")}Copy(e,t){return this._connection.send("Copy",e,"json",!1,t,"CopyResponse")}CreateDFUPublisherWorkunit(e,t){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,t,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e,t){return this._connection.send("CreateDFUWorkunit",e,"json",!1,t,"CreateDFUWorkunitResponse")}DFUWUFile(e,t){return this._connection.send("DFUWUFile",e,"json",!1,t,"DFUWUFileResponse")}DFUWUSearch(e,t){return this._connection.send("DFUWUSearch",e,"json",!1,t,"DFUWUSearchResponse")}DFUWorkunitsAction(e,t){return this._connection.send("DFUWorkunitsAction",e,"json",!1,t,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e,t){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,t,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e,t){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,t,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e,t){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,t,"DFUWorkunitsActionResponse")}Despray(e,t){return this._connection.send("Despray",e,"json",!1,t,"DesprayResponse")}DfuMonitor(e,t){return this._connection.send("DfuMonitor",e,"json",!1,t,"DfuMonitorResponse")}DropZoneFileSearch(e,t){return this._connection.send("DropZoneFileSearch",e,"json",!1,t,"DropZoneFileSearchResponse")}DropZoneFiles(e,t){return this._connection.send("DropZoneFiles",e,"json",!1,t,"DropZoneFilesResponse")}EchoDateTime(e,t){return this._connection.send("EchoDateTime",e,"json",!1,t,"EchoDateTimeResponse")}FileList(e,t){return this._connection.send("FileList",e,"json",!1,t,"FileListResponse")}GetDFUExceptions(e,t){return this._connection.send("GetDFUExceptions",e,"json",!1,t,"GetDFUExceptionsResponse")}GetDFUProgress(e,t){return this._connection.send("GetDFUProgress",e,"json",!1,t,"ProgressResponse")}GetDFUServerQueues(e,t){return this._connection.send("GetDFUServerQueues",e,"json",!1,t,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e,t){return this._connection.send("GetDFUWorkunit",e,"json",!1,t,"GetDFUWorkunitResponse")}GetDFUWorkunits(e,t){return this._connection.send("GetDFUWorkunits",e,"json",!1,t,"GetDFUWorkunitsResponse")}GetRemoteTargets(e,t){return this._connection.send("GetRemoteTargets",e,"json",!1,t,"GetRemoteTargetsResponse")}GetSprayTargets(e,t){return this._connection.send("GetSprayTargets",e,"json",!1,t,"GetSprayTargetsResponse")}OpenSave(e,t){return this._connection.send("OpenSave",e,"json",!1,t,"OpenSaveResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"FileSprayPingResponse")}Rename(e,t){return this._connection.send("Rename",e,"json",!1,t,"RenameResponse")}Replicate(e,t){return this._connection.send("Replicate",e,"json",!1,t,"ReplicateResponse")}ShowResult(e,t){return this._connection.send("ShowResult",e,"json",!1,t,"ShowResultResponse")}SprayFixed(e,t){return this._connection.send("SprayFixed",e,"json",!1,t,"SprayFixedResponse")}SprayVariable(e,t){return this._connection.send("SprayVariable",e,"json",!1,t,"SprayResponse")}SubmitDFUWorkunit(e,t){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,t,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e,t){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,t,"UpdateDFUWorkunitResponse")}};var Zi=(l=>(l[l.unknown=0]="unknown",l[l.scheduled=1]="scheduled",l[l.queued=2]="queued",l[l.started=3]="started",l[l.aborted=4]="aborted",l[l.failed=5]="failed",l[l.finished=6]="finished",l[l.monitoring=7]="monitoring",l[l.aborting=8]="aborting",l[l.notfound=999]="notfound",l))(Zi||{}),Je=class extends kt{DFUWUFileEx(e){return this._connection.send("DFUWUFile",e,"text")}SprayFixedEx(e){return this._connection.send("SprayFixed",e)}SprayVariableEx(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")}DesprayEx(e){return this._connection.send("Despray",e)}UpdateDFUWorkunitEx(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};var Gn;(o=>{let n;(C=>(C.User="User",C.Group="Group"))(n=o.ViewMemberType||={});let e;(A=>(A.username="username",A.fullname="fullname",A.passwordexpiration="passwordexpiration",A.employeeID="employeeID",A.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(C=>(C.Name="Name",C.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(l=>(l.Any="Any",l.User="User",l.Group="Group"))(s=o.AccountTypeReq||={});let r;(C=>(C.Name="Name",C.Type="Type"))(r=o.ResourcePermissionSortBy||={});let i;(d=>d.Name="Name")(i=o.ResourceSortBy||={})})(Gn||={});var vt=class extends v{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e,t){return this._connection.send("AccountPermissions",e,"json",!1,t,"AccountPermissionsResponse")}AccountPermissionsV2(e,t){return this._connection.send("AccountPermissionsV2",e,"json",!1,t,"AccountPermissionsV2Response")}AddUser(e,t){return this._connection.send("AddUser",e,"json",!1,t,"AddUserResponse")}AddView(e,t){return this._connection.send("AddView",e,"json",!1,t,"AddViewResponse")}AddViewColumn(e,t){return this._connection.send("AddViewColumn",e,"json",!1,t,"AddViewColumnResponse")}AddViewMember(e,t){return this._connection.send("AddViewMember",e,"json",!1,t,"AddViewMemberResponse")}ClearPermissionsCache(e,t){return this._connection.send("ClearPermissionsCache",e,"json",!1,t,"ClearPermissionsCacheResponse")}DeleteView(e,t){return this._connection.send("DeleteView",e,"json",!1,t,"DeleteViewResponse")}DeleteViewColumn(e,t){return this._connection.send("DeleteViewColumn",e,"json",!1,t,"DeleteViewColumnResponse")}DeleteViewMember(e,t){return this._connection.send("DeleteViewMember",e,"json",!1,t,"DeleteViewMemberResponse")}DisableScopeScans(e,t){return this._connection.send("DisableScopeScans",e,"json",!1,t,"DisableScopeScansResponse")}EnableScopeScans(e,t){return this._connection.send("EnableScopeScans",e,"json",!1,t,"EnableScopeScansResponse")}FilePermission(e,t){return this._connection.send("FilePermission",e,"json",!1,t,"FilePermissionResponse")}GroupAction(e,t){return this._connection.send("GroupAction",e,"json",!1,t,"GroupActionResponse")}GroupAdd(e,t){return this._connection.send("GroupAdd",e,"json",!1,t,"GroupAddResponse")}GroupEdit(e,t){return this._connection.send("GroupEdit",e,"json",!1,t,"GroupEditResponse")}GroupMemberEdit(e,t){return this._connection.send("GroupMemberEdit",e,"json",!1,t,"GroupMemberEditResponse")}GroupMemberEditInput(e,t){return this._connection.send("GroupMemberEditInput",e,"json",!1,t,"GroupMemberEditInputResponse")}GroupMemberQuery(e,t){return this._connection.send("GroupMemberQuery",e,"json",!1,t,"GroupMemberQueryResponse")}GroupQuery(e,t){return this._connection.send("GroupQuery",e,"json",!1,t,"GroupQueryResponse")}Groups(e,t){return this._connection.send("Groups",e,"json",!1,t,"GroupResponse")}PermissionAction(e,t){return this._connection.send("PermissionAction",e,"json",!1,t,"PermissionActionResponse")}Permissions(e,t){return this._connection.send("Permissions",e,"json",!1,t,"BasednsResponse")}PermissionsReset(e,t){return this._connection.send("PermissionsReset",e,"json",!1,t,"PermissionsResetResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accessPingResponse")}QueryScopeScansEnabled(e,t){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,t,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e,t){return this._connection.send("QueryUserViewColumns",e,"json",!1,t,"QueryUserViewColumnsResponse")}QueryViewColumns(e,t){return this._connection.send("QueryViewColumns",e,"json",!1,t,"QueryViewColumnsResponse")}QueryViewMembers(e,t){return this._connection.send("QueryViewMembers",e,"json",!1,t,"QueryViewMembersResponse")}QueryViews(e,t){return this._connection.send("QueryViews",e,"json",!1,t,"QueryViewsResponse")}ResourceAdd(e,t){return this._connection.send("ResourceAdd",e,"json",!1,t,"ResourceAddResponse")}ResourceDelete(e,t){return this._connection.send("ResourceDelete",e,"json",!1,t,"ResourceDeleteResponse")}ResourcePermissionQuery(e,t){return this._connection.send("ResourcePermissionQuery",e,"json",!1,t,"ResourcePermissionQueryResponse")}ResourcePermissions(e,t){return this._connection.send("ResourcePermissions",e,"json",!1,t,"ResourcePermissionsResponse")}ResourceQuery(e,t){return this._connection.send("ResourceQuery",e,"json",!1,t,"ResourceQueryResponse")}Resources(e,t){return this._connection.send("Resources",e,"json",!1,t,"ResourcesResponse")}UserAccountExport(e,t){return this._connection.send("UserAccountExport",e,"json",!1,t,"UserAccountExportResponse")}UserAction(e,t){return this._connection.send("UserAction",e,"json",!1,t,"UserActionResponse")}UserEdit(e,t){return this._connection.send("UserEdit",e,"json",!1,t,"UserEditResponse")}UserGroupEdit(e,t){return this._connection.send("UserGroupEdit",e,"json",!1,t,"UserGroupEditResponse")}UserGroupEditInput(e,t){return this._connection.send("UserGroupEditInput",e,"json",!1,t,"UserGroupEditInputResponse")}UserInfoEdit(e,t){return this._connection.send("UserInfoEdit",e,"json",!1,t,"UserInfoEditResponse")}UserInfoEditInput(e,t){return this._connection.send("UserInfoEditInput",e,"json",!1,t,"UserInfoEditInputResponse")}UserPosix(e,t){return this._connection.send("UserPosix",e,"json",!1,t,"UserPosixResponse")}UserPosixInput(e,t){return this._connection.send("UserPosixInput",e,"json",!1,t,"UserPosixInputResponse")}UserQuery(e,t){return this._connection.send("UserQuery",e,"json",!1,t,"UserQueryResponse")}UserResetPass(e,t){return this._connection.send("UserResetPass",e,"json",!1,t,"UserResetPassResponse")}UserResetPassInput(e,t){return this._connection.send("UserResetPassInput",e,"json",!1,t,"UserResetPassInputResponse")}UserSudoers(e,t){return this._connection.send("UserSudoers",e,"json",!1,t,"UserSudoersResponse")}UserSudoersInput(e,t){return this._connection.send("UserSudoersInput",e,"json",!1,t,"UserSudoersInputResponse")}Users(e,t){return this._connection.send("Users",e,"json",!1,t,"UserResponse")}};var kn=class extends vt{};var Vt=class extends v{constructor(e){super(e,"ws_account","1.07")}MyAccount(e,t){return this._connection.send("MyAccount",e,"json",!1,t,"MyAccountResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accountPingResponse")}UpdateUser(e,t){return this._connection.send("UpdateUser",e,"json",!1,t,"UpdateUserResponse")}UpdateUserInput(e,t){return this._connection.send("UpdateUserInput",e,"json",!1,t,"UpdateUserInputResponse")}VerifyUser(e,t){return this._connection.send("VerifyUser",e,"json",!1,t,"VerifyUserResponse")}};var vn=class extends Vt{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};import{scopedLogger as $i}from"@hpcc-js/util";var Ht=class extends v{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e,t){return this._connection.send("GetPODs",e,"json",!1,t,"GetPODsResponse")}GetServices(e,t){return this._connection.send("GetServices",e,"json",!1,t,"GetServicesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsCloudPingResponse")}};var eo=$i("@hpcc-js/comms/services/wsCloud.ts");function to(n){return n?.Pods!==void 0}function so(n){return n.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(s=>{e.push({ContainerPort:s.containerPort,Name:s.name,Protocol:s.protocol})}),e),[])??[]}function no(n){return n.filter(e=>{let t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&t["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(e=>{let t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((s,r)=>(r.name&&s.push(r.name),s),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((s,r)=>s+(r.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((s,r)=>s+r.restartCount,0),Ports:{Port:so(e)}}})}var Vn=class extends Ht{getPODs(){return super.GetPODs({}).then(e=>{if(to(e))return e.Pods?.Pod??[];try{let t=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return no(t?.items??[])}catch(t){return eo.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var Hs;(e=>{let n;(s=>s.gpg="gpg")(n=e.SigningMethodType||={})})(Hs||={});var jt=class extends v{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e,t){return this._connection.send("ListUserIDs",e,"json",!1,t,"ListUserIDsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_codesignPingResponse")}Sign(e,t){return this._connection.send("Sign",e,"json",!1,t,"SignResponse")}Verify(e,t){return this._connection.send("Verify",e,"json",!1,t,"VerifyResponse")}};var Hn=class extends jt{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:Hs.SigningMethodType.gpg,...e})}};var Ot=class extends v{constructor(e){super(e,"WSDali","1.07")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"ResultResponse")}ClearTraceTransactions(e,t){return this._connection.send("ClearTraceTransactions",e,"json",!1,t,"ResultResponse")}Count(e,t){return this._connection.send("Count",e,"json",!1,t,"CountResponse")}DFSCheck(e,t){return this._connection.send("DFSCheck",e,"json",!1,t,"ResultResponse")}DFSExists(e,t){return this._connection.send("DFSExists",e,"json",!1,t,"BooleanResponse")}DFSLS(e,t){return this._connection.send("DFSLS",e,"json",!1,t,"ResultResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"ResultResponse")}DisconnectClientConnection(e,t){return this._connection.send("DisconnectClientConnection",e,"json",!1,t,"ResultResponse")}GetClients(e,t){return this._connection.send("GetClients",e,"json",!1,t,"ResultResponse")}GetConnections(e,t){return this._connection.send("GetConnections",e,"json",!1,t,"ResultResponse")}GetDFSCSV(e,t){return this._connection.send("GetDFSCSV",e,"json",!1,t,"ResultResponse")}GetDFSMap(e,t){return this._connection.send("GetDFSMap",e,"json",!1,t,"ResultResponse")}GetDFSParents(e,t){return this._connection.send("GetDFSParents",e,"json",!1,t,"ResultResponse")}GetLogicalFile(e,t){return this._connection.send("GetLogicalFile",e,"json",!1,t,"ResultResponse")}GetLogicalFilePart(e,t){return this._connection.send("GetLogicalFilePart",e,"json",!1,t,"ResultResponse")}GetProtectedList(e,t){return this._connection.send("GetProtectedList",e,"json",!1,t,"ResultResponse")}GetSDSStats(e,t){return this._connection.send("GetSDSStats",e,"json",!1,t,"ResultResponse")}GetSDSSubscribers(e,t){return this._connection.send("GetSDSSubscribers",e,"json",!1,t,"ResultResponse")}GetValue(e,t){return this._connection.send("GetValue",e,"json",!1,t,"ResultResponse")}Import(e,t){return this._connection.send("Import",e,"json",!1,t,"ResultResponse")}ListSDSLocks(e,t){return this._connection.send("ListSDSLocks",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSDaliPingResponse")}SaveSDSStore(e,t){return this._connection.send("SaveSDSStore",e,"json",!1,t,"ResultResponse")}SetLogicalFilePartAttr(e,t){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,t,"ResultResponse")}SetProtected(e,t){return this._connection.send("SetProtected",e,"json",!1,t,"ResultResponse")}SetTraceSlowTransactions(e,t){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,t,"ResultResponse")}SetTraceTransactions(e,t){return this._connection.send("SetTraceTransactions",e,"json",!1,t,"ResultResponse")}SetUnprotected(e,t){return this._connection.send("SetUnprotected",e,"json",!1,t,"ResultResponse")}SetValue(e,t){return this._connection.send("SetValue",e,"json",!1,t,"ResultResponse")}UnlockSDSLock(e,t){return this._connection.send("UnlockSDSLock",e,"json",!1,t,"ResultResponse")}};var jn=class extends Ot{};var it;(c=>{let n;(A=>(A.Delete="Delete",A.AddToSuperfile="Add To Superfile",A.ChangeProtection="Change Protection",A.ChangeRestriction="Change Restriction"))(n=c.DFUArrayActions||={});let e;(A=>(A[A.NoChange=0]="NoChange",A[A.Protect=1]="Protect",A[A.Unprotect=2]="Unprotect",A[A.UnprotectAll=3]="UnprotectAll"))(e=c.DFUChangeProtection||={});let t;(E=>(E[E.NoChange=0]="NoChange",E[E.Restrict=1]="Restrict",E[E.Unrestricted=2]="Unrestricted"))(t=c.DFUChangeRestriction||={});let s;(l=>(l.xml="xml",l.def="def"))(s=c.DFUDefFileFormat||={});let r;(E=>(E.Token="Token",E.Engine="Engine",E.External="External"))(r=c.FileAccessRole||={});let i;(P=>(P.None="None",P.Access="Access",P.Read="Read",P.Write="Write",P.Full="Full"))(i=c.SecAccessType||={});let o;(j=>(j.Flat="Flat",j.Index="Index",j.Xml="Xml",j.Csv="Csv",j.Json="Json",j.IndexLocal="IndexLocal",j.IndexPartitioned="IndexPartitioned",j.Unset="Unset"))(o=c.DFUFileType||={})})(it||={});var _t=class extends v{constructor(e){super(e,"WsDfu","1.68")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"AddResponse")}AddRemote(e,t){return this._connection.send("AddRemote",e,"json",!1,t,"AddRemoteResponse")}AddtoSuperfile(e,t){return this._connection.send("AddtoSuperfile",e,"json",!1,t,"AddtoSuperfileResponse")}DFUArrayAction(e,t){return this._connection.send("DFUArrayAction",e,"json",!1,t,"DFUArrayActionResponse")}DFUBrowseData(e,t){return this._connection.send("DFUBrowseData",e,"json",!1,t,"DFUBrowseDataResponse")}DFUDefFile(e,t){return this._connection.send("DFUDefFile",e,"json",!1,t,"DFUDefFileResponse")}DFUFileAccess(e,t){return this._connection.send("DFUFileAccess",e,"json",!1,t,"DFUFileAccessResponse")}DFUFileAccessV2(e,t){return this._connection.send("DFUFileAccessV2",e,"json",!1,t,"DFUFileAccessResponse")}DFUFileCreate(e,t){return this._connection.send("DFUFileCreate",e,"json",!1,t,"DFUFileCreateResponse")}DFUFileCreateV2(e,t){return this._connection.send("DFUFileCreateV2",e,"json",!1,t,"DFUFileCreateResponse")}DFUFilePublish(e,t){return this._connection.send("DFUFilePublish",e,"json",!1,t,"DFUFilePublishResponse")}DFUFileRename(e,t){return this._connection.send("DFUFileRename",e,"json",!1,t,"DFUFileRenameResponse")}DFUFileView(e,t){return this._connection.send("DFUFileView",e,"json",!1,t,"DFUFileViewResponse")}DFUGetDataColumns(e,t){return this._connection.send("DFUGetDataColumns",e,"json",!1,t,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e,t){return this._connection.send("DFUGetFileMetaData",e,"json",!1,t,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e,t){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,t,"DFUMetaInquiryResponse")}DFUInfo(e,t){return this._connection.send("DFUInfo",e,"json",!1,t,"DFUInfoResponse")}DFUQuery(e,t){return this._connection.send("DFUQuery",e,"json",!1,t,"DFUQueryResponse")}DFURecordTypeInfo(e,t){return this._connection.send("DFURecordTypeInfo",e,"json",!1,t,"DFURecordTypeInfoResponse")}DFUSearch(e,t){return this._connection.send("DFUSearch",e,"json",!1,t,"DFUSearchResponse")}DFUSearchData(e,t){return this._connection.send("DFUSearchData",e,"json",!1,t,"DFUSearchDataResponse")}DFUSpace(e,t){return this._connection.send("DFUSpace",e,"json",!1,t,"DFUSpaceResponse")}EclRecordTypeInfo(e,t){return this._connection.send("EclRecordTypeInfo",e,"json",!1,t,"EclRecordTypeInfoResponse")}EraseHistory(e,t){return this._connection.send("EraseHistory",e,"json",!1,t,"EraseHistoryResponse")}ListHistory(e,t){return this._connection.send("ListHistory",e,"json",!1,t,"ListHistoryResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDfuPingResponse")}Savexml(e,t){return this._connection.send("Savexml",e,"json",!1,t,"SavexmlResponse")}SuperfileAction(e,t){return this._connection.send("SuperfileAction",e,"json",!1,t,"SuperfileActionResponse")}SuperfileList(e,t){return this._connection.send("SuperfileList",e,"json",!1,t,"SuperfileListResponse")}};var Bc=it.DFUArrayActions,Qc=it.DFUDefFileFormat,Lc=it.DFUChangeProtection,Gc=it.DFUChangeRestriction,Dt=class extends _t{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){let t=[],s=[];return await Promise.all(e.map(r=>this.DFUInfo({Cluster:r.NodeGroup,Name:r.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(i=>{for(let o of i?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(o);for(let o of i?.FileDetail?.subfiles?.Item??[])s.push(o)}))),s.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};var Yt=class extends v{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e,t){return this._connection.send("DFUXRefArrayAction",e,"json",!1,t,"DFUXRefArrayActionResponse")}DFUXRefBuild(e,t){return this._connection.send("DFUXRefBuild",e,"json",!1,t,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e,t){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,t,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e,t){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,t,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e,t){return this._connection.send("DFUXRefDirectories",e,"json",!1,t,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e,t){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,t,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e,t){return this._connection.send("DFUXRefList",e,"json",!1,t,"DFUXRefListResponse")}DFUXRefLostFiles(e,t){return this._connection.send("DFUXRefLostFiles",e,"json",!1,t,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e,t){return this._connection.send("DFUXRefMessages",e,"json",!1,t,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e,t){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,t,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e,t){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,t,"DFUXRefUnusedFilesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDFUXRefPingResponse")}};var On=class extends Yt{DFUXRefDirectoriesEx(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefListEx(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}};function _n(n,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:n,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:n,type:"dataset",children:js(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:n,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:n,type:"object",fields:ro(e)}}default:throw new Error("Unknown field type")}}function js(n){n.Row&&n.Row instanceof Array&&(n=n.Row[0]);let e=[];for(let t in n)e.push(_n(t,n[t]));return e}function ro(n){let e={};for(let t in n)e[t]=_n(t,n[t]);return e}var Xt=class extends v{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(s=>{let r=JSON.parse(s);for(let i in r)return r[i];return{}}).then(js)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(s=>{let r=JSON.parse(s);for(let i in r)return r[i].Results;return{}}).then(s=>{let r={};for(let i in s)r[i]=js(s[i]);return r})}submit(e,t,s){let r=`submit/query/${e}/${t}`;return this._connection.send(r,s,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new ze(r,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var qt=class extends v{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e,t){return this._connection.send("GetConfigDetails",e,"json",!1,t,"GetConfigDetailsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_elkPingResponse")}};var Yn=class extends qt{};import{scopedLogger as io}from"@hpcc-js/util";var te;(d=>{let n;(F=>(F.global="global",F.workunits="workunits",F.components="components",F.audience="audience",F.class="class",F.instance="instance",F.node="node",F.message="message",F.logid="logid",F.processid="processid",F.threadid="threadid",F.timestamp="timestamp",F.pod="pod",F.traceid="traceid",F.spanid="spanid"))(n=d.LogColumnType||={});let e;(N=>(N.string="string",N.numeric="numeric",N.datetime="datetime",N.enum="enum",N.epoch="epoch"))(e=d.LogColumnValueType||={});let t;(T=>(T[T.All=0]="All",T[T.ByJobID=1]="ByJobID",T[T.ByComponent=2]="ByComponent",T[T.ByLogType=3]="ByLogType",T[T.ByTargetAudience=4]="ByTargetAudience",T[T.BySourceInstance=5]="BySourceInstance",T[T.BySourceNode=6]="BySourceNode",T[T.ByFieldName=7]="ByFieldName",T[T.ByPod=8]="ByPod",T[T.ByTraceID=9]="ByTraceID",T[T.BySpanID=10]="BySpanID"))(t=d.LogAccessType||={});let s;(A=>(A[A.Success=0]="Success",A[A.Warning=1]="Warning",A[A.Fail=2]="Fail"))(s=d.LogAccessStatusCode||={});let r;(A=>(A[A.NONE=0]="NONE",A[A.AND=1]="AND",A[A.OR=2]="OR"))(r=d.LogAccessFilterOperator||={});let i;(P=>(P[P.MIN=0]="MIN",P[P.DEFAULT=1]="DEFAULT",P[P.ALL=2]="ALL",P[P.CUSTOM=3]="CUSTOM"))(i=d.LogSelectColumnMode||={});let o;(T=>(T[T.ByDate=0]="ByDate",T[T.ByJobID=1]="ByJobID",T[T.ByComponent=2]="ByComponent",T[T.ByLogType=3]="ByLogType",T[T.ByTargetAudience=4]="ByTargetAudience",T[T.BySourceInstance=5]="BySourceInstance",T[T.BySourceNode=6]="BySourceNode",T[T.ByFieldName=7]="ByFieldName",T[T.ByPod=8]="ByPod",T[T.ByTraceID=9]="ByTraceID",T[T.BySpanID=10]="BySpanID"))(o=d.SortColumType||={});let c;(E=>(E[E.ASC=0]="ASC",E[E.DSC=1]="DSC"))(c=d.SortDirection||={})})(te||={});var zt=class extends v{constructor(e){super(e,"ws_logaccess","1.08")}GetHealthReport(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}};var Xn=io("@hpcc-js/comms/services/wsLogaccess.ts");var oo=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(oo||{}),ao=(r=>(r.Operator="OPR",r.User="USR",r.Programmer="PRO",r.Audit="ADT",r))(ao||{}),co=new Set(["azureloganalyticscurl","elasticstack","grafanacurl"]),uo=new Set(Object.values(te.LogColumnType));function lo(n){switch(n){case te.LogColumnType.workunits:case"hpcc.log.jobid":return te.LogAccessType.ByJobID;case te.LogColumnType.audience:case"hpcc.log.audience":return te.LogAccessType.ByTargetAudience;case te.LogColumnType.class:case"hpcc.log.class":return te.LogAccessType.ByLogType;case te.LogColumnType.components:case"kubernetes.container.name":return te.LogAccessType.ByComponent;default:return te.LogAccessType.ByFieldName}}var go=["audience","class","workunits","message","processid","logid","threadid","timestamp","components","instance"];function po(n,e){let t=[];for(let s of go){let r=n[s];if(r==null||r===""||Array.isArray(r)&&r.length===0||!(s in e))continue;let o=uo.has(s)?s:e[s],c=lo(o);c===te.LogAccessType.ByFieldName&&(o=e[s]);let d=c===te.LogAccessType.ByComponent,C=Array.isArray(r)?r:[r];for(let l of C)t.push({LogCategory:c,SearchField:o,SearchByValue:d?l+"*":l})}return t}function Jt(n){let e={leftFilter:n[0]},t=e;for(let s=1;s<n.length;s++)t.Operator=te.LogAccessFilterOperator.OR,s===n.length-1?t.rightFilter=n[s]:(t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:n[s]}]},t=t.rightBinaryFilter.BinaryLogFilter[0]);return e}function zn(n){let[e,...t]=n,s={};if(e.length===1?s.leftFilter=e[0]:s.leftBinaryFilter={BinaryLogFilter:[Jt(e)]},t.length===0)return s;if(s.Operator=te.LogAccessFilterOperator.AND,t.length===1){let[r]=t;r.length===1?s.rightFilter=r[0]:s.rightBinaryFilter={BinaryLogFilter:[Jt(r)]}}else s.rightBinaryFilter={BinaryLogFilter:[zn(t)]};return s}function mo(n){let e=new Map;for(let o of n){let c=e.get(o.SearchField);c?c.push(o):e.set(o.SearchField,[o])}let t=[...e.values()];if(t.length===0)return{leftFilter:{LogCategory:te.LogAccessType.All}};let[s,...r]=t,i={};if(s.length===1?i.leftFilter=s[0]:i.leftBinaryFilter={BinaryLogFilter:[Jt(s)]},r.length===0)return i;if(i.Operator=te.LogAccessFilterOperator.AND,r.length===1){let[o]=r;o.length===1?i.rightFilter=o[0]:i.rightBinaryFilter={BinaryLogFilter:[Jt(o)]}}else i.rightBinaryFilter={BinaryLogFilter:[zn(r)]};return i}var qn=class extends zt{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let s={},r=t?.fields?Object.assign({},...t.fields):null;for(let i in e)s[i]=r?r[e[i]]??"":"";return s}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(c=>s[c.LogType]=c.Name);let r=po(e,s),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let o={Filter:mo(r),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:te.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:te.SortColumType.ByDate,ColumnName:"",Direction:0}]}};return this.GetLogs(o).then(c=>{try{let d=JSON.parse(c.LogLines);return{lines:co.has(t.RemoteLogManagerType)?d.lines?.map(l=>this.convertLogLine(s,l))??[]:(Xn.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:c.TotalLogLinesAvailable??1e4}}catch(d){Xn.error(d.message??d)}return{lines:[],total:0}})}};var Ge=mt(Kn(),1);import{exists as fo}from"@hpcc-js/util";var ho;(t=>{let n;(i=>(i[i.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",i[i.THRESHOLD_MB=1]="THRESHOLD_MB"))(n=t.ThresholdType||={});let e;(P=>(P.ALLNODES="ALLNODES",P.THORMACHINES="THORMACHINES",P.HOLEMACHINES="HOLEMACHINES",P.ROXIEMACHINES="ROXIEMACHINES",P.MACHINES="MACHINES",P.AVAILABLEMACHINES="AVAILABLEMACHINES",P.DROPZONE="DROPZONE",P.STANDBYNNODE="STANDBYNNODE",P.THORSPARENODES="THORSPARENODES",P.HOLESTANDBYNODES="HOLESTANDBYNODES"))(e=t.TpMachineType||={})})(ho||={});var Zt=class extends v{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e,t){return this._connection.send("GetComponentStatus",e,"json",!1,t,"GetComponentStatusResponse")}GetComponentUsage(e,t){return this._connection.send("GetComponentUsage",e,"json",!1,t,"GetComponentUsageResponse")}GetMachineInfo(e,t){return this._connection.send("GetMachineInfo",e,"json",!1,t,"GetMachineInfoResponse")}GetMachineInfoEx(e,t){return this._connection.send("GetMachineInfoEx",e,"json",!1,t,"GetMachineInfoResponseEx")}GetMetrics(e,t){return this._connection.send("GetMetrics",e,"json",!1,t,"MetricsResponse")}GetNodeGroupUsage(e,t){return this._connection.send("GetNodeGroupUsage",e,"json",!1,t,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e,t){return this._connection.send("GetTargetClusterInfo",e,"json",!1,t,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e,t){return this._connection.send("GetTargetClusterUsage",e,"json",!1,t,"GetTargetClusterUsageResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_machinePingResponse")}UpdateComponentStatus(e,t){return this._connection.send("UpdateComponentStatus",e,"json",!1,t,"UpdateComponentStatusResponse")}};var ke=class extends Zt{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>fo("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(r=>!!r.ComponentUsages).map(r=>{let i=r.ComponentUsages.ComponentUsage.map(o=>{let c=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(d=>{let C=d.DiskUsages&&d.DiskUsages.DiskUsage?d.DiskUsages.DiskUsage.map(l=>({...l,InUse:l.InUse*1024,Total:(l.InUse+l.Available)*1024,PercentUsed:100-l.PercentAvailable})):[];return{Name:d.Name,NetAddress:d.NetAddress,Description:d.Description,DiskUsages:C,mean:(0,Ge.mean)(C.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed),max:(0,Ge.max)(C.filter(l=>!isNaN(l.PercentUsed)),l=>l.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:c,MachineUsagesDescription:c.reduce((d,C)=>d+(C.Description||""),""),mean:(0,Ge.mean)(c.filter(d=>!isNaN(d.mean)),d=>d.mean),max:(0,Ge.max)(c.filter(d=>!isNaN(d.max)),d=>d.max)}});return{Name:r.Name,Description:r.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,c)=>o+(c.MachineUsagesDescription||""),""),mean:(0,Ge.mean)(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:(0,Ge.max)(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var $t=class extends v{constructor(e){super(e,"WsPackageProcess","1.08")}ActivatePackage(e,t){return this._connection.send("ActivatePackage",e,"json",!1,t,"ActivatePackageResponse")}AddPackage(e,t){return this._connection.send("AddPackage",e,"json",!1,t,"AddPackageResponse")}AddPartToPackageMap(e,t){return this._connection.send("AddPartToPackageMap",e,"json",!1,t,"AddPartToPackageMapResponse")}CopyPackageMap(e,t){return this._connection.send("CopyPackageMap",e,"json",!1,t,"CopyPackageMapResponse")}DeActivatePackage(e,t){return this._connection.send("DeActivatePackage",e,"json",!1,t,"DeActivatePackageResponse")}DeletePackage(e,t){return this._connection.send("DeletePackage",e,"json",!1,t,"DeletePackageResponse")}Echo(e,t){return this._connection.send("Echo",e,"json",!1,t,"EchoResponse")}GetPackage(e,t){return this._connection.send("GetPackage",e,"json",!1,t,"GetPackageResponse")}GetPackageMapById(e,t){return this._connection.send("GetPackageMapById",e,"json",!1,t,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e,t){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,t,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e,t){return this._connection.send("GetPartFromPackageMap",e,"json",!1,t,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e,t){return this._connection.send("GetQueryFileMapping",e,"json",!1,t,"GetQueryFileMappingResponse")}ListPackage(e,t){return this._connection.send("ListPackage",e,"json",!1,t,"ListPackageResponse")}ListPackages(e,t){return this._connection.send("ListPackages",e,"json",!1,t,"ListPackagesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e,t){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,t,"RemovePartFromPackageMapResponse")}ValidatePackage(e,t){return this._connection.send("ValidatePackage",e,"json",!1,t,"ValidatePackageResponse")}};var Zn=class extends $t{};var es=class extends v{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};var $n=class extends es{};var er;(e=>{let n;(r=>(r.ECL="ECL",r.DFU="DFU"))(n=e.WUTypes||={})})(er||={});var ts=class extends v{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e,t){return this._connection.send("ArchiveWU",e,"json",!1,t,"ResultResponse")}GetVersion(e,t){return this._connection.send("GetVersion",e,"json",!1,t,"ResultResponse")}ListWU(e,t){return this._connection.send("ListWU",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSSashaPingResponse")}RestoreWU(e,t){return this._connection.send("RestoreWU",e,"json",!1,t,"ResultResponse")}};var tr=class extends ts{};var or=mt(Os(),1);var ir;(t=>{let n;(d=>(d.ALL="ALL",d.READ="READ",d.WRITE="WRITE",d.HOLD="HOLD",d.SUB="SUB"))(n=t.LockModes||={});let e;(E=>(E.Attach="Attach",E.Detach="Detach",E.State="State",E.Reload="Reload",E.ReloadRetry="ReloadRetry",E.MemLock="MemLock",E.MemUnlock="MemUnlock",E.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(ir||={});var rs=class extends v{constructor(e){super(e,"WsSMC","1.29")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var So=(0,or.timeParse)("%Y%m%d%H");function Do(n){return typeof n=="number"||typeof n=="string"&&n.trim()!==""&&!isNaN(+n)}var Rt=class extends rs{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?So(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():Do(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(t=>{let s=[];for(let r of t?.GlobalMetrics?.GlobalMetric||[]){let i={Category:r.Category,Start:this.parseGlobalMetric("Date",r.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",r.DateTimeRange?.End),dimensions:{},stats:{}};for(let o of r.Dimensions?.Dimension||[])i.dimensions[o.Name]=o.Value;for(let o of r.Stats?.Stat||[])i.stats[o.Name]=this.parseGlobalMetric(o.Name,o.Value);s.push(i)}return s})}};var is=class extends v{constructor(e){super(e,"wsstore","1.02")}CreateStore(e,t){return this._connection.send("CreateStore",e,"json",!1,t,"CreateStoreResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"DeleteResponse")}DeleteNamespace(e,t){return this._connection.send("DeleteNamespace",e,"json",!1,t,"DeleteNamespaceResponse")}Fetch(e,t){return this._connection.send("Fetch",e,"json",!1,t,"FetchResponse")}FetchAll(e,t){return this._connection.send("FetchAll",e,"json",!1,t,"FetchAllResponse")}FetchKeyMetadata(e,t){return this._connection.send("FetchKeyMetadata",e,"json",!1,t,"FetchKeyMDResponse")}ListKeys(e,t){return this._connection.send("ListKeys",e,"json",!1,t,"ListKeysResponse")}ListNamespaces(e,t){return this._connection.send("ListNamespaces",e,"json",!1,t,"ListNamespacesResponse")}ListStores(e,t){return this._connection.send("ListStores",e,"json",!1,t,"ListStoresResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"wsstorePingResponse")}Set(e,t){return this._connection.send("Set",e,"json",!1,t,"SetResponse")}};var Ct=class extends is{Delete(e){return super.Delete(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}Fetch(e){return super.Fetch(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}};var ar;(s=>{let n;(o=>(o.XML="XML",o.YAML="YAML"))(n=s.TpConfigResponseFormat||={});let e;(c=>(c.All="All",c.QueriesOnly="QueriesOnly",c.WorkunitsOnly="WorkunitsOnly"))(e=s.RoxieQueueFilter||={});let t;(N=>(N.ALLNODES="ALLNODES",N.THORMACHINES="THORMACHINES",N.HOLEMACHINES="HOLEMACHINES",N.ROXIEMACHINES="ROXIEMACHINES",N.MACHINES="MACHINES",N.AVAILABLEMACHINES="AVAILABLEMACHINES",N.DROPZONE="DROPZONE",N.STANDBYNNODE="STANDBYNNODE",N.THORSPARENODES="THORSPARENODES",N.HOLESTANDBYNODES="HOLESTANDBYNODES"))(t=s.TpMachineType||={})})(ar||={});var os=class extends v{constructor(e){super(e,"WsTopology","1.33")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsTopologyPingResponse")}SystemLog(e,t){return this._connection.send("SystemLog",e,"json",!1,t,"SystemLogResponse")}TpClusterInfo(e,t){return this._connection.send("TpClusterInfo",e,"json",!1,t,"TpClusterInfoResponse")}TpClusterQuery(e,t){return this._connection.send("TpClusterQuery",e,"json",!1,t,"TpClusterQueryResponse")}TpComponentConfiguration(e,t){return this._connection.send("TpComponentConfiguration",e,"json",!1,t,"TpComponentConfigurationResponse")}TpConfiguredComponents(e,t){return this._connection.send("TpConfiguredComponents",e,"json",!1,t,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e,t){return this._connection.send("TpDropZoneQuery",e,"json",!1,t,"TpDropZoneQueryResponse")}TpGetComponentFile(e,t){return this._connection.send("TpGetComponentFile",e,"json",!1,t,"TpGetComponentFileResponse")}TpGetServicePlugins(e,t){return this._connection.send("TpGetServicePlugins",e,"json",!1,t,"TpGetServicePluginsResponse")}TpGroupQuery(e,t){return this._connection.send("TpGroupQuery",e,"json",!1,t,"TpGroupQueryResponse")}TpListLogFiles(e,t){return this._connection.send("TpListLogFiles",e,"json",!1,t,"TpListLogFilesResponse")}TpListTargetClusters(e,t){return this._connection.send("TpListTargetClusters",e,"json",!1,t,"TpListTargetClustersResponse")}TpLogFile(e,t){return this._connection.send("TpLogFile",e,"json",!1,t,"TpLogFileResponse")}TpLogFileDisplay(e,t){return this._connection.send("TpLogFileDisplay",e,"json",!1,t,"TpLogFileResponse")}TpLogicalClusterQuery(e,t){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,t,"TpLogicalClusterQueryResponse")}TpMachineInfo(e,t){return this._connection.send("TpMachineInfo",e,"json",!1,t,"TpMachineInfoResponse")}TpMachineQuery(e,t){return this._connection.send("TpMachineQuery",e,"json",!1,t,"TpMachineQueryResponse")}TpServiceQuery(e,t){return this._connection.send("TpServiceQuery",e,"json",!1,t,"TpServiceQueryResponse")}TpSetMachineStatus(e,t){return this._connection.send("TpSetMachineStatus",e,"json",!1,t,"TpSetMachineStatusResponse")}TpSwapNode(e,t){return this._connection.send("TpSwapNode",e,"json",!1,t,"TpSwapNodeResponse")}TpTargetClusterQuery(e,t){return this._connection.send("TpTargetClusterQuery",e,"json",!1,t,"TpTargetClusterQueryResponse")}TpThorStatus(e,t){return this._connection.send("TpThorStatus",e,"json",!1,t,"TpThorStatusResponse")}TpXMLFile(e,t){return this._connection.send("TpXMLFile",e,"json",!1,t,"TpXMLFileResponse")}};var ge=class extends os{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(t=>{if(t.default)return t.default;let s,r;return t.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(r=i),i.Type==="hthor"?(s=i,!0):!1)),s||r})}};import{deepMixin as Ro,xml2json as Co}from"@hpcc-js/util";var he;(w=>{let n;(H=>(H.Abort="Abort",H.Delete="Delete",H.Deschedule="Deschedule",H.Reschedule="Reschedule",H.Pause="Pause",H.PauseNow="PauseNow",H.Protect="Protect",H.Unprotect="Unprotect",H.Restore="Restore",H.Resume="Resume",H.SetToFailed="SetToFailed",H.Archive="Archive"))(n=w.ECLWUActions||={});let e;(m=>(m[m.MIN=0]="MIN",m[m.DEFAULT=1]="DEFAULT",m[m.ALL=2]="ALL",m[m.CUSTOM=3]="CUSTOM"))(e=w.LogSelectColumnMode||={});let t;(ne=>(ne[ne.ASC=0]="ASC",ne[ne.DSC=1]="DSC"))(t=w.SortDirection||={});let s;(Q=>(Q.ALL="ALL",Q.DIS="DIS",Q.ERR="ERR",Q.WRN="WRN",Q.INF="INF",Q.PRO="PRO",Q.MET="MET",Q.EVT="EVT"))(s=w.LogEventClass||={});let r;(_=>(_.Single="Single",_.List="List",_.Multi="Multi"))(r=w.WUDetailsAttrValueType||={});let i;(_=>(_.SyntaxCheck="SyntaxCheck",_.Deploy="Deploy",_.Publish="Publish"))(i=w.EclDefinitionActions||={});let o;(_=>(_.xml="xml",_.json="json",_.text="text"))(o=w.ErrorMessageFormat||={});let c;(_=>(_[_.XML=0]="XML",_[_.JSON=1]="JSON",_[_.CSV=2]="CSV"))(c=w.LogAccessLogFormat||={});let d;(m=>(m.info="info",m.warning="warning",m.error="error",m.alert="alert"))(d=w.WUExceptionSeverity||={});let C;(m=>(m[m.OriginalText=0]="OriginalText",m[m.Attachment=1]="Attachment",m[m.ZIP=2]="ZIP",m[m.GZIP=3]="GZIP"))(C=w.WUFileDownloadOption||={});let l;(H=>(H.XML="XML",H.cpp="cpp",H.dll="dll",H.res="res",H.log="log",H.WUECL="WUECL",H.ThorLog="ThorLog",H.ThorSlaveLog="ThorSlaveLog",H.EclAgentLog="EclAgentLog",H.ArchiveQuery="ArchiveQuery",H.ComponentLog="ComponentLog",H.PostMortem="PostMortem"))(l=w.WUFileType||={});let E;(L=>(L.Allqueries="All queries",L.Notsuspended="Not suspended",L.Suspended="Suspended",L.Suspendedbyuser="Suspended by user",L.Suspendedbyfirstnode="Suspended by first node",L.Suspendedbyanynode="Suspended by any node"))(E=w.WUQueryFilterSuspendedType||={});let A;(F=>(F.All="All",F.Id="Id",F.Name="Name",F.Alias="Alias",F.Status="Status"))(A=w.WUQuerySetFilterType||={});let P;(_=>(_.All="All",_.Protected="Protected",_.NotProtected="NotProtected"))(P=w.WUProtectFilter||={});let N;(T=>T.Deactivate="Deactivate")(N=w.QuerySetAliasActionTypes||={});let V;(ne=>(ne.None="None",ne.ActivateImportedActive="ActivateImportedActive"))(V=w.QuerysetImportActivation||={});let j;(Q=>(Q.Suspend="Suspend",Q.Unsuspend="Unsuspend",Q.ToggleSuspend="ToggleSuspend",Q.Activate="Activate",Q.Delete="Delete",Q.DeleteQueriesAndWUs="DeleteQueriesAndWUs",Q.RemoveAllAliases="RemoveAllAliases",Q.ResetQueryStats="ResetQueryStats"))(j=w.QuerySetQueryActionTypes||={});let X;(m=>(m[m.DoNotActivateQuery=0]="DoNotActivateQuery",m[m.ActivateQuery=1]="ActivateQuery",m[m.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",m[m.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(X=w.WUQueryActivationMode||={})})(he||={});var At=class extends v{constructor(e){super(e,"WsWorkunits","2.10")}GVCAjaxGraph(e,t){return this._connection.send("GVCAjaxGraph",e,"json",!1,t,"GVCAjaxGraphResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsWorkunitsPingResponse")}WUAbort(e,t){return this._connection.send("WUAbort",e,"json",!1,t,"WUAbortResponse")}WUAction(e,t){return this._connection.send("WUAction",e,"json",!1,t,"WUActionResponse")}WUAddLocalFileToWorkunit(e,t){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,t,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e,t){return this._connection.send("WUAnalyseHotspot",e,"json",!1,t,"WUAnalyseHotspotResponse")}WUCDebug(e,t){return this._connection.send("WUCDebug",e,"json",!1,t,"WUDebugResponse")}WUCheckFeatures(e,t){return this._connection.send("WUCheckFeatures",e,"json",!1,t,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e,t){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,t,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e,t){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,t,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e,t){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,t,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e,t){return this._connection.send("WUClusterJobXLS",e,"json",!1,t,"WUClusterJobXLSResponse")}WUCompileECL(e,t){return this._connection.send("WUCompileECL",e,"json",!1,t,"WUCompileECLResponse")}WUCopyLogicalFiles(e,t){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,t,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e,t){return this._connection.send("WUCopyQuerySet",e,"json",!1,t,"WUCopyQuerySetResponse")}WUCreate(e,t){return this._connection.send("WUCreate",e,"json",!1,t,"WUCreateResponse")}WUCreateAndUpdate(e,t){return this._connection.send("WUCreateAndUpdate",e,"json",!1,t,"WUUpdateResponse")}WUCreateZAPInfo(e,t){return this._connection.send("WUCreateZAPInfo",e,"json",!1,t,"WUCreateZAPInfoResponse")}WUDelete(e,t){return this._connection.send("WUDelete",e,"json",!1,t,"WUDeleteResponse")}WUDeployWorkunit(e,t){return this._connection.send("WUDeployWorkunit",e,"json",!1,t,"WUDeployWorkunitResponse")}WUDetails(e,t){return this._connection.send("WUDetails",e,"json",!1,t,"WUDetailsResponse")}WUDetailsMeta(e,t){return this._connection.send("WUDetailsMeta",e,"json",!1,t,"WUDetailsMetaResponse")}WUEclDefinitionAction(e,t){return this._connection.send("WUEclDefinitionAction",e,"json",!1,t,"WUEclDefinitionActionResponse")}WUExport(e,t){return this._connection.send("WUExport",e,"json",!1,t,"WUExportResponse")}WUFile(e,t){return this._connection.send("WUFile",e,"json",!1,t,"WULogFileResponse")}WUFullResult(e,t){return this._connection.send("WUFullResult",e,"json",!1,t,"WUFullResultResponse")}WUGVCGraphInfo(e,t){return this._connection.send("WUGVCGraphInfo",e,"json",!1,t,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e,t){return this._connection.send("WUGetArchiveFile",e,"json",!1,t,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e,t){return this._connection.send("WUGetDependancyTrees",e,"json",!1,t,"WUGetDependancyTreesResponse")}WUGetGraph(e,t){return this._connection.send("WUGetGraph",e,"json",!1,t,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e,t){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,t,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e,t){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,t,"WUGetNumFileToCopyResponse")}WUGetPlugins(e,t){return this._connection.send("WUGetPlugins",e,"json",!1,t,"WUGetPluginsResponse")}WUGetStats(e,t){return this._connection.send("WUGetStats",e,"json",!1,t,"WUGetStatsResponse")}WUGetThorJobList(e,t){return this._connection.send("WUGetThorJobList",e,"json",!1,t,"WUGetThorJobListResponse")}WUGetThorJobQueue(e,t){return this._connection.send("WUGetThorJobQueue",e,"json",!1,t,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e,t){return this._connection.send("WUGetZAPInfo",e,"json",!1,t,"WUGetZAPInfoResponse")}WUGraphInfo(e,t){return this._connection.send("WUGraphInfo",e,"json",!1,t,"WUGraphInfoResponse")}WUGraphTiming(e,t){return this._connection.send("WUGraphTiming",e,"json",!1,t,"WUGraphTimingResponse")}WUHelperFileArchive(e,t){return this._connection.send("WUHelperFileArchive",e,"json",!1,t,"WUHelperFileArchiveResponse")}WUInfo(e,t){return this._connection.send("WUInfo",e,"json",!1,t,"WUInfoResponse")}WUInfoDetails(e,t){return this._connection.send("WUInfoDetails",e,"json",!1,t,"WUInfoResponse")}WUJobList(e,t){return this._connection.send("WUJobList",e,"json",!1,t,"WUJobListResponse")}WULightWeightQuery(e,t){return this._connection.send("WULightWeightQuery",e,"json",!1,t,"WULightWeightQueryResponse")}WUListArchiveFiles(e,t){return this._connection.send("WUListArchiveFiles",e,"json",!1,t,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e,t){return this._connection.send("WUListLocalFileRequired",e,"json",!1,t,"WUListLocalFileRequiredResponse")}WUListQueries(e,t){return this._connection.send("WUListQueries",e,"json",!1,t,"WUListQueriesResponse")}WUListQueriesUsingFile(e,t){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,t,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e,t){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,t,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e,t){return this._connection.send("WUProcessGraph",e,"json",!1,t,"WUProcessGraphResponse")}WUProtect(e,t){return this._connection.send("WUProtect",e,"json",!1,t,"WUProtectResponse")}WUPublishWorkunit(e,t){return this._connection.send("WUPublishWorkunit",e,"json",!1,t,"WUPublishWorkunitResponse")}WUPushEvent(e,t){return this._connection.send("WUPushEvent",e,"json",!1,t,"WUPushEventResponse")}WUQuery(e,t){return this._connection.send("WUQuery",e,"json",!1,t,"WUQueryResponse")}WUQueryConfig(e,t){return this._connection.send("WUQueryConfig",e,"json",!1,t,"WUQueryConfigResponse")}WUQueryDetails(e,t){return this._connection.send("WUQueryDetails",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e,t){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryFiles(e,t){return this._connection.send("WUQueryFiles",e,"json",!1,t,"WUQueryFilesResponse")}WUQueryGetGraph(e,t){return this._connection.send("WUQueryGetGraph",e,"json",!1,t,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e,t){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,t,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e,t){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,t,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e,t){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,t,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e,t){return this._connection.send("WUQuerysetDetails",e,"json",!1,t,"WUQuerySetDetailsResponse")}WUQuerysetExport(e,t){return this._connection.send("WUQuerysetExport",e,"json",!1,t,"WUQuerysetExportResponse")}WUQuerysetImport(e,t){return this._connection.send("WUQuerysetImport",e,"json",!1,t,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e,t){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,t,"WUQuerySetQueryActionResponse")}WUQuerysets(e,t){return this._connection.send("WUQuerysets",e,"json",!1,t,"WUQuerysetsResponse")}WURecreateQuery(e,t){return this._connection.send("WURecreateQuery",e,"json",!1,t,"WURecreateQueryResponse")}WUResubmit(e,t){return this._connection.send("WUResubmit",e,"json",!1,t,"WUResubmitResponse")}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t,"WUResultResponse")}WUResultBin(e,t){return this._connection.send("WUResultBin",e,"json",!1,t,"WUResultBinResponse")}WUResultSummary(e,t){return this._connection.send("WUResultSummary",e,"json",!1,t,"WUResultSummaryResponse")}WUResultView(e,t){return this._connection.send("WUResultView",e,"json",!1,t,"WUResultViewResponse")}WURun(e,t){return this._connection.send("WURun",e,"json",!1,t,"WURunResponse")}WUSchedule(e,t){return this._connection.send("WUSchedule",e,"json",!1,t,"WUScheduleResponse")}WUShowScheduled(e,t){return this._connection.send("WUShowScheduled",e,"json",!1,t,"WUShowScheduledResponse")}WUSubmit(e,t){return this._connection.send("WUSubmit",e,"json",!1,t,"WUSubmitResponse")}WUSyntaxCheckECL(e,t){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,t,"WUSyntaxCheckResponse")}WUUpdate(e,t){return this._connection.send("WUUpdate",e,"json",!1,t,"WUUpdateResponse")}WUUpdateQueryEntry(e,t){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,t,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e,t){return this._connection.send("WUWaitCompiled",e,"json",!1,t,"WUWaitResponse")}WUWaitComplete(e,t){return this._connection.send("WUWaitComplete",e,"json",!1,t,"WUWaitResponse")}};var _s=(M=>(M[M.Unknown=0]="Unknown",M[M.Compiled=1]="Compiled",M[M.Running=2]="Running",M[M.Completed=3]="Completed",M[M.Failed=4]="Failed",M[M.Archived=5]="Archived",M[M.Aborting=6]="Aborting",M[M.Aborted=7]="Aborted",M[M.Blocked=8]="Blocked",M[M.Submitted=9]="Submitted",M[M.Scheduled=10]="Scheduled",M[M.Compiling=11]="Compiling",M[M.Wait=12]="Wait",M[M.UploadingFiled=13]="UploadingFiled",M[M.DebugPaused=14]="DebugPaused",M[M.DebugRunning=15]="DebugRunning",M[M.Paused=16]="Paused",M[M.LAST=17]="LAST",M[M.NotFound=999]="NotFound",M))(_s||{}),Ke;(e=>{let n;(A=>(A[A.Unknown=0]="Unknown",A[A.Compile=1]="Compile",A[A.Check=2]="Check",A[A.Run=3]="Run",A[A.ExecuteExisting=4]="ExecuteExisting",A[A.Pause=5]="Pause",A[A.PauseNow=6]="PauseNow",A[A.Resume=7]="Resume",A[A.Debug=8]="Debug",A[A.__size=9]="__size"))(n=e.Action||={})})(Ke||={});function ur(n){return typeof n.Name=="string"}function ku(n){return n.TotalClusterTime!==void 0}function vu(n){return n.StateEx!==void 0}var ae=class extends At{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(s=>Ro({Workunits:{ECLWorkunit:[]}},s))}WUInfo(e){let t={Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUDetailsEx(e,t,s){return this._connection.send("WUDetails",e,s,!1,t,"WUDetailsResponse")}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(t=>{let r=Co(t.Result).children();return r.length?r[0]:null})}},as=class extends At{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as _o,StateObject as Yo}from"@hpcc-js/util";var Pr=mt(Ys(),1),Es=mt(Os(),1);import{Cache as Fo,deepMixinT as Ur,scopedLogger as Po,StateObject as Io,XMLNode as tn}from"@hpcc-js/util";import{Cache as gr,Edge as Dr,Graph as Rr,StateObject as Ao,Subgraph as Cr,Vertex as Ar}from"@hpcc-js/util";var us=class extends Ao{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,s){super(),this.wu=e;let r=0;for(let i of s)if(i.GraphName===t.Name&&!i.HasSubGraphId){r=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:r,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(t=>ps(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>ps(t))}},ls=class extends gr{constructor(){super(e=>gr.hash([e.Name]))}};function yr(n,e,t){t=t||[],t.push(n),e(n.name,n.$,n.children(),t),n.children().forEach(s=>{yr(s,e,t)}),t.pop()}function Xs(n){let e={};return n.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var qs=class extends Rr{},pr=class extends Cr{},dr=class extends Ar{},mr=class extends Dr{};function Wr(n,e){let t={},s={},r={},i=new qs(c=>c._.id),o=[i.root];return yr(e,(c,d,C,l)=>{let E=o[o.length-1];switch(c){case"graph":break;case"node":if(C.length&&C[0].children().length&&C[0].children()[0].name==="graph"){let N=E.createSubgraph(Xs(C));o.push(N),t[d.id]=N}let A=E.createVertex(Xs(C));s[d.id]=A;break;case"edge":let P=E.createEdge(s[d.source],s[d.target],Xs(C));r[d.id]=P;break;default:}}),i}var gs=class extends Rr{},hr=class extends Cr{},fr=class extends Ar{},Sr=class extends Dr{};function ps(n){let e={},t={},s={},r;for(let i of n)switch(i.ScopeType){case"graph":r=new gs(l=>l._.Id,i),e[i.ScopeName]=r.root;break;case"subgraph":r||(r=new gs(l=>l._.Id,i),e[i.ScopeName]=r.root);let o=i.parentScope().split(":"),c=e[i.parentScope()];for(;o.length&&!c;)c=e[o.join(":")],o.pop();if(!c)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let l=c;e[i.ScopeName]=l.createSubgraph(i)}break;case"activity":let d=e[i.parentScope()];d?s[i.ScopeName]=d.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let C=s[i.parentScope()];C?C._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],c=e[o.parentScope()];if(!c)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let d=c;try{let C=r.vertex(o.attr("IdSource").RawValue),l=r.vertex(o.attr("IdTarget").RawValue);d.createEdge(C,l,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return r}import{StateObject as yo}from"@hpcc-js/util";var ds=class extends yo{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let s=t.split("\\").join("/"),r=s.split("/"),i="res/"+this.wu.Wuid+"/",o="",c="";s.indexOf(i)===0&&(o=s.substr(i.length),c=r[r.length-1]),this.set({URL:t,DisplayName:c,DisplayPath:o})}};import{Cache as Zs,exists as Ks,StateObject as xo}from"@hpcc-js/util";import{SAXStackParser as Wo,Stack as xr}from"@hpcc-js/util";var ms=class{e;constructor(e){this.e=e}fix(){delete this.e}},hs=class extends ms{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){let s=this._children[t];s.name==="Row"&&s.type===void 0&&(this._children.push(...s._children),this._children.splice(t,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}}charWidth(){let e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let t="0123456789",s=this.type.lastIndexOf("_"),r=s>0?s:this.type.length,i=r-1;for(;i>=0&&t.indexOf(this.type.charAt(i))!==-1;--i);i+1<r&&(e=parseInt(this.type.substring(i+1,r),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},fs=class extends ms{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},Ss=class{root;simpleTypes={};fields(){return this.root.children()}},Ds=class extends Wo{schema=new Ss;simpleType;simpleTypes={};xsdStack=new xr;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new hs(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(t):this.schema.root=t,this.xsdStack.push(t);break;case"xs:simpleType":this.simpleType=new fs(e);break;default:break}}endXMLNode(e){switch(e.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":let s=this.xsdStack.top();for(let r in e.$)s.attrs[r]=e.$[r];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function Js(n){let e=new Ds;return e.parse(n),e.schema}var zs=class extends Ds{_rootName;schema=new Ss;simpleTypes={};xsdStack=new xr;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new hs(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=t),this.xsdStack.depth()&&this.xsdStack.top().append(t),this.xsdStack.push(t);break;case"xsd:simpleType":this.simpleType=new fs(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function Ju(n,e){let t=new zs(e);return t.parse(n),t.schema}var $s=class extends Zs{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Rs=new $s,Cs=class n extends xo{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,s,r){let i;return Array.isArray(r)?(i=Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new n(e,t,s,r)),i.set(s)):typeof r>"u"&&(typeof s=="number"?i=Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new n(e,t,s)):typeof s=="string"&&(i=Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s)))),i}static attachLogicalFile(e,t,s){return Rs.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new n(e,t,s,!0))}constructor(e,t,s,r){super(),e instanceof ae?this.connection=e:this.connection=new ae(e),typeof r=="boolean"&&r===!0?this.set({NodeGroup:t,LogicalFileName:s}):ur(s)&&Array.isArray(r)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:r}):typeof r>"u"?typeof s=="number"?this.set({Wuid:t,ResultSequence:s}):typeof s=="string"?this.set({Wuid:t,ResultName:s}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}bypassCache(e){return e===void 0?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=Js(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,s=!1,r={},i,o){let c=o??this._bypassCache;return this.WUResult(e,t,!s,r,i,c).then(d=>{let C=d.Result;return delete d.Result,this.set({...d}),Ks("XmlSchema.xml",C)&&(this.xsdSchema=Js(C.XmlSchema.xml)),Ks("Row",C)?C.Row:this.ResultName&&Ks(this.ResultName,C)?C[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,r={},i,o=!1){let c={NamedValue:{itemcount:0}};for(let C in r)c.NamedValue[c.NamedValue.itemcount++]={Name:C,Value:r[C]};let d={FilterBy:c};return this.Wuid&&this.ResultName!==void 0?(d.Wuid=this.Wuid,d.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(d.Wuid=this.Wuid,d.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(d.LogicalName=this.LogicalFileName,d.Cluster=this.NodeGroup):this.LogicalFileName&&(d.LogicalName=this.LogicalFileName),d.Start=e,d.Count=t,d.SuppressXmlSchema=s,d.BypassCachedResult=o,this.connection.WUResult(d,i).then(C=>C)}},As=class extends Zs{constructor(){super(e=>Zs.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as br}from"@hpcc-js/util";var Ze=class extends br{scope;get properties(){return this.get()}get Name(){return this.get("Name")}get RawValue(){return this.get("RawValue")}get Formatted(){return this.get("Formatted")}get FormattedEnd(){return this.get("FormattedEnd")}get Measure(){return this.get("Measure")}get Creator(){return this.get("Creator")}get CreatorType(){return this.get("CreatorType")}constructor(e,t){super(),this.scope=e,this.set(t)}},en=class extends br{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(s=>{s.Measure==="ts"&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&s.Measure==="ts"&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new Ze(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Ze(this,t.start))):t.start?e.push(new Ze(this,t.start)):t.end&&e.push(new Ze(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(t=>{this._attributeMap[t.Name]=t}),this.Properties.Property=[];for(let t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){let e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(let t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new Ze(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t=this.Id,s=[];s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let r=this.formattedAttrs();for(let i in r)i==="Label"?t=r[i]:s.push(`<tr><td class="key">${i}</td><td class="value">${r[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
910
+ `;var Uc="__PACKAGE_NAME__",Ec="__PACKAGE_VERSION__",Fc="__BUILD_VERSION__";import{join as ve}from"@hpcc-js/util";import{join as ls,promiseTimeout as ai,root as ke,scopedLogger as ci,utf8ToBase64 as ui}from"@hpcc-js/util";var ur=ci("comms/connection.ts");function Tc(s){return"baseUrl"in s}var li={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function Mc(s){return typeof s.opts=="function"&&typeof s.send=="function"&&typeof s.clone=="function"}function K(s,e){return e===void 0||e===!0?encodeURIComponent(s):""+s}function le(s,e=!0,t=""){if(t&&(t+="."),typeof s!="object")return K(s,e);let r=[];for(let n in s)if(s.hasOwnProperty(n))if(s[n]instanceof Array){let i=!1;s[n].forEach((o,a)=>{typeof o=="object"?(i=!0,r.push(le(o,e,t+K(`${n}.${a}`,e)))):r.push(t+K(`${n}_i${a}`,e)+"="+le(o,e))}),i&&r.push(t+K(`${n}.itemcount`,e)+"="+s[n].length)}else typeof s[n]=="object"?s[n]&&s[n].Item instanceof Array?(r.push(le(s[n].Item,e,t+K(n,e))),r.push(t+K(`${n}.itemcount`,e)+"="+s[n].Item.length)):r.push(le(s[n],e,t+K(n,e))):s[n]!==void 0?r.push(t+K(n,e)+"="+K(s[n],e)):r.push(t+K(n,e));return r.join("&")}function pi(s){return JSON.parse(s)}function gi(s,e,t={},r="json",n){return n&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let a=s.timeoutSecs*1e3,c=5e3,l="jsonp_callback_"+Math.round(Math.random()*999999);window[l]=function(D){a=0,f(),i(r==="json"&&typeof D=="string"?pi(D):D)};let u=document.createElement("script"),g=ls(s.baseUrl,e);g+=g.indexOf("?")>=0?"&":"?",u.src=g+"jsonp="+l+"&"+le(t,s.encodeRequest),document.body.appendChild(u);let p=setInterval(function(){a<=0?clearInterval(p):(a-=c,a<=0?(clearInterval(p),ur.error("Request timeout: "+u.src),f(),o(Error("Request timeout: "+u.src))):ur.debug("Request pending ("+a/1e3+" sec): "+u.src))},c);function f(){delete window[l],document.body.removeChild(u)}})}function di(s){return s.userID?{Authorization:`Basic ${ui(`${s.userID}:${s.password}`)}`}:{}}var ut={};function lr(s,e,t,r,n){r={...di(s),...r},t={credentials:ut[s.baseUrl]?"omit":"include",...t,headers:r},s.baseUrl.indexOf("https:")===0&&(s.rejectUnauthorized===!1&&ke.__hpcc_rejectUnauthorizedAgent?t.dispatcher=ke.__hpcc_rejectUnauthorizedAgent:ke.__hpcc_trustwaveAgent&&(t.agent=ke.__hpcc_trustwaveAgent));function i(a){if(a.ok)switch(n){case"json":return a.json();case"arraybuffer":return a.arrayBuffer();default:return a.text()}throw new Error(a.statusText)}let o=ke.__hpcc_undiciFetch??fetch;return ai(s.timeoutSecs*1e3,o(ls(s.baseUrl,e),t).then(i).catch(a=>(t.credentials=ut[s.baseUrl]?"include":"omit",o(ls(s.baseUrl,e),t).then(i).then(c=>(ut[s.baseUrl]=!ut[s.baseUrl],c)))))}function mi(s,e,t,r="json",n){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),lr(s,e,{method:"post",body:le(t,s.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...n},r)}function hi(s,e,t,r="json",n){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),lr(s,`${e}?${le(t,s.encodeRequest)}`,{method:"get",signal:i},{...n},r)}function fi(s,e,t,r="json",n){let i;switch(s.type){case"jsonp":i=gi(s,e,t,r,n);break;case"get":i=hi(s,e,t,r,n);break;default:i=mi(s,e,t,r,n);break}return i}var lt=fi;function wc(s){let e=lt;return s&&(lt=s),e}var ps=class s{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...li,...e},this)}send(e,t,r="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,r,lt,n):lt(this._opts,e,t,r,n)}clone(){return new s(this.opts())}},pt=function(s){return new ps(s)};function Bc(s){let e=pt;return pt=s,e}function Si(s){return Object.prototype.toString.call(s)==="[object Array]"}var pe=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,r){super("ESPException: "+r.Source),this.action=e,this.request=t,this.Source=r.Source,this.Exception=r.Exception,r.Exception.length?this.message=`${r.Exception[0].Code}: ${r.Exception[0].Message}`:this.message=""}};function Vc(s){return s instanceof pe||s.isESPExceptions&&Array.isArray(s.Exception)}function Di(s){return s.send!==void 0}var gs=class s{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,r){this._connection=Di(e)?e:pt(e),this._service=t,this._version=r}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,t){if(Si(e[t])){for(let r=0;r<e[t].length;++r)e[t+"_i"+r]=e[t][r];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},r="json",n=!1,i,o){let a={...t,ver_:this._version};n&&(a.upload_=!0),i&&(a.abortSignal_=i);let c,l="json";switch(r){case"text":c=ve(this._service,e),l="text";break;case"arraybuffer":c=ve(this._service,e+".json"),l="arraybuffer";break;case"xsd":c=ve(this._service,e+".xsd"),l="text";break;case"json2":c=ve(this._service,e+"/json"),r="json",e=e.split("/").pop();break;default:c=ve(this._service,e+".json")}return this._connection.send(c,a,l).then(u=>{if(r==="json"){let g;if(u&&u.Exceptions)throw new pe(e,a,u.Exceptions);if(u&&(g=u[o||e+"Response"]),!g)throw new pe(e,a,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return g}return u})}clone(){return new s(this._connection.clone(),this._service,this._version)}},x=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,r){this._connection=new gs(e,t,r)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var Ve;(t=>{let s;(l=>(l.Delete="Delete",l.Protect="Protect",l.Unprotect="Unprotect",l.Restore="Restore",l.SetToFailed="SetToFailed",l.Archive="Archive"))(s=t.DFUWUActions||={});let e;(D=>(D.copy="copy",D.remove="remove",D.move="move",D.rename="rename",D.replicate="replicate",D.import="import",D.export="export",D.monitor="monitor",D.copymerge="copymerge",D.supercopy="supercopy",D.publish="publish"))(e=t.DFUCommand||={})})(Ve||={});var gt=class extends x{constructor(e){super(e,"FileSpray","1.29")}AbortDFUWorkunit(e,t){return this._connection.send("AbortDFUWorkunit",e,"json",!1,t,"AbortDFUWorkunitResponse")}Copy(e,t){return this._connection.send("Copy",e,"json",!1,t,"CopyResponse")}CreateDFUPublisherWorkunit(e,t){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,t,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e,t){return this._connection.send("CreateDFUWorkunit",e,"json",!1,t,"CreateDFUWorkunitResponse")}DFUWUFile(e,t){return this._connection.send("DFUWUFile",e,"json",!1,t,"DFUWUFileResponse")}DFUWUSearch(e,t){return this._connection.send("DFUWUSearch",e,"json",!1,t,"DFUWUSearchResponse")}DFUWorkunitsAction(e,t){return this._connection.send("DFUWorkunitsAction",e,"json",!1,t,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e,t){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,t,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e,t){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,t,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e,t){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,t,"DFUWorkunitsActionResponse")}Despray(e,t){return this._connection.send("Despray",e,"json",!1,t,"DesprayResponse")}DfuMonitor(e,t){return this._connection.send("DfuMonitor",e,"json",!1,t,"DfuMonitorResponse")}DropZoneFileSearch(e,t){return this._connection.send("DropZoneFileSearch",e,"json",!1,t,"DropZoneFileSearchResponse")}DropZoneFiles(e,t){return this._connection.send("DropZoneFiles",e,"json",!1,t,"DropZoneFilesResponse")}EchoDateTime(e,t){return this._connection.send("EchoDateTime",e,"json",!1,t,"EchoDateTimeResponse")}FileList(e,t){return this._connection.send("FileList",e,"json",!1,t,"FileListResponse")}GetDFUExceptions(e,t){return this._connection.send("GetDFUExceptions",e,"json",!1,t,"GetDFUExceptionsResponse")}GetDFUProgress(e,t){return this._connection.send("GetDFUProgress",e,"json",!1,t,"ProgressResponse")}GetDFUServerQueues(e,t){return this._connection.send("GetDFUServerQueues",e,"json",!1,t,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e,t){return this._connection.send("GetDFUWorkunit",e,"json",!1,t,"GetDFUWorkunitResponse")}GetDFUWorkunits(e,t){return this._connection.send("GetDFUWorkunits",e,"json",!1,t,"GetDFUWorkunitsResponse")}GetRemoteTargets(e,t){return this._connection.send("GetRemoteTargets",e,"json",!1,t,"GetRemoteTargetsResponse")}GetSprayTargets(e,t){return this._connection.send("GetSprayTargets",e,"json",!1,t,"GetSprayTargetsResponse")}OpenSave(e,t){return this._connection.send("OpenSave",e,"json",!1,t,"OpenSaveResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"FileSprayPingResponse")}Rename(e,t){return this._connection.send("Rename",e,"json",!1,t,"RenameResponse")}Replicate(e,t){return this._connection.send("Replicate",e,"json",!1,t,"ReplicateResponse")}ShowResult(e,t){return this._connection.send("ShowResult",e,"json",!1,t,"ShowResultResponse")}SprayFixed(e,t){return this._connection.send("SprayFixed",e,"json",!1,t,"SprayFixedResponse")}SprayVariable(e,t){return this._connection.send("SprayVariable",e,"json",!1,t,"SprayResponse")}SubmitDFUWorkunit(e,t){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,t,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e,t){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,t,"UpdateDFUWorkunitResponse")}};var Ri=(u=>(u[u.unknown=0]="unknown",u[u.scheduled=1]="scheduled",u[u.queued=2]="queued",u[u.started=3]="started",u[u.aborted=4]="aborted",u[u.failed=5]="failed",u[u.finished=6]="finished",u[u.monitoring=7]="monitoring",u[u.aborting=8]="aborting",u[u.notfound=999]="notfound",u))(Ri||{}),ge=class extends gt{DFUWUFileEx(e){return this._connection.send("DFUWUFile",e,"text")}SprayFixedEx(e){return this._connection.send("SprayFixed",e)}SprayVariableEx(e){return this._connection.send("SprayVariable",e,"json",!1,null,"SprayResponse")}DesprayEx(e){return this._connection.send("Despray",e)}UpdateDFUWorkunitEx(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};var pr;(o=>{let s;(l=>(l.User="User",l.Group="Group"))(s=o.ViewMemberType||={});let e;(p=>(p.username="username",p.fullname="fullname",p.passwordexpiration="passwordexpiration",p.employeeID="employeeID",p.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(l=>(l.Name="Name",l.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let r;(u=>(u.Any="Any",u.User="User",u.Group="Group"))(r=o.AccountTypeReq||={});let n;(l=>(l.Name="Name",l.Type="Type"))(n=o.ResourcePermissionSortBy||={});let i;(c=>c.Name="Name")(i=o.ResourceSortBy||={})})(pr||={});var dt=class extends x{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e,t){return this._connection.send("AccountPermissions",e,"json",!1,t,"AccountPermissionsResponse")}AccountPermissionsV2(e,t){return this._connection.send("AccountPermissionsV2",e,"json",!1,t,"AccountPermissionsV2Response")}AddUser(e,t){return this._connection.send("AddUser",e,"json",!1,t,"AddUserResponse")}AddView(e,t){return this._connection.send("AddView",e,"json",!1,t,"AddViewResponse")}AddViewColumn(e,t){return this._connection.send("AddViewColumn",e,"json",!1,t,"AddViewColumnResponse")}AddViewMember(e,t){return this._connection.send("AddViewMember",e,"json",!1,t,"AddViewMemberResponse")}ClearPermissionsCache(e,t){return this._connection.send("ClearPermissionsCache",e,"json",!1,t,"ClearPermissionsCacheResponse")}DeleteView(e,t){return this._connection.send("DeleteView",e,"json",!1,t,"DeleteViewResponse")}DeleteViewColumn(e,t){return this._connection.send("DeleteViewColumn",e,"json",!1,t,"DeleteViewColumnResponse")}DeleteViewMember(e,t){return this._connection.send("DeleteViewMember",e,"json",!1,t,"DeleteViewMemberResponse")}DisableScopeScans(e,t){return this._connection.send("DisableScopeScans",e,"json",!1,t,"DisableScopeScansResponse")}EnableScopeScans(e,t){return this._connection.send("EnableScopeScans",e,"json",!1,t,"EnableScopeScansResponse")}FilePermission(e,t){return this._connection.send("FilePermission",e,"json",!1,t,"FilePermissionResponse")}GroupAction(e,t){return this._connection.send("GroupAction",e,"json",!1,t,"GroupActionResponse")}GroupAdd(e,t){return this._connection.send("GroupAdd",e,"json",!1,t,"GroupAddResponse")}GroupEdit(e,t){return this._connection.send("GroupEdit",e,"json",!1,t,"GroupEditResponse")}GroupMemberEdit(e,t){return this._connection.send("GroupMemberEdit",e,"json",!1,t,"GroupMemberEditResponse")}GroupMemberEditInput(e,t){return this._connection.send("GroupMemberEditInput",e,"json",!1,t,"GroupMemberEditInputResponse")}GroupMemberQuery(e,t){return this._connection.send("GroupMemberQuery",e,"json",!1,t,"GroupMemberQueryResponse")}GroupQuery(e,t){return this._connection.send("GroupQuery",e,"json",!1,t,"GroupQueryResponse")}Groups(e,t){return this._connection.send("Groups",e,"json",!1,t,"GroupResponse")}PermissionAction(e,t){return this._connection.send("PermissionAction",e,"json",!1,t,"PermissionActionResponse")}Permissions(e,t){return this._connection.send("Permissions",e,"json",!1,t,"BasednsResponse")}PermissionsReset(e,t){return this._connection.send("PermissionsReset",e,"json",!1,t,"PermissionsResetResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accessPingResponse")}QueryScopeScansEnabled(e,t){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,t,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e,t){return this._connection.send("QueryUserViewColumns",e,"json",!1,t,"QueryUserViewColumnsResponse")}QueryViewColumns(e,t){return this._connection.send("QueryViewColumns",e,"json",!1,t,"QueryViewColumnsResponse")}QueryViewMembers(e,t){return this._connection.send("QueryViewMembers",e,"json",!1,t,"QueryViewMembersResponse")}QueryViews(e,t){return this._connection.send("QueryViews",e,"json",!1,t,"QueryViewsResponse")}ResourceAdd(e,t){return this._connection.send("ResourceAdd",e,"json",!1,t,"ResourceAddResponse")}ResourceDelete(e,t){return this._connection.send("ResourceDelete",e,"json",!1,t,"ResourceDeleteResponse")}ResourcePermissionQuery(e,t){return this._connection.send("ResourcePermissionQuery",e,"json",!1,t,"ResourcePermissionQueryResponse")}ResourcePermissions(e,t){return this._connection.send("ResourcePermissions",e,"json",!1,t,"ResourcePermissionsResponse")}ResourceQuery(e,t){return this._connection.send("ResourceQuery",e,"json",!1,t,"ResourceQueryResponse")}Resources(e,t){return this._connection.send("Resources",e,"json",!1,t,"ResourcesResponse")}UserAccountExport(e,t){return this._connection.send("UserAccountExport",e,"json",!1,t,"UserAccountExportResponse")}UserAction(e,t){return this._connection.send("UserAction",e,"json",!1,t,"UserActionResponse")}UserEdit(e,t){return this._connection.send("UserEdit",e,"json",!1,t,"UserEditResponse")}UserGroupEdit(e,t){return this._connection.send("UserGroupEdit",e,"json",!1,t,"UserGroupEditResponse")}UserGroupEditInput(e,t){return this._connection.send("UserGroupEditInput",e,"json",!1,t,"UserGroupEditInputResponse")}UserInfoEdit(e,t){return this._connection.send("UserInfoEdit",e,"json",!1,t,"UserInfoEditResponse")}UserInfoEditInput(e,t){return this._connection.send("UserInfoEditInput",e,"json",!1,t,"UserInfoEditInputResponse")}UserPosix(e,t){return this._connection.send("UserPosix",e,"json",!1,t,"UserPosixResponse")}UserPosixInput(e,t){return this._connection.send("UserPosixInput",e,"json",!1,t,"UserPosixInputResponse")}UserQuery(e,t){return this._connection.send("UserQuery",e,"json",!1,t,"UserQueryResponse")}UserResetPass(e,t){return this._connection.send("UserResetPass",e,"json",!1,t,"UserResetPassResponse")}UserResetPassInput(e,t){return this._connection.send("UserResetPassInput",e,"json",!1,t,"UserResetPassInputResponse")}UserSudoers(e,t){return this._connection.send("UserSudoers",e,"json",!1,t,"UserSudoersResponse")}UserSudoersInput(e,t){return this._connection.send("UserSudoersInput",e,"json",!1,t,"UserSudoersInputResponse")}Users(e,t){return this._connection.send("Users",e,"json",!1,t,"UserResponse")}};var gr=class extends dt{};var mt=class extends x{constructor(e){super(e,"ws_account","1.07")}MyAccount(e,t){return this._connection.send("MyAccount",e,"json",!1,t,"MyAccountResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_accountPingResponse")}UpdateUser(e,t){return this._connection.send("UpdateUser",e,"json",!1,t,"UpdateUserResponse")}UpdateUserInput(e,t){return this._connection.send("UpdateUserInput",e,"json",!1,t,"UpdateUserInputResponse")}VerifyUser(e,t){return this._connection.send("VerifyUser",e,"json",!1,t,"VerifyUserResponse")}};var dr=class extends mt{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(r=>r.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};import{scopedLogger as Ci}from"@hpcc-js/util";var ht=class extends x{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e,t){return this._connection.send("GetPODs",e,"json",!1,t,"GetPODsResponse")}GetServices(e,t){return this._connection.send("GetServices",e,"json",!1,t,"GetServicesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsCloudPingResponse")}};var xi=Ci("@hpcc-js/comms/services/wsCloud.ts");function Ai(s){return s?.Pods!==void 0}function Wi(s){return s.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(r=>{e.push({ContainerPort:r.containerPort,Name:r.name,Protocol:r.protocol})}),e),[])??[]}function yi(s){return s.filter(e=>{let t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&t["app.kubernetes.io/part-of"]==="HPCC-Platform"}).map(e=>{let t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((r,n)=>(n.name&&r.push(n.name),r),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((r,n)=>r+(n.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((r,n)=>r+n.restartCount,0),Ports:{Port:Wi(e)}}})}var mr=class extends ht{getPODs(){return super.GetPODs({}).then(e=>{if(Ai(e))return e.Pods?.Pod??[];try{let t=typeof e.Result=="string"?JSON.parse(e.Result):e.Result;return yi(t?.items??[])}catch(t){return xi.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};var ds;(e=>{let s;(r=>r.gpg="gpg")(s=e.SigningMethodType||={})})(ds||={});var ft=class extends x{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e,t){return this._connection.send("ListUserIDs",e,"json",!1,t,"ListUserIDsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_codesignPingResponse")}Sign(e,t){return this._connection.send("Sign",e,"json",!1,t,"SignResponse")}Verify(e,t){return this._connection.send("Verify",e,"json",!1,t,"VerifyResponse")}};var hr=class extends ft{ListUserIDsEx(e){return super.ListUserIDs(e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return super.Sign({SigningMethod:ds.SigningMethodType.gpg,...e})}};var St=class extends x{constructor(e){super(e,"WSDali","1.07")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"ResultResponse")}ClearTraceTransactions(e,t){return this._connection.send("ClearTraceTransactions",e,"json",!1,t,"ResultResponse")}Count(e,t){return this._connection.send("Count",e,"json",!1,t,"CountResponse")}DFSCheck(e,t){return this._connection.send("DFSCheck",e,"json",!1,t,"ResultResponse")}DFSExists(e,t){return this._connection.send("DFSExists",e,"json",!1,t,"BooleanResponse")}DFSLS(e,t){return this._connection.send("DFSLS",e,"json",!1,t,"ResultResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"ResultResponse")}DisconnectClientConnection(e,t){return this._connection.send("DisconnectClientConnection",e,"json",!1,t,"ResultResponse")}GetClients(e,t){return this._connection.send("GetClients",e,"json",!1,t,"ResultResponse")}GetConnections(e,t){return this._connection.send("GetConnections",e,"json",!1,t,"ResultResponse")}GetDFSCSV(e,t){return this._connection.send("GetDFSCSV",e,"json",!1,t,"ResultResponse")}GetDFSMap(e,t){return this._connection.send("GetDFSMap",e,"json",!1,t,"ResultResponse")}GetDFSParents(e,t){return this._connection.send("GetDFSParents",e,"json",!1,t,"ResultResponse")}GetLogicalFile(e,t){return this._connection.send("GetLogicalFile",e,"json",!1,t,"ResultResponse")}GetLogicalFilePart(e,t){return this._connection.send("GetLogicalFilePart",e,"json",!1,t,"ResultResponse")}GetProtectedList(e,t){return this._connection.send("GetProtectedList",e,"json",!1,t,"ResultResponse")}GetSDSStats(e,t){return this._connection.send("GetSDSStats",e,"json",!1,t,"ResultResponse")}GetSDSSubscribers(e,t){return this._connection.send("GetSDSSubscribers",e,"json",!1,t,"ResultResponse")}GetValue(e,t){return this._connection.send("GetValue",e,"json",!1,t,"ResultResponse")}Import(e,t){return this._connection.send("Import",e,"json",!1,t,"ResultResponse")}ListSDSLocks(e,t){return this._connection.send("ListSDSLocks",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSDaliPingResponse")}SaveSDSStore(e,t){return this._connection.send("SaveSDSStore",e,"json",!1,t,"ResultResponse")}SetLogicalFilePartAttr(e,t){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,t,"ResultResponse")}SetProtected(e,t){return this._connection.send("SetProtected",e,"json",!1,t,"ResultResponse")}SetTraceSlowTransactions(e,t){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,t,"ResultResponse")}SetTraceTransactions(e,t){return this._connection.send("SetTraceTransactions",e,"json",!1,t,"ResultResponse")}SetUnprotected(e,t){return this._connection.send("SetUnprotected",e,"json",!1,t,"ResultResponse")}SetValue(e,t){return this._connection.send("SetValue",e,"json",!1,t,"ResultResponse")}UnlockSDSLock(e,t){return this._connection.send("UnlockSDSLock",e,"json",!1,t,"ResultResponse")}};var fr=class extends St{};var Ue;(a=>{let s;(p=>(p.Delete="Delete",p.AddToSuperfile="Add To Superfile",p.ChangeProtection="Change Protection",p.ChangeRestriction="Change Restriction"))(s=a.DFUArrayActions||={});let e;(p=>(p[p.NoChange=0]="NoChange",p[p.Protect=1]="Protect",p[p.Unprotect=2]="Unprotect",p[p.UnprotectAll=3]="UnprotectAll"))(e=a.DFUChangeProtection||={});let t;(g=>(g[g.NoChange=0]="NoChange",g[g.Restrict=1]="Restrict",g[g.Unrestricted=2]="Unrestricted"))(t=a.DFUChangeRestriction||={});let r;(u=>(u.xml="xml",u.def="def"))(r=a.DFUDefFileFormat||={});let n;(g=>(g.Token="Token",g.Engine="Engine",g.External="External"))(n=a.FileAccessRole||={});let i;(f=>(f.None="None",f.Access="Access",f.Read="Read",f.Write="Write",f.Full="Full"))(i=a.SecAccessType||={});let o;(b=>(b.Flat="Flat",b.Index="Index",b.Xml="Xml",b.Csv="Csv",b.Json="Json",b.IndexLocal="IndexLocal",b.IndexPartitioned="IndexPartitioned",b.Unset="Unset"))(o=a.DFUFileType||={})})(Ue||={});var Dt=class extends x{constructor(e){super(e,"WsDfu","1.68")}Add(e,t){return this._connection.send("Add",e,"json",!1,t,"AddResponse")}AddRemote(e,t){return this._connection.send("AddRemote",e,"json",!1,t,"AddRemoteResponse")}AddtoSuperfile(e,t){return this._connection.send("AddtoSuperfile",e,"json",!1,t,"AddtoSuperfileResponse")}DFUArrayAction(e,t){return this._connection.send("DFUArrayAction",e,"json",!1,t,"DFUArrayActionResponse")}DFUBrowseData(e,t){return this._connection.send("DFUBrowseData",e,"json",!1,t,"DFUBrowseDataResponse")}DFUDefFile(e,t){return this._connection.send("DFUDefFile",e,"json",!1,t,"DFUDefFileResponse")}DFUFileAccess(e,t){return this._connection.send("DFUFileAccess",e,"json",!1,t,"DFUFileAccessResponse")}DFUFileAccessV2(e,t){return this._connection.send("DFUFileAccessV2",e,"json",!1,t,"DFUFileAccessResponse")}DFUFileCreate(e,t){return this._connection.send("DFUFileCreate",e,"json",!1,t,"DFUFileCreateResponse")}DFUFileCreateV2(e,t){return this._connection.send("DFUFileCreateV2",e,"json",!1,t,"DFUFileCreateResponse")}DFUFilePublish(e,t){return this._connection.send("DFUFilePublish",e,"json",!1,t,"DFUFilePublishResponse")}DFUFileRename(e,t){return this._connection.send("DFUFileRename",e,"json",!1,t,"DFUFileRenameResponse")}DFUFileView(e,t){return this._connection.send("DFUFileView",e,"json",!1,t,"DFUFileViewResponse")}DFUGetDataColumns(e,t){return this._connection.send("DFUGetDataColumns",e,"json",!1,t,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e,t){return this._connection.send("DFUGetFileMetaData",e,"json",!1,t,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e,t){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,t,"DFUMetaInquiryResponse")}DFUInfo(e,t){return this._connection.send("DFUInfo",e,"json",!1,t,"DFUInfoResponse")}DFUQuery(e,t){return this._connection.send("DFUQuery",e,"json",!1,t,"DFUQueryResponse")}DFURecordTypeInfo(e,t){return this._connection.send("DFURecordTypeInfo",e,"json",!1,t,"DFURecordTypeInfoResponse")}DFUSearch(e,t){return this._connection.send("DFUSearch",e,"json",!1,t,"DFUSearchResponse")}DFUSearchData(e,t){return this._connection.send("DFUSearchData",e,"json",!1,t,"DFUSearchDataResponse")}DFUSpace(e,t){return this._connection.send("DFUSpace",e,"json",!1,t,"DFUSpaceResponse")}EclRecordTypeInfo(e,t){return this._connection.send("EclRecordTypeInfo",e,"json",!1,t,"EclRecordTypeInfoResponse")}EraseHistory(e,t){return this._connection.send("EraseHistory",e,"json",!1,t,"EraseHistoryResponse")}ListHistory(e,t){return this._connection.send("ListHistory",e,"json",!1,t,"ListHistoryResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDfuPingResponse")}Savexml(e,t){return this._connection.send("Savexml",e,"json",!1,t,"SavexmlResponse")}SuperfileAction(e,t){return this._connection.send("SuperfileAction",e,"json",!1,t,"SuperfileActionResponse")}SuperfileList(e,t){return this._connection.send("SuperfileList",e,"json",!1,t,"SuperfileListResponse")}};var Cu=Ue.DFUArrayActions,xu=Ue.DFUDefFileFormat,Au=Ue.DFUChangeProtection,Wu=Ue.DFUChangeRestriction,He=class extends Dt{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){let t=[],r=[];return await Promise.all(e.map(n=>this.DFUInfo({Cluster:n.NodeGroup,Name:n.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(i=>{for(let o of i?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(o);for(let o of i?.FileDetail?.subfiles?.Item??[])r.push(o)}))),r.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};var Rt=class extends x{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e,t){return this._connection.send("DFUXRefArrayAction",e,"json",!1,t,"DFUXRefArrayActionResponse")}DFUXRefBuild(e,t){return this._connection.send("DFUXRefBuild",e,"json",!1,t,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e,t){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,t,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e,t){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,t,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e,t){return this._connection.send("DFUXRefDirectories",e,"json",!1,t,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e,t){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,t,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e,t){return this._connection.send("DFUXRefList",e,"json",!1,t,"DFUXRefListResponse")}DFUXRefLostFiles(e,t){return this._connection.send("DFUXRefLostFiles",e,"json",!1,t,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e,t){return this._connection.send("DFUXRefMessages",e,"json",!1,t,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e,t){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,t,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e,t){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,t,"DFUXRefUnusedFilesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsDFUXRefPingResponse")}};var Sr=class extends Rt{DFUXRefDirectoriesEx(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefListEx(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}};function Dr(s,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:s,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:s,type:"dataset",children:ms(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let r=typeof e.Item[0];if(r==="string"||r==="number")return{id:s,type:"set",fieldType:r};throw new Error("Unknown field type")}return{id:s,type:"object",fields:bi(e)}}default:throw new Error("Unknown field type")}}function ms(s){s.Row&&s.Row instanceof Array&&(s=s.Row[0]);let e=[];for(let t in s)e.push(Dr(t,s[t]));return e}function bi(s){let e={};for(let t in s)e[t]=Dr(t,s[t]);return e}var Ct=class extends x{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(r=>{let n=JSON.parse(r);for(let i in n)return n[i];return{}}).then(ms)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(r=>{let n=JSON.parse(r);for(let i in n)return n[i].Results;return{}}).then(r=>{let n={};for(let i in r)n[i]=ms(r[i]);return n})}submit(e,t,r){let n=`submit/query/${e}/${t}`;return this._connection.send(n,r,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new pe(n,r,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var xt=class extends x{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e,t){return this._connection.send("GetConfigDetails",e,"json",!1,t,"GetConfigDetailsResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_elkPingResponse")}};var Rr=class extends xt{};import{scopedLogger as Ui}from"@hpcc-js/util";var N;(c=>{let s;(T=>(T.global="global",T.workunits="workunits",T.components="components",T.audience="audience",T.class="class",T.instance="instance",T.node="node",T.message="message",T.logid="logid",T.processid="processid",T.threadid="threadid",T.timestamp="timestamp",T.pod="pod",T.traceid="traceid",T.spanid="spanid"))(s=c.LogColumnType||={});let e;(D=>(D.string="string",D.numeric="numeric",D.datetime="datetime",D.enum="enum",D.epoch="epoch"))(e=c.LogColumnValueType||={});let t;(m=>(m[m.All=0]="All",m[m.ByJobID=1]="ByJobID",m[m.ByComponent=2]="ByComponent",m[m.ByLogType=3]="ByLogType",m[m.ByTargetAudience=4]="ByTargetAudience",m[m.BySourceInstance=5]="BySourceInstance",m[m.BySourceNode=6]="BySourceNode",m[m.ByFieldName=7]="ByFieldName",m[m.ByPod=8]="ByPod",m[m.ByTraceID=9]="ByTraceID",m[m.BySpanID=10]="BySpanID"))(t=c.LogAccessType||={});let r;(p=>(p[p.Success=0]="Success",p[p.Warning=1]="Warning",p[p.Fail=2]="Fail"))(r=c.LogAccessStatusCode||={});let n;(p=>(p[p.NONE=0]="NONE",p[p.AND=1]="AND",p[p.OR=2]="OR"))(n=c.LogAccessFilterOperator||={});let i;(f=>(f[f.MIN=0]="MIN",f[f.DEFAULT=1]="DEFAULT",f[f.ALL=2]="ALL",f[f.CUSTOM=3]="CUSTOM"))(i=c.LogSelectColumnMode||={});let o;(m=>(m[m.ByDate=0]="ByDate",m[m.ByJobID=1]="ByJobID",m[m.ByComponent=2]="ByComponent",m[m.ByLogType=3]="ByLogType",m[m.ByTargetAudience=4]="ByTargetAudience",m[m.BySourceInstance=5]="BySourceInstance",m[m.BySourceNode=6]="BySourceNode",m[m.ByFieldName=7]="ByFieldName",m[m.ByPod=8]="ByPod",m[m.ByTraceID=9]="ByTraceID",m[m.BySpanID=10]="BySpanID"))(o=c.SortColumType||={});let a;(g=>(g[g.ASC=0]="ASC",g[g.DSC=1]="DSC"))(a=c.SortDirection||={})})(N||={});var At=class extends x{constructor(e){super(e,"ws_logaccess","1.08")}GetHealthReport(e){return this._connection.send("GetHealthReport",e,"json",!1,void 0,"GetHealthReportResponse")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}};var Cr=Ui("@hpcc-js/comms/services/wsLogaccess.ts");var Ei=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(Ei||{}),Fi=(n=>(n.Operator="OPR",n.User="USR",n.Programmer="PRO",n.Audit="ADT",n))(Fi||{}),Ii=new Set(["azureloganalyticscurl","elasticstack","grafanacurl"]),Pi=new Set(Object.values(N.LogColumnType));function Ti(s){switch(s){case N.LogColumnType.workunits:case"hpcc.log.jobid":return N.LogAccessType.ByJobID;case N.LogColumnType.audience:case"hpcc.log.audience":return N.LogAccessType.ByTargetAudience;case N.LogColumnType.class:case"hpcc.log.class":return N.LogAccessType.ByLogType;case N.LogColumnType.components:case"kubernetes.container.name":return N.LogAccessType.ByComponent;default:return N.LogAccessType.ByFieldName}}var Mi=["audience","class","workunits","message","processid","logid","threadid","timestamp","components","instance"];function wi(s,e){let t=[];for(let r of Mi){let n=s[r];if(n==null||n===""||Array.isArray(n)&&n.length===0||!(r in e))continue;let o=Pi.has(r)?r:e[r],a=Ti(o);a===N.LogAccessType.ByFieldName&&(o=e[r]);let c=a===N.LogAccessType.ByComponent,l=Array.isArray(n)?n:[n];for(let u of l)t.push({LogCategory:a,SearchField:o,SearchByValue:c?u+"*":u})}return t}function Wt(s){let e={leftFilter:s[0]},t=e;for(let r=1;r<s.length;r++)t.Operator=N.LogAccessFilterOperator.OR,r===s.length-1?t.rightFilter=s[r]:(t.rightBinaryFilter={BinaryLogFilter:[{leftFilter:s[r]}]},t=t.rightBinaryFilter.BinaryLogFilter[0]);return e}function Ar(s){let[e,...t]=s,r={};if(e.length===1?r.leftFilter=e[0]:r.leftBinaryFilter={BinaryLogFilter:[Wt(e)]},t.length===0)return r;if(r.Operator=N.LogAccessFilterOperator.AND,t.length===1){let[n]=t;n.length===1?r.rightFilter=n[0]:r.rightBinaryFilter={BinaryLogFilter:[Wt(n)]}}else r.rightBinaryFilter={BinaryLogFilter:[Ar(t)]};return r}function Bi(s){let e=new Map;for(let o of s){let a=e.get(o.SearchField);a?a.push(o):e.set(o.SearchField,[o])}let t=[...e.values()];if(t.length===0)return{leftFilter:{LogCategory:N.LogAccessType.All}};let[r,...n]=t,i={};if(r.length===1?i.leftFilter=r[0]:i.leftBinaryFilter={BinaryLogFilter:[Wt(r)]},n.length===0)return i;if(i.Operator=N.LogAccessFilterOperator.AND,n.length===1){let[o]=n;o.length===1?i.rightFilter=o[0]:i.rightBinaryFilter={BinaryLogFilter:[Wt(o)]}}else i.rightBinaryFilter={BinaryLogFilter:[Ar(n)]};return i}var xr=class extends At{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}convertLogLine(e,t){let r={},n=t?.fields?Object.assign({},...t.fields):null;for(let i in e)r[i]=n?n[e[i]]??"":"";return r}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),r={};t.Columns.Column.forEach(a=>r[a.LogType]=a.Name);let n=wi(e,r),i={StartDate:e.StartDate instanceof Date?e.StartDate.toISOString():new Date(0).toISOString()};e.EndDate instanceof Date&&(i.EndDate=e.EndDate.toISOString());let o={Filter:Bi(n),Range:i,LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:N.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:N.SortColumType.ByDate,ColumnName:"",Direction:0}]}};return this.GetLogs(o).then(a=>{try{let c=JSON.parse(a.LogLines);return{lines:Ii.has(t.RemoteLogManagerType)?c.lines?.map(u=>this.convertLogLine(r,u))??[]:(Cr.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),[]),total:a.TotalLogLinesAvailable??1e4}}catch(c){Cr.error(c.message??c)}return{lines:[],total:0}})}};import{exists as Qi}from"@hpcc-js/util";function Ee(s,e){let t;if(e===void 0)for(let r of s)r!=null&&(t<r||t===void 0&&r>=r)&&(t=r);else{let r=-1;for(let n of s)(n=e(n,++r,s))!=null&&(t<n||t===void 0&&n>=n)&&(t=n)}return t}function Fe(s,e){let t=0,r=0;if(e===void 0)for(let n of s)n!=null&&(n=+n)>=n&&(++t,r+=n);else{let n=-1;for(let i of s)(i=e(i,++n,s))!=null&&(i=+i)>=i&&(++t,r+=i)}if(t)return r/t}var Ni;(t=>{let s;(i=>(i[i.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",i[i.THRESHOLD_MB=1]="THRESHOLD_MB"))(s=t.ThresholdType||={});let e;(f=>(f.ALLNODES="ALLNODES",f.THORMACHINES="THORMACHINES",f.HOLEMACHINES="HOLEMACHINES",f.ROXIEMACHINES="ROXIEMACHINES",f.MACHINES="MACHINES",f.AVAILABLEMACHINES="AVAILABLEMACHINES",f.DROPZONE="DROPZONE",f.STANDBYNNODE="STANDBYNNODE",f.THORSPARENODES="THORSPARENODES",f.HOLESTANDBYNODES="HOLESTANDBYNODES"))(e=t.TpMachineType||={})})(Ni||={});var yt=class extends x{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e,t){return this._connection.send("GetComponentStatus",e,"json",!1,t,"GetComponentStatusResponse")}GetComponentUsage(e,t){return this._connection.send("GetComponentUsage",e,"json",!1,t,"GetComponentUsageResponse")}GetMachineInfo(e,t){return this._connection.send("GetMachineInfo",e,"json",!1,t,"GetMachineInfoResponse")}GetMachineInfoEx(e,t){return this._connection.send("GetMachineInfoEx",e,"json",!1,t,"GetMachineInfoResponseEx")}GetMetrics(e,t){return this._connection.send("GetMetrics",e,"json",!1,t,"MetricsResponse")}GetNodeGroupUsage(e,t){return this._connection.send("GetNodeGroupUsage",e,"json",!1,t,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e,t){return this._connection.send("GetTargetClusterInfo",e,"json",!1,t,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e,t){return this._connection.send("GetTargetClusterUsage",e,"json",!1,t,"GetTargetClusterUsageResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"ws_machinePingResponse")}UpdateComponentStatus(e,t){return this._connection.send("UpdateComponentStatus",e,"json",!1,t,"UpdateComponentStatusResponse")}};var re=class extends yt{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(r=>Qi("TargetClusterUsages.TargetClusterUsage",r)?r.TargetClusterUsages.TargetClusterUsage:[]).then(r=>r.filter(n=>!!n.ComponentUsages).map(n=>{let i=n.ComponentUsages.ComponentUsage.map(o=>{let a=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(c=>{let l=c.DiskUsages&&c.DiskUsages.DiskUsage?c.DiskUsages.DiskUsage.map(u=>({...u,InUse:u.InUse*1024,Total:(u.InUse+u.Available)*1024,PercentUsed:100-u.PercentAvailable})):[];return{Name:c.Name,NetAddress:c.NetAddress,Description:c.Description,DiskUsages:l,mean:Fe(l.filter(u=>!isNaN(u.PercentUsed)),u=>u.PercentUsed),max:Ee(l.filter(u=>!isNaN(u.PercentUsed)),u=>u.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:a,MachineUsagesDescription:a.reduce((c,l)=>c+(l.Description||""),""),mean:Fe(a.filter(c=>!isNaN(c.mean)),c=>c.mean),max:Ee(a.filter(c=>!isNaN(c.max)),c=>c.max)}});return{Name:n.Name,Description:n.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,a)=>o+(a.MachineUsagesDescription||""),""),mean:Fe(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:Ee(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var bt=class extends x{constructor(e){super(e,"WsPackageProcess","1.08")}ActivatePackage(e,t){return this._connection.send("ActivatePackage",e,"json",!1,t,"ActivatePackageResponse")}AddPackage(e,t){return this._connection.send("AddPackage",e,"json",!1,t,"AddPackageResponse")}AddPartToPackageMap(e,t){return this._connection.send("AddPartToPackageMap",e,"json",!1,t,"AddPartToPackageMapResponse")}CopyPackageMap(e,t){return this._connection.send("CopyPackageMap",e,"json",!1,t,"CopyPackageMapResponse")}DeActivatePackage(e,t){return this._connection.send("DeActivatePackage",e,"json",!1,t,"DeActivatePackageResponse")}DeletePackage(e,t){return this._connection.send("DeletePackage",e,"json",!1,t,"DeletePackageResponse")}Echo(e,t){return this._connection.send("Echo",e,"json",!1,t,"EchoResponse")}GetPackage(e,t){return this._connection.send("GetPackage",e,"json",!1,t,"GetPackageResponse")}GetPackageMapById(e,t){return this._connection.send("GetPackageMapById",e,"json",!1,t,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e,t){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,t,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e,t){return this._connection.send("GetPartFromPackageMap",e,"json",!1,t,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e,t){return this._connection.send("GetQueryFileMapping",e,"json",!1,t,"GetQueryFileMappingResponse")}ListPackage(e,t){return this._connection.send("ListPackage",e,"json",!1,t,"ListPackageResponse")}ListPackages(e,t){return this._connection.send("ListPackages",e,"json",!1,t,"ListPackagesResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e,t){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,t,"RemovePartFromPackageMapResponse")}ValidatePackage(e,t){return this._connection.send("ValidatePackage",e,"json",!1,t,"ValidatePackageResponse")}};var Wr=class extends bt{};var Ut=class extends x{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};var yr=class extends Ut{};var br;(e=>{let s;(n=>(n.ECL="ECL",n.DFU="DFU"))(s=e.WUTypes||={})})(br||={});var Et=class extends x{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e,t){return this._connection.send("ArchiveWU",e,"json",!1,t,"ResultResponse")}GetVersion(e,t){return this._connection.send("GetVersion",e,"json",!1,t,"ResultResponse")}ListWU(e,t){return this._connection.send("ListWU",e,"json",!1,t,"ResultResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WSSashaPingResponse")}RestoreWU(e,t){return this._connection.send("RestoreWU",e,"json",!1,t,"ResultResponse")}};var Ur=class extends Et{};var hs=new Date,fs=new Date;function X(s,e,t,r){function n(i){return s(i=arguments.length===0?new Date:new Date(+i)),i}return n.floor=i=>(s(i=new Date(+i)),i),n.ceil=i=>(s(i=new Date(i-1)),e(i,1),s(i),i),n.round=i=>{let o=n(i),a=n.ceil(i);return i-o<a-i?o:a},n.offset=(i,o)=>(e(i=new Date(+i),o==null?1:Math.floor(o)),i),n.range=(i,o,a)=>{let c=[];if(i=n.ceil(i),a=a==null?1:Math.floor(a),!(i<o)||!(a>0))return c;let l;do c.push(l=new Date(+i)),e(i,a),s(i);while(l<i&&i<o);return c},n.filter=i=>X(o=>{if(o>=o)for(;s(o),!i(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;e(o,-1),!i(o););else for(;--a>=0;)for(;e(o,1),!i(o););}),t&&(n.count=(i,o)=>(hs.setTime(+i),fs.setTime(+o),s(hs),s(fs),Math.floor(t(hs,fs))),n.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?n.filter(r?o=>r(o)%i===0:o=>n.count(0,o)%i===0):n)),n}var je=X(s=>s.setHours(0,0,0,0),(s,e)=>s.setDate(s.getDate()+e),(s,e)=>(e-s-(e.getTimezoneOffset()-s.getTimezoneOffset())*6e4)/864e5,s=>s.getDate()-1),Gi=je.range,_e=X(s=>{s.setUTCHours(0,0,0,0)},(s,e)=>{s.setUTCDate(s.getUTCDate()+e)},(s,e)=>(e-s)/864e5,s=>s.getUTCDate()-1),ki=_e.range,Er=X(s=>{s.setUTCHours(0,0,0,0)},(s,e)=>{s.setUTCDate(s.getUTCDate()+e)},(s,e)=>(e-s)/864e5,s=>Math.floor(s/864e5)),vi=Er.range;function de(s){return X(e=>{e.setDate(e.getDate()-(e.getDay()+7-s)%7),e.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var Oe=de(0),Ie=de(1),Fr=de(2),Ir=de(3),ne=de(4),Pr=de(5),Tr=de(6),Mr=Oe.range,Hi=Ie.range,ji=Fr.range,_i=Ir.range,Oi=ne.range,Yi=Pr.range,Xi=Tr.range;function me(s){return X(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-s)%7),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/6048e5)}var Ye=me(0),Pe=me(1),wr=me(2),Br=me(3),ie=me(4),Nr=me(5),Qr=me(6),Lr=Ye.range,qi=Pe.range,Ji=wr.range,zi=Br.range,Ki=ie.range,Zi=Nr.range,$i=Qr.range;var ee=X(s=>{s.setMonth(0,1),s.setHours(0,0,0,0)},(s,e)=>{s.setFullYear(s.getFullYear()+e)},(s,e)=>e.getFullYear()-s.getFullYear(),s=>s.getFullYear());ee.every=s=>!isFinite(s=Math.floor(s))||!(s>0)?null:X(e=>{e.setFullYear(Math.floor(e.getFullYear()/s)*s),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t*s)});var eo=ee.range,te=X(s=>{s.setUTCMonth(0,1),s.setUTCHours(0,0,0,0)},(s,e)=>{s.setUTCFullYear(s.getUTCFullYear()+e)},(s,e)=>e.getUTCFullYear()-s.getUTCFullYear(),s=>s.getUTCFullYear());te.every=s=>!isFinite(s=Math.floor(s))||!(s>0)?null:X(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/s)*s),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t*s)});var to=te.range;function Ds(s){if(0<=s.y&&s.y<100){var e=new Date(-1,s.m,s.d,s.H,s.M,s.S,s.L);return e.setFullYear(s.y),e}return new Date(s.y,s.m,s.d,s.H,s.M,s.S,s.L)}function Rs(s){if(0<=s.y&&s.y<100){var e=new Date(Date.UTC(-1,s.m,s.d,s.H,s.M,s.S,s.L));return e.setUTCFullYear(s.y),e}return new Date(Date.UTC(s.y,s.m,s.d,s.H,s.M,s.S,s.L))}function Xe(s,e,t){return{y:s,m:e,d:t,H:0,M:0,S:0,L:0}}function Cs(s){var e=s.dateTime,t=s.date,r=s.time,n=s.periods,i=s.days,o=s.shortDays,a=s.months,c=s.shortMonths,l=qe(n),u=Je(n),g=qe(i),p=Je(i),f=qe(o),D=Je(o),A=qe(a),b=Je(a),P=qe(c),R=Je(c),S={a:We,A:ye,b:be,B:z,c:null,d:jr,e:jr,f:bo,g:No,G:Lo,H:Ao,I:Wo,j:yo,L:qr,m:Uo,M:Eo,p:$n,q:ei,Q:Yr,s:Xr,S:Fo,u:Io,U:Po,V:To,w:Mo,W:wo,x:null,X:null,y:Bo,Y:Qo,Z:Go,"%":Or},m={a:ti,A:si,b:ri,B:ni,c:null,d:_r,e:_r,f:Ho,g:Zo,G:ea,H:ko,I:vo,j:Vo,L:zr,m:jo,M:_o,p:ii,q:oi,Q:Yr,s:Xr,S:Oo,u:Yo,U:Xo,V:qo,w:Jo,W:zo,x:null,X:null,y:Ko,Y:$o,Z:ta,"%":Or},q={a:us,A:B,b:U,B:$,c:H,d:Vr,e:Vr,f:Do,g:vr,G:kr,H:Hr,I:Hr,j:mo,L:So,m:go,M:ho,p:J,q:po,Q:Co,s:xo,S:fo,u:oo,U:ao,V:co,w:io,W:uo,x:E,X:ct,y:vr,Y:kr,Z:lo,"%":Ro};S.x=C(t,S),S.X=C(r,S),S.c=C(e,S),m.x=C(t,m),m.X=C(r,m),m.c=C(e,m);function C(h,y){return function(F){var d=[],j=-1,M=0,O=h.length,Y,ue,ar;for(F instanceof Date||(F=new Date(+F));++j<O;)h.charCodeAt(j)===37&&(d.push(h.slice(M,j)),(ue=Gr[Y=h.charAt(++j)])!=null?Y=h.charAt(++j):ue=Y==="e"?" ":"0",(ar=y[Y])&&(Y=ar(F,ue)),d.push(Y),M=j+1);return d.push(h.slice(M,j)),d.join("")}}function W(h,y){return function(F){var d=Xe(1900,void 0,1),j=T(d,h,F+="",0),M,O;if(j!=F.length)return null;if("Q"in d)return new Date(d.Q);if("s"in d)return new Date(d.s*1e3+("L"in d?d.L:0));if(y&&!("Z"in d)&&(d.Z=0),"p"in d&&(d.H=d.H%12+d.p*12),d.m===void 0&&(d.m="q"in d?d.q:0),"V"in d){if(d.V<1||d.V>53)return null;"w"in d||(d.w=1),"Z"in d?(M=Rs(Xe(d.y,0,1)),O=M.getUTCDay(),M=O>4||O===0?Pe.ceil(M):Pe(M),M=_e.offset(M,(d.V-1)*7),d.y=M.getUTCFullYear(),d.m=M.getUTCMonth(),d.d=M.getUTCDate()+(d.w+6)%7):(M=Ds(Xe(d.y,0,1)),O=M.getDay(),M=O>4||O===0?Ie.ceil(M):Ie(M),M=je.offset(M,(d.V-1)*7),d.y=M.getFullYear(),d.m=M.getMonth(),d.d=M.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),O="Z"in d?Rs(Xe(d.y,0,1)).getUTCDay():Ds(Xe(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+d.W*7-(O+5)%7:d.w+d.U*7-(O+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,Rs(d)):Ds(d)}}function T(h,y,F,d){for(var j=0,M=y.length,O=F.length,Y,ue;j<M;){if(d>=O)return-1;if(Y=y.charCodeAt(j++),Y===37){if(Y=y.charAt(j++),ue=q[Y in Gr?y.charAt(j++):Y],!ue||(d=ue(h,F,d))<0)return-1}else if(Y!=F.charCodeAt(d++))return-1}return d}function J(h,y,F){var d=l.exec(y.slice(F));return d?(h.p=u.get(d[0].toLowerCase()),F+d[0].length):-1}function us(h,y,F){var d=f.exec(y.slice(F));return d?(h.w=D.get(d[0].toLowerCase()),F+d[0].length):-1}function B(h,y,F){var d=g.exec(y.slice(F));return d?(h.w=p.get(d[0].toLowerCase()),F+d[0].length):-1}function U(h,y,F){var d=P.exec(y.slice(F));return d?(h.m=R.get(d[0].toLowerCase()),F+d[0].length):-1}function $(h,y,F){var d=A.exec(y.slice(F));return d?(h.m=b.get(d[0].toLowerCase()),F+d[0].length):-1}function H(h,y,F){return T(h,e,y,F)}function E(h,y,F){return T(h,t,y,F)}function ct(h,y,F){return T(h,r,y,F)}function We(h){return o[h.getDay()]}function ye(h){return i[h.getDay()]}function be(h){return c[h.getMonth()]}function z(h){return a[h.getMonth()]}function $n(h){return n[+(h.getHours()>=12)]}function ei(h){return 1+~~(h.getMonth()/3)}function ti(h){return o[h.getUTCDay()]}function si(h){return i[h.getUTCDay()]}function ri(h){return c[h.getUTCMonth()]}function ni(h){return a[h.getUTCMonth()]}function ii(h){return n[+(h.getUTCHours()>=12)]}function oi(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var y=C(h+="",S);return y.toString=function(){return h},y},parse:function(h){var y=W(h+="",!1);return y.toString=function(){return h},y},utcFormat:function(h){var y=C(h+="",m);return y.toString=function(){return h},y},utcParse:function(h){var y=W(h+="",!0);return y.toString=function(){return h},y}}}var Gr={"-":"",_:" ",0:"0"},Q=/^\s*\d+/,so=/^%/,ro=/[\\^$*+?|[\]().{}]/g;function I(s,e,t){var r=s<0?"-":"",n=(r?-s:s)+"",i=n.length;return r+(i<t?new Array(t-i+1).join(e)+n:n)}function no(s){return s.replace(ro,"\\$&")}function qe(s){return new RegExp("^(?:"+s.map(no).join("|")+")","i")}function Je(s){return new Map(s.map((e,t)=>[e.toLowerCase(),t]))}function io(s,e,t){var r=Q.exec(e.slice(t,t+1));return r?(s.w=+r[0],t+r[0].length):-1}function oo(s,e,t){var r=Q.exec(e.slice(t,t+1));return r?(s.u=+r[0],t+r[0].length):-1}function ao(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.U=+r[0],t+r[0].length):-1}function co(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.V=+r[0],t+r[0].length):-1}function uo(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.W=+r[0],t+r[0].length):-1}function kr(s,e,t){var r=Q.exec(e.slice(t,t+4));return r?(s.y=+r[0],t+r[0].length):-1}function vr(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.y=+r[0]+(+r[0]>68?1900:2e3),t+r[0].length):-1}function lo(s,e,t){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return r?(s.Z=r[1]?0:-(r[2]+(r[3]||"00")),t+r[0].length):-1}function po(s,e,t){var r=Q.exec(e.slice(t,t+1));return r?(s.q=r[0]*3-3,t+r[0].length):-1}function go(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.m=r[0]-1,t+r[0].length):-1}function Vr(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.d=+r[0],t+r[0].length):-1}function mo(s,e,t){var r=Q.exec(e.slice(t,t+3));return r?(s.m=0,s.d=+r[0],t+r[0].length):-1}function Hr(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.H=+r[0],t+r[0].length):-1}function ho(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.M=+r[0],t+r[0].length):-1}function fo(s,e,t){var r=Q.exec(e.slice(t,t+2));return r?(s.S=+r[0],t+r[0].length):-1}function So(s,e,t){var r=Q.exec(e.slice(t,t+3));return r?(s.L=+r[0],t+r[0].length):-1}function Do(s,e,t){var r=Q.exec(e.slice(t,t+6));return r?(s.L=Math.floor(r[0]/1e3),t+r[0].length):-1}function Ro(s,e,t){var r=so.exec(e.slice(t,t+1));return r?t+r[0].length:-1}function Co(s,e,t){var r=Q.exec(e.slice(t));return r?(s.Q=+r[0],t+r[0].length):-1}function xo(s,e,t){var r=Q.exec(e.slice(t));return r?(s.s=+r[0],t+r[0].length):-1}function jr(s,e){return I(s.getDate(),e,2)}function Ao(s,e){return I(s.getHours(),e,2)}function Wo(s,e){return I(s.getHours()%12||12,e,2)}function yo(s,e){return I(1+je.count(ee(s),s),e,3)}function qr(s,e){return I(s.getMilliseconds(),e,3)}function bo(s,e){return qr(s,e)+"000"}function Uo(s,e){return I(s.getMonth()+1,e,2)}function Eo(s,e){return I(s.getMinutes(),e,2)}function Fo(s,e){return I(s.getSeconds(),e,2)}function Io(s){var e=s.getDay();return e===0?7:e}function Po(s,e){return I(Oe.count(ee(s)-1,s),e,2)}function Jr(s){var e=s.getDay();return e>=4||e===0?ne(s):ne.ceil(s)}function To(s,e){return s=Jr(s),I(ne.count(ee(s),s)+(ee(s).getDay()===4),e,2)}function Mo(s){return s.getDay()}function wo(s,e){return I(Ie.count(ee(s)-1,s),e,2)}function Bo(s,e){return I(s.getFullYear()%100,e,2)}function No(s,e){return s=Jr(s),I(s.getFullYear()%100,e,2)}function Qo(s,e){return I(s.getFullYear()%1e4,e,4)}function Lo(s,e){var t=s.getDay();return s=t>=4||t===0?ne(s):ne.ceil(s),I(s.getFullYear()%1e4,e,4)}function Go(s){var e=s.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+I(e/60|0,"0",2)+I(e%60,"0",2)}function _r(s,e){return I(s.getUTCDate(),e,2)}function ko(s,e){return I(s.getUTCHours(),e,2)}function vo(s,e){return I(s.getUTCHours()%12||12,e,2)}function Vo(s,e){return I(1+_e.count(te(s),s),e,3)}function zr(s,e){return I(s.getUTCMilliseconds(),e,3)}function Ho(s,e){return zr(s,e)+"000"}function jo(s,e){return I(s.getUTCMonth()+1,e,2)}function _o(s,e){return I(s.getUTCMinutes(),e,2)}function Oo(s,e){return I(s.getUTCSeconds(),e,2)}function Yo(s){var e=s.getUTCDay();return e===0?7:e}function Xo(s,e){return I(Ye.count(te(s)-1,s),e,2)}function Kr(s){var e=s.getUTCDay();return e>=4||e===0?ie(s):ie.ceil(s)}function qo(s,e){return s=Kr(s),I(ie.count(te(s),s)+(te(s).getUTCDay()===4),e,2)}function Jo(s){return s.getUTCDay()}function zo(s,e){return I(Pe.count(te(s)-1,s),e,2)}function Ko(s,e){return I(s.getUTCFullYear()%100,e,2)}function Zo(s,e){return s=Kr(s),I(s.getUTCFullYear()%100,e,2)}function $o(s,e){return I(s.getUTCFullYear()%1e4,e,4)}function ea(s,e){var t=s.getUTCDay();return s=t>=4||t===0?ie(s):ie.ceil(s),I(s.getUTCFullYear()%1e4,e,4)}function ta(){return"+0000"}function Or(){return"%"}function Yr(s){return+s}function Xr(s){return Math.floor(+s/1e3)}var Te,Zr,Ft,It,Pt;xs({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function xs(s){return Te=Cs(s),Zr=Te.format,Ft=Te.parse,It=Te.utcFormat,Pt=Te.utcParse,Te}var $r;(t=>{let s;(c=>(c.ALL="ALL",c.READ="READ",c.WRITE="WRITE",c.HOLD="HOLD",c.SUB="SUB"))(s=t.LockModes||={});let e;(g=>(g.Attach="Attach",g.Detach="Detach",g.State="State",g.Reload="Reload",g.ReloadRetry="ReloadRetry",g.MemLock="MemLock",g.MemUnlock="MemUnlock",g.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})($r||={});var Tt=class extends x{constructor(e){super(e,"WsSMC","1.29")}Activity(e){return this._connection.send("Activity",e,"json",!1,void 0,"ActivityResponse")}BrowseResources(e){return this._connection.send("BrowseResources",e,"json",!1,void 0,"BrowseResourcesResponse")}ClearQueue(e){return this._connection.send("ClearQueue",e,"json",!1,void 0,"SMCQueueResponse")}GetBuildInfo(e){return this._connection.send("GetBuildInfo",e,"json",!1,void 0,"GetBuildInfoResponse")}GetGlobalMetrics(e){return this._connection.send("GetGlobalMetrics",e,"json",!1,void 0,"GetGlobalMetricsResponse")}GetStatusServerInfo(e){return this._connection.send("GetStatusServerInfo",e,"json",!1,void 0,"GetStatusServerInfoResponse")}GetThorQueueAvailability(e){return this._connection.send("GetThorQueueAvailability",e,"json",!1,void 0,"GetThorQueueAvailabilityResponse")}Index(e){return this._connection.send("Index",e,"json",!1,void 0,"SMCIndexResponse")}LockQuery(e){return this._connection.send("LockQuery",e,"json",!1,void 0,"LockQueryResponse")}MoveJobBack(e){return this._connection.send("MoveJobBack",e,"json",!1,void 0,"SMCJobResponse")}MoveJobDown(e){return this._connection.send("MoveJobDown",e,"json",!1,void 0,"SMCJobResponse")}MoveJobFront(e){return this._connection.send("MoveJobFront",e,"json",!1,void 0,"SMCJobResponse")}MoveJobUp(e){return this._connection.send("MoveJobUp",e,"json",!1,void 0,"SMCJobResponse")}NotInCommunityEdition(e){return this._connection.send("NotInCommunityEdition",e,"json",!1,void 0,"NotInCommunityEditionResponse")}PauseQueue(e){return this._connection.send("PauseQueue",e,"json",!1,void 0,"SMCQueueResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsSMCPingResponse")}RecordGlobalMetrics(e){return this._connection.send("RecordGlobalMetrics",e,"json",!1,void 0,"RecordGlobalMetricsResponse")}RemoveJob(e){return this._connection.send("RemoveJob",e,"json",!1,void 0,"SMCJobResponse")}ResumeQueue(e){return this._connection.send("ResumeQueue",e,"json",!1,void 0,"SMCQueueResponse")}RoxieControlCmd(e){return this._connection.send("RoxieControlCmd",e,"json",!1,void 0,"RoxieControlCmdResponse")}RoxieXrefCmd(e){return this._connection.send("RoxieXrefCmd",e,"json",!1,void 0,"RoxieXrefCmdResponse")}SetBanner(e){return this._connection.send("SetBanner",e,"json",!1,void 0,"SetBannerResponse")}SetJobPriority(e){return this._connection.send("SetJobPriority",e,"json",!1,void 0,"SMCPriorityResponse")}StopQueue(e){return this._connection.send("StopQueue",e,"json",!1,void 0,"SMCQueueResponse")}};var sa=Ft("%Y%m%d%H");function ra(s){return typeof s=="number"||typeof s=="string"&&s.trim()!==""&&!isNaN(+s)}var ze=class extends Tt{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}parseGlobalMetric(e,t){return e.startsWith("Cost")?+t/1e6:e.startsWith("Date")?sa(t):e.startsWith("Num")?+t:e.startsWith("Time")?+t/1e9:e.startsWith("When")?new Date(+t/1e3).toISOString():ra(t)?+t:t}GetNormalisedGlobalMetrics(e){return super.GetGlobalMetrics(e).then(t=>{let r=[];for(let n of t?.GlobalMetrics?.GlobalMetric||[]){let i={Category:n.Category,Start:this.parseGlobalMetric("Date",n.DateTimeRange?.Start),End:this.parseGlobalMetric("Date",n.DateTimeRange?.End),dimensions:{},stats:{}};for(let o of n.Dimensions?.Dimension||[])i.dimensions[o.Name]=o.Value;for(let o of n.Stats?.Stat||[])i.stats[o.Name]=this.parseGlobalMetric(o.Name,o.Value);r.push(i)}return r})}};var Mt=class extends x{constructor(e){super(e,"wsstore","1.02")}CreateStore(e,t){return this._connection.send("CreateStore",e,"json",!1,t,"CreateStoreResponse")}Delete(e,t){return this._connection.send("Delete",e,"json",!1,t,"DeleteResponse")}DeleteNamespace(e,t){return this._connection.send("DeleteNamespace",e,"json",!1,t,"DeleteNamespaceResponse")}Fetch(e,t){return this._connection.send("Fetch",e,"json",!1,t,"FetchResponse")}FetchAll(e,t){return this._connection.send("FetchAll",e,"json",!1,t,"FetchAllResponse")}FetchKeyMetadata(e,t){return this._connection.send("FetchKeyMetadata",e,"json",!1,t,"FetchKeyMDResponse")}ListKeys(e,t){return this._connection.send("ListKeys",e,"json",!1,t,"ListKeysResponse")}ListNamespaces(e,t){return this._connection.send("ListNamespaces",e,"json",!1,t,"ListNamespacesResponse")}ListStores(e,t){return this._connection.send("ListStores",e,"json",!1,t,"ListStoresResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"wsstorePingResponse")}Set(e,t){return this._connection.send("Set",e,"json",!1,t,"SetResponse")}};var Ke=class extends Mt{Delete(e){return super.Delete(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(r=>r.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}Fetch(e){return super.Fetch(e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(r=>r.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}};var en;(r=>{let s;(o=>(o.XML="XML",o.YAML="YAML"))(s=r.TpConfigResponseFormat||={});let e;(a=>(a.All="All",a.QueriesOnly="QueriesOnly",a.WorkunitsOnly="WorkunitsOnly"))(e=r.RoxieQueueFilter||={});let t;(D=>(D.ALLNODES="ALLNODES",D.THORMACHINES="THORMACHINES",D.HOLEMACHINES="HOLEMACHINES",D.ROXIEMACHINES="ROXIEMACHINES",D.MACHINES="MACHINES",D.AVAILABLEMACHINES="AVAILABLEMACHINES",D.DROPZONE="DROPZONE",D.STANDBYNNODE="STANDBYNNODE",D.THORSPARENODES="THORSPARENODES",D.HOLESTANDBYNODES="HOLESTANDBYNODES"))(t=r.TpMachineType||={})})(en||={});var wt=class extends x{constructor(e){super(e,"WsTopology","1.33")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsTopologyPingResponse")}SystemLog(e,t){return this._connection.send("SystemLog",e,"json",!1,t,"SystemLogResponse")}TpClusterInfo(e,t){return this._connection.send("TpClusterInfo",e,"json",!1,t,"TpClusterInfoResponse")}TpClusterQuery(e,t){return this._connection.send("TpClusterQuery",e,"json",!1,t,"TpClusterQueryResponse")}TpComponentConfiguration(e,t){return this._connection.send("TpComponentConfiguration",e,"json",!1,t,"TpComponentConfigurationResponse")}TpConfiguredComponents(e,t){return this._connection.send("TpConfiguredComponents",e,"json",!1,t,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e,t){return this._connection.send("TpDropZoneQuery",e,"json",!1,t,"TpDropZoneQueryResponse")}TpGetComponentFile(e,t){return this._connection.send("TpGetComponentFile",e,"json",!1,t,"TpGetComponentFileResponse")}TpGetServicePlugins(e,t){return this._connection.send("TpGetServicePlugins",e,"json",!1,t,"TpGetServicePluginsResponse")}TpGroupQuery(e,t){return this._connection.send("TpGroupQuery",e,"json",!1,t,"TpGroupQueryResponse")}TpListLogFiles(e,t){return this._connection.send("TpListLogFiles",e,"json",!1,t,"TpListLogFilesResponse")}TpListTargetClusters(e,t){return this._connection.send("TpListTargetClusters",e,"json",!1,t,"TpListTargetClustersResponse")}TpLogFile(e,t){return this._connection.send("TpLogFile",e,"json",!1,t,"TpLogFileResponse")}TpLogFileDisplay(e,t){return this._connection.send("TpLogFileDisplay",e,"json",!1,t,"TpLogFileResponse")}TpLogicalClusterQuery(e,t){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,t,"TpLogicalClusterQueryResponse")}TpMachineInfo(e,t){return this._connection.send("TpMachineInfo",e,"json",!1,t,"TpMachineInfoResponse")}TpMachineQuery(e,t){return this._connection.send("TpMachineQuery",e,"json",!1,t,"TpMachineQueryResponse")}TpServiceQuery(e,t){return this._connection.send("TpServiceQuery",e,"json",!1,t,"TpServiceQueryResponse")}TpSetMachineStatus(e,t){return this._connection.send("TpSetMachineStatus",e,"json",!1,t,"TpSetMachineStatusResponse")}TpSwapNode(e,t){return this._connection.send("TpSwapNode",e,"json",!1,t,"TpSwapNodeResponse")}TpTargetClusterQuery(e,t){return this._connection.send("TpTargetClusterQuery",e,"json",!1,t,"TpTargetClusterQueryResponse")}TpThorStatus(e,t){return this._connection.send("TpThorStatus",e,"json",!1,t,"TpThorStatusResponse")}TpXMLFile(e,t){return this._connection.send("TpXMLFile",e,"json",!1,t,"TpXMLFileResponse")}};var G=class extends wt{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(t=>{if(t.default)return t.default;let r,n;return t.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(n=i),i.Type==="hthor"?(r=i,!0):!1)),r||n})}};import{deepMixin as na,xml2json as ia}from"@hpcc-js/util";var v;(R=>{let s;(E=>(E.Abort="Abort",E.Delete="Delete",E.Deschedule="Deschedule",E.Reschedule="Reschedule",E.Pause="Pause",E.PauseNow="PauseNow",E.Protect="Protect",E.Unprotect="Unprotect",E.Restore="Restore",E.Resume="Resume",E.SetToFailed="SetToFailed",E.Archive="Archive"))(s=R.ECLWUActions||={});let e;(W=>(W[W.MIN=0]="MIN",W[W.DEFAULT=1]="DEFAULT",W[W.ALL=2]="ALL",W[W.CUSTOM=3]="CUSTOM"))(e=R.LogSelectColumnMode||={});let t;(q=>(q[q.ASC=0]="ASC",q[q.DSC=1]="DSC"))(t=R.SortDirection||={});let r;(B=>(B.ALL="ALL",B.DIS="DIS",B.ERR="ERR",B.WRN="WRN",B.INF="INF",B.PRO="PRO",B.MET="MET",B.EVT="EVT"))(r=R.LogEventClass||={});let n;(C=>(C.Single="Single",C.List="List",C.Multi="Multi"))(n=R.WUDetailsAttrValueType||={});let i;(C=>(C.SyntaxCheck="SyntaxCheck",C.Deploy="Deploy",C.Publish="Publish"))(i=R.EclDefinitionActions||={});let o;(C=>(C.xml="xml",C.json="json",C.text="text"))(o=R.ErrorMessageFormat||={});let a;(C=>(C[C.XML=0]="XML",C[C.JSON=1]="JSON",C[C.CSV=2]="CSV"))(a=R.LogAccessLogFormat||={});let c;(W=>(W.info="info",W.warning="warning",W.error="error",W.alert="alert"))(c=R.WUExceptionSeverity||={});let l;(W=>(W[W.OriginalText=0]="OriginalText",W[W.Attachment=1]="Attachment",W[W.ZIP=2]="ZIP",W[W.GZIP=3]="GZIP"))(l=R.WUFileDownloadOption||={});let u;(E=>(E.XML="XML",E.cpp="cpp",E.dll="dll",E.res="res",E.log="log",E.WUECL="WUECL",E.ThorLog="ThorLog",E.ThorSlaveLog="ThorSlaveLog",E.EclAgentLog="EclAgentLog",E.ArchiveQuery="ArchiveQuery",E.ComponentLog="ComponentLog",E.PostMortem="PostMortem"))(u=R.WUFileType||={});let g;(J=>(J.Allqueries="All queries",J.Notsuspended="Not suspended",J.Suspended="Suspended",J.Suspendedbyuser="Suspended by user",J.Suspendedbyfirstnode="Suspended by first node",J.Suspendedbyanynode="Suspended by any node"))(g=R.WUQueryFilterSuspendedType||={});let p;(T=>(T.All="All",T.Id="Id",T.Name="Name",T.Alias="Alias",T.Status="Status"))(p=R.WUQuerySetFilterType||={});let f;(C=>(C.All="All",C.Protected="Protected",C.NotProtected="NotProtected"))(f=R.WUProtectFilter||={});let D;(m=>m.Deactivate="Deactivate")(D=R.QuerySetAliasActionTypes||={});let A;(q=>(q.None="None",q.ActivateImportedActive="ActivateImportedActive"))(A=R.QuerysetImportActivation||={});let b;(B=>(B.Suspend="Suspend",B.Unsuspend="Unsuspend",B.ToggleSuspend="ToggleSuspend",B.Activate="Activate",B.Delete="Delete",B.DeleteQueriesAndWUs="DeleteQueriesAndWUs",B.RemoveAllAliases="RemoveAllAliases",B.ResetQueryStats="ResetQueryStats"))(b=R.QuerySetQueryActionTypes||={});let P;(W=>(W[W.DoNotActivateQuery=0]="DoNotActivateQuery",W[W.ActivateQuery=1]="ActivateQuery",W[W.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",W[W.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(P=R.WUQueryActivationMode||={})})(v||={});var Ze=class extends x{constructor(e){super(e,"WsWorkunits","2.10")}GVCAjaxGraph(e,t){return this._connection.send("GVCAjaxGraph",e,"json",!1,t,"GVCAjaxGraphResponse")}Ping(e,t){return this._connection.send("Ping",e,"json",!1,t,"WsWorkunitsPingResponse")}WUAbort(e,t){return this._connection.send("WUAbort",e,"json",!1,t,"WUAbortResponse")}WUAction(e,t){return this._connection.send("WUAction",e,"json",!1,t,"WUActionResponse")}WUAddLocalFileToWorkunit(e,t){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,t,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e,t){return this._connection.send("WUAnalyseHotspot",e,"json",!1,t,"WUAnalyseHotspotResponse")}WUCDebug(e,t){return this._connection.send("WUCDebug",e,"json",!1,t,"WUDebugResponse")}WUCheckFeatures(e,t){return this._connection.send("WUCheckFeatures",e,"json",!1,t,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e,t){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,t,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e,t){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,t,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e,t){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,t,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e,t){return this._connection.send("WUClusterJobXLS",e,"json",!1,t,"WUClusterJobXLSResponse")}WUCompileECL(e,t){return this._connection.send("WUCompileECL",e,"json",!1,t,"WUCompileECLResponse")}WUCopyLogicalFiles(e,t){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,t,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e,t){return this._connection.send("WUCopyQuerySet",e,"json",!1,t,"WUCopyQuerySetResponse")}WUCreate(e,t){return this._connection.send("WUCreate",e,"json",!1,t,"WUCreateResponse")}WUCreateAndUpdate(e,t){return this._connection.send("WUCreateAndUpdate",e,"json",!1,t,"WUUpdateResponse")}WUCreateZAPInfo(e,t){return this._connection.send("WUCreateZAPInfo",e,"json",!1,t,"WUCreateZAPInfoResponse")}WUDelete(e,t){return this._connection.send("WUDelete",e,"json",!1,t,"WUDeleteResponse")}WUDeployWorkunit(e,t){return this._connection.send("WUDeployWorkunit",e,"json",!1,t,"WUDeployWorkunitResponse")}WUDetails(e,t){return this._connection.send("WUDetails",e,"json",!1,t,"WUDetailsResponse")}WUDetailsMeta(e,t){return this._connection.send("WUDetailsMeta",e,"json",!1,t,"WUDetailsMetaResponse")}WUEclDefinitionAction(e,t){return this._connection.send("WUEclDefinitionAction",e,"json",!1,t,"WUEclDefinitionActionResponse")}WUExport(e,t){return this._connection.send("WUExport",e,"json",!1,t,"WUExportResponse")}WUFile(e,t){return this._connection.send("WUFile",e,"json",!1,t,"WULogFileResponse")}WUFullResult(e,t){return this._connection.send("WUFullResult",e,"json",!1,t,"WUFullResultResponse")}WUGVCGraphInfo(e,t){return this._connection.send("WUGVCGraphInfo",e,"json",!1,t,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e,t){return this._connection.send("WUGetArchiveFile",e,"json",!1,t,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e,t){return this._connection.send("WUGetDependancyTrees",e,"json",!1,t,"WUGetDependancyTreesResponse")}WUGetGraph(e,t){return this._connection.send("WUGetGraph",e,"json",!1,t,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e,t){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,t,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e,t){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,t,"WUGetNumFileToCopyResponse")}WUGetPlugins(e,t){return this._connection.send("WUGetPlugins",e,"json",!1,t,"WUGetPluginsResponse")}WUGetStats(e,t){return this._connection.send("WUGetStats",e,"json",!1,t,"WUGetStatsResponse")}WUGetThorJobList(e,t){return this._connection.send("WUGetThorJobList",e,"json",!1,t,"WUGetThorJobListResponse")}WUGetThorJobQueue(e,t){return this._connection.send("WUGetThorJobQueue",e,"json",!1,t,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e,t){return this._connection.send("WUGetZAPInfo",e,"json",!1,t,"WUGetZAPInfoResponse")}WUGraphInfo(e,t){return this._connection.send("WUGraphInfo",e,"json",!1,t,"WUGraphInfoResponse")}WUGraphTiming(e,t){return this._connection.send("WUGraphTiming",e,"json",!1,t,"WUGraphTimingResponse")}WUHelperFileArchive(e,t){return this._connection.send("WUHelperFileArchive",e,"json",!1,t,"WUHelperFileArchiveResponse")}WUInfo(e,t){return this._connection.send("WUInfo",e,"json",!1,t,"WUInfoResponse")}WUInfoDetails(e,t){return this._connection.send("WUInfoDetails",e,"json",!1,t,"WUInfoResponse")}WUJobList(e,t){return this._connection.send("WUJobList",e,"json",!1,t,"WUJobListResponse")}WULightWeightQuery(e,t){return this._connection.send("WULightWeightQuery",e,"json",!1,t,"WULightWeightQueryResponse")}WUListArchiveFiles(e,t){return this._connection.send("WUListArchiveFiles",e,"json",!1,t,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e,t){return this._connection.send("WUListLocalFileRequired",e,"json",!1,t,"WUListLocalFileRequiredResponse")}WUListQueries(e,t){return this._connection.send("WUListQueries",e,"json",!1,t,"WUListQueriesResponse")}WUListQueriesUsingFile(e,t){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,t,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e,t){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,t,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e,t){return this._connection.send("WUProcessGraph",e,"json",!1,t,"WUProcessGraphResponse")}WUProtect(e,t){return this._connection.send("WUProtect",e,"json",!1,t,"WUProtectResponse")}WUPublishWorkunit(e,t){return this._connection.send("WUPublishWorkunit",e,"json",!1,t,"WUPublishWorkunitResponse")}WUPushEvent(e,t){return this._connection.send("WUPushEvent",e,"json",!1,t,"WUPushEventResponse")}WUQuery(e,t){return this._connection.send("WUQuery",e,"json",!1,t,"WUQueryResponse")}WUQueryConfig(e,t){return this._connection.send("WUQueryConfig",e,"json",!1,t,"WUQueryConfigResponse")}WUQueryDetails(e,t){return this._connection.send("WUQueryDetails",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e,t){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,t,"WUQueryDetailsResponse")}WUQueryFiles(e,t){return this._connection.send("WUQueryFiles",e,"json",!1,t,"WUQueryFilesResponse")}WUQueryGetGraph(e,t){return this._connection.send("WUQueryGetGraph",e,"json",!1,t,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e,t){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,t,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e,t){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,t,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e,t){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,t,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e,t){return this._connection.send("WUQuerysetDetails",e,"json",!1,t,"WUQuerySetDetailsResponse")}WUQuerysetExport(e,t){return this._connection.send("WUQuerysetExport",e,"json",!1,t,"WUQuerysetExportResponse")}WUQuerysetImport(e,t){return this._connection.send("WUQuerysetImport",e,"json",!1,t,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e,t){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,t,"WUQuerySetQueryActionResponse")}WUQuerysets(e,t){return this._connection.send("WUQuerysets",e,"json",!1,t,"WUQuerysetsResponse")}WURecreateQuery(e,t){return this._connection.send("WURecreateQuery",e,"json",!1,t,"WURecreateQueryResponse")}WUResubmit(e,t){return this._connection.send("WUResubmit",e,"json",!1,t,"WUResubmitResponse")}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t,"WUResultResponse")}WUResultBin(e,t){return this._connection.send("WUResultBin",e,"json",!1,t,"WUResultBinResponse")}WUResultSummary(e,t){return this._connection.send("WUResultSummary",e,"json",!1,t,"WUResultSummaryResponse")}WUResultView(e,t){return this._connection.send("WUResultView",e,"json",!1,t,"WUResultViewResponse")}WURun(e,t){return this._connection.send("WURun",e,"json",!1,t,"WURunResponse")}WUSchedule(e,t){return this._connection.send("WUSchedule",e,"json",!1,t,"WUScheduleResponse")}WUShowScheduled(e,t){return this._connection.send("WUShowScheduled",e,"json",!1,t,"WUShowScheduledResponse")}WUSubmit(e,t){return this._connection.send("WUSubmit",e,"json",!1,t,"WUSubmitResponse")}WUSyntaxCheckECL(e,t){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,t,"WUSyntaxCheckResponse")}WUUpdate(e,t){return this._connection.send("WUUpdate",e,"json",!1,t,"WUUpdateResponse")}WUUpdateQueryEntry(e,t){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,t,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e,t){return this._connection.send("WUWaitCompiled",e,"json",!1,t,"WUWaitResponse")}WUWaitComplete(e,t){return this._connection.send("WUWaitComplete",e,"json",!1,t,"WUWaitResponse")}};var As=(S=>(S[S.Unknown=0]="Unknown",S[S.Compiled=1]="Compiled",S[S.Running=2]="Running",S[S.Completed=3]="Completed",S[S.Failed=4]="Failed",S[S.Archived=5]="Archived",S[S.Aborting=6]="Aborting",S[S.Aborted=7]="Aborted",S[S.Blocked=8]="Blocked",S[S.Submitted=9]="Submitted",S[S.Scheduled=10]="Scheduled",S[S.Compiling=11]="Compiling",S[S.Wait=12]="Wait",S[S.UploadingFiled=13]="UploadingFiled",S[S.DebugPaused=14]="DebugPaused",S[S.DebugRunning=15]="DebugRunning",S[S.Paused=16]="Paused",S[S.LAST=17]="LAST",S[S.NotFound=999]="NotFound",S))(As||{}),he;(e=>{let s;(p=>(p[p.Unknown=0]="Unknown",p[p.Compile=1]="Compile",p[p.Check=2]="Check",p[p.Run=3]="Run",p[p.ExecuteExisting=4]="ExecuteExisting",p[p.Pause=5]="Pause",p[p.PauseNow=6]="PauseNow",p[p.Resume=7]="Resume",p[p.Debug=8]="Debug",p[p.__size=9]="__size"))(s=e.Action||={})})(he||={});function sn(s){return typeof s.Name=="string"}function ql(s){return s.TotalClusterTime!==void 0}function Jl(s){return s.StateEx!==void 0}var L=class extends Ze{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(r=>na({Workunits:{ECLWorkunit:[]}},r))}WUInfo(e){let t={Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUDetailsEx(e,t,r){return this._connection.send("WUDetails",e,r,!1,t,"WUDetailsResponse")}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(t=>{let n=ia(t.Result).children();return n.length?n[0]:null})}},Bt=class extends Ze{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as Ta,StateObject as Ma}from"@hpcc-js/util";import{Cache as ma,deepMixinT as In,scopedLogger as ha,StateObject as fa,XMLNode as Qs}from"@hpcc-js/util";function rn(s){return Math.abs(s=Math.round(s))>=1e21?s.toLocaleString("en").replace(/,/g,""):s.toString(10)}function fe(s,e){if(!isFinite(s)||s===0)return null;var t=(s=e?s.toExponential(e-1):s.toExponential()).indexOf("e"),r=s.slice(0,t);return[r.length>1?r[0]+r.slice(2):r,+s.slice(t+1)]}function nn(s){return s=fe(Math.abs(s)),s?s[1]:NaN}function on(s,e){return function(t,r){for(var n=t.length,i=[],o=0,a=s[0],c=0;n>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),i.push(t.substring(n-=a,n+a)),!((c+=a+1)>r));)a=s[o=(o+1)%s.length];return i.reverse().join(e)}}function an(s){return function(e){return e.replace(/[0-9]/g,function(t){return s[+t]})}}var oa=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $e(s){if(!(e=oa.exec(s)))throw new Error("invalid format: "+s);var e;return new Ws({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}$e.prototype=Ws.prototype;function Ws(s){this.fill=s.fill===void 0?" ":s.fill+"",this.align=s.align===void 0?">":s.align+"",this.sign=s.sign===void 0?"-":s.sign+"",this.symbol=s.symbol===void 0?"":s.symbol+"",this.zero=!!s.zero,this.width=s.width===void 0?void 0:+s.width,this.comma=!!s.comma,this.precision=s.precision===void 0?void 0:+s.precision,this.trim=!!s.trim,this.type=s.type===void 0?"":s.type+""}Ws.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cn(s){e:for(var e=s.length,t=1,r=-1,n;t<e;++t)switch(s[t]){case".":r=n=t;break;case"0":r===0&&(r=t),n=t;break;default:if(!+s[t])break e;r>0&&(r=0);break}return r>0?s.slice(0,r)+s.slice(n+1):s}var et;function un(s,e){var t=fe(s,e);if(!t)return et=void 0,s.toPrecision(e);var r=t[0],n=t[1],i=n-(et=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+fe(s,Math.max(0,e+i-1))[0]}function ys(s,e){var t=fe(s,e);if(!t)return s+"";var r=t[0],n=t[1];return n<0?"0."+new Array(-n).join("0")+r:r.length>n+1?r.slice(0,n+1)+"."+r.slice(n+1):r+new Array(n-r.length+2).join("0")}var bs={"%":(s,e)=>(s*100).toFixed(e),b:s=>Math.round(s).toString(2),c:s=>s+"",d:rn,e:(s,e)=>s.toExponential(e),f:(s,e)=>s.toFixed(e),g:(s,e)=>s.toPrecision(e),o:s=>Math.round(s).toString(8),p:(s,e)=>ys(s*100,e),r:ys,s:un,X:s=>Math.round(s).toString(16).toUpperCase(),x:s=>Math.round(s).toString(16)};function Us(s){return s}var ln=Array.prototype.map,pn=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function gn(s){var e=s.grouping===void 0||s.thousands===void 0?Us:on(ln.call(s.grouping,Number),s.thousands+""),t=s.currency===void 0?"":s.currency[0]+"",r=s.currency===void 0?"":s.currency[1]+"",n=s.decimal===void 0?".":s.decimal+"",i=s.numerals===void 0?Us:an(ln.call(s.numerals,String)),o=s.percent===void 0?"%":s.percent+"",a=s.minus===void 0?"\u2212":s.minus+"",c=s.nan===void 0?"NaN":s.nan+"";function l(g,p){g=$e(g);var f=g.fill,D=g.align,A=g.sign,b=g.symbol,P=g.zero,R=g.width,S=g.comma,m=g.precision,q=g.trim,C=g.type;C==="n"?(S=!0,C="g"):bs[C]||(m===void 0&&(m=12),q=!0,C="g"),(P||f==="0"&&D==="=")&&(P=!0,f="0",D="=");var W=(p&&p.prefix!==void 0?p.prefix:"")+(b==="$"?t:b==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),T=(b==="$"?r:/[%p]/.test(C)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),J=bs[C],us=/[defgprs%]/.test(C);m=m===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function B(U){var $=W,H=T,E,ct,We;if(C==="c")H=J(U)+H,U="";else{U=+U;var ye=U<0||1/U<0;if(U=isNaN(U)?c:J(Math.abs(U),m),q&&(U=cn(U)),ye&&+U==0&&A!=="+"&&(ye=!1),$=(ye?A==="("?A:a:A==="-"||A==="("?"":A)+$,H=(C==="s"&&!isNaN(U)&&et!==void 0?pn[8+et/3]:"")+H+(ye&&A==="("?")":""),us){for(E=-1,ct=U.length;++E<ct;)if(We=U.charCodeAt(E),48>We||We>57){H=(We===46?n+U.slice(E+1):U.slice(E))+H,U=U.slice(0,E);break}}}S&&!P&&(U=e(U,1/0));var be=$.length+U.length+H.length,z=be<R?new Array(R-be+1).join(f):"";switch(S&&P&&(U=e(z+U,z.length?R-H.length:1/0),z=""),D){case"<":U=$+U+H+z;break;case"=":U=$+z+U+H;break;case"^":U=z.slice(0,be=z.length>>1)+$+U+H+z.slice(be);break;default:U=z+$+U+H;break}return i(U)}return B.toString=function(){return g+""},B}function u(g,p){var f=Math.max(-8,Math.min(8,Math.floor(nn(p)/3)))*3,D=Math.pow(10,-f),A=l((g=$e(g),g.type="f",g),{suffix:pn[8+f/3]});return function(b){return A(D*b)}}return{format:l,formatPrefix:u}}var Nt,Me,dn;Es({thousands:",",grouping:[3],currency:["$",""]});function Es(s){return Nt=gn(s),Me=Nt.format,dn=Nt.formatPrefix,Nt}import{Cache as mn,Edge as xn,Graph as An,StateObject as aa,Subgraph as Wn,Vertex as yn}from"@hpcc-js/util";var Qt=class extends aa{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,r){super(),this.wu=e;let n=0;for(let i of r)if(i.GraphName===t.Name&&!i.HasSubGraphId){n=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:n,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(t=>kt(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>kt(t))}},Lt=class extends mn{constructor(){super(e=>mn.hash([e.Name]))}};function bn(s,e,t){t=t||[],t.push(s),e(s.name,s.$,s.children(),t),s.children().forEach(r=>{bn(r,e,t)}),t.pop()}function Fs(s){let e={};return s.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var Is=class extends An{},hn=class extends Wn{},fn=class extends yn{},Sn=class extends xn{};function Un(s,e){let t={},r={},n={},i=new Is(a=>a._.id),o=[i.root];return bn(e,(a,c,l,u)=>{let g=o[o.length-1];switch(a){case"graph":break;case"node":if(l.length&&l[0].children().length&&l[0].children()[0].name==="graph"){let D=g.createSubgraph(Fs(l));o.push(D),t[c.id]=D}let p=g.createVertex(Fs(l));r[c.id]=p;break;case"edge":let f=g.createEdge(r[c.source],r[c.target],Fs(l));n[c.id]=f;break;default:}}),i}var Gt=class extends An{},Dn=class extends Wn{},Rn=class extends yn{},Cn=class extends xn{};function kt(s){let e={},t={},r={},n;for(let i of s)switch(i.ScopeType){case"graph":n=new Gt(u=>u._.Id,i),e[i.ScopeName]=n.root;break;case"subgraph":n||(n=new Gt(u=>u._.Id,i),e[i.ScopeName]=n.root);let o=i.parentScope().split(":"),a=e[i.parentScope()];for(;o.length&&!a;)a=e[o.join(":")],o.pop();if(!a)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let u=a;e[i.ScopeName]=u.createSubgraph(i)}break;case"activity":let c=e[i.parentScope()];c?r[i.ScopeName]=c.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let l=r[i.parentScope()];l?l._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],a=e[o.parentScope()];if(!a)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let c=a;try{let l=n.vertex(o.attr("IdSource").RawValue),u=n.vertex(o.attr("IdTarget").RawValue);c.createEdge(l,u,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return n}import{StateObject as ca}from"@hpcc-js/util";var vt=class extends ca{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let r=t.split("\\").join("/"),n=r.split("/"),i="res/"+this.wu.Wuid+"/",o="",a="";r.indexOf(i)===0&&(o=r.substr(i.length),a=n[n.length-1]),this.set({URL:t,DisplayName:a,DisplayPath:o})}};import{Cache as ws,exists as Ms,StateObject as la}from"@hpcc-js/util";import{SAXStackParser as ua,Stack as En}from"@hpcc-js/util";var Vt=class{e;constructor(e){this.e=e}fix(){delete this.e}},Ht=class extends Vt{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){let r=this._children[t];r.name==="Row"&&r.type===void 0&&(this._children.push(...r._children),this._children.splice(t,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}}charWidth(){let e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let t="0123456789",r=this.type.lastIndexOf("_"),n=r>0?r:this.type.length,i=n-1;for(;i>=0&&t.indexOf(this.type.charAt(i))!==-1;--i);i+1<n&&(e=parseInt(this.type.substring(i+1,n),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},jt=class extends Vt{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},_t=class{root;simpleTypes={};fields(){return this.root.children()}},Ot=class extends ua{schema=new _t;simpleType;simpleTypes={};xsdStack=new En;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new Ht(e);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(t):this.schema.root=t,this.xsdStack.push(t);break;case"xs:simpleType":this.simpleType=new jt(e);break;default:break}}endXMLNode(e){switch(e.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":let r=this.xsdStack.top();for(let n in e.$)r.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function Ts(s){let e=new Ot;return e.parse(s),e.schema}var Ps=class extends Ot{_rootName;schema=new _t;simpleTypes={};xsdStack=new En;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new Ht(e);!this.schema.root&&this._rootName===e.$.name&&(this.schema.root=t),this.xsdStack.depth()&&this.xsdStack.top().append(t),this.xsdStack.push(t);break;case"xsd:simpleType":this.simpleType=new jt(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function Bp(s,e){let t=new Ps(e);return t.parse(s),t.schema}var Bs=class extends ws{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Yt=new Bs,Xt=class s extends la{connection;_bypassCache=!1;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,r,n){let i;return Array.isArray(n)?(i=Yt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r.Name},()=>new s(e,t,r,n)),i.set(r)):typeof n>"u"&&(typeof r=="number"?i=Yt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+r},()=>new s(e,t,r)):typeof r=="string"&&(i=Yt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},()=>new s(e,t,r)))),i}static attachLogicalFile(e,t,r){return Yt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},()=>new s(e,t,r,!0))}constructor(e,t,r,n){super(),e instanceof L?this.connection=e:this.connection=new L(e),typeof n=="boolean"&&n===!0?this.set({NodeGroup:t,LogicalFileName:r}):sn(r)&&Array.isArray(n)?this.set({...r,Wuid:t,ResultName:r.Name,ResultViews:n}):typeof n>"u"?typeof r=="number"?this.set({Wuid:t,ResultSequence:r}):typeof r=="string"?this.set({Wuid:t,ResultName:r}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}bypassCache(e){return e===void 0?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=Ts(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,r=!1,n={},i,o){let a=o??this._bypassCache;return this.WUResult(e,t,!r,n,i,a).then(c=>{let l=c.Result;return delete c.Result,this.set({...c}),Ms("XmlSchema.xml",l)&&(this.xsdSchema=Ts(l.XmlSchema.xml)),Ms("Row",l)?l.Row:this.ResultName&&Ms(this.ResultName,l)?l[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,r=!1,n={},i,o=!1){let a={NamedValue:{itemcount:0}};for(let l in n)a.NamedValue[a.NamedValue.itemcount++]={Name:l,Value:n[l]};let c={FilterBy:a};return this.Wuid&&this.ResultName!==void 0?(c.Wuid=this.Wuid,c.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(c.Wuid=this.Wuid,c.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(c.LogicalName=this.LogicalFileName,c.Cluster=this.NodeGroup):this.LogicalFileName&&(c.LogicalName=this.LogicalFileName),c.Start=e,c.Count=t,c.SuppressXmlSchema=r,c.BypassCachedResult=o,this.connection.WUResult(c,i).then(l=>l)}},qt=class extends ws{constructor(){super(e=>ws.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as Fn}from"@hpcc-js/util";var Se=class extends Fn{scope;get properties(){return this.get()}get Name(){return this.get("Name")}get RawValue(){return this.get("RawValue")}get Formatted(){return this.get("Formatted")}get FormattedEnd(){return this.get("FormattedEnd")}get Measure(){return this.get("Measure")}get Creator(){return this.get("Creator")}get CreatorType(){return this.get("CreatorType")}constructor(e,t){super(),this.scope=e,this.set(t)}},Ns=class extends Fn{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(r=>{r.Measure==="ts"&&r.Name.indexOf("Started")>=0?t.start=r:this.ScopeName&&r.Measure==="ts"&&r.Name.indexOf("Finished")>=0?t.end=r:e.push(new Se(this,r))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new Se(this,t.start))):t.start?e.push(new Se(this,t.start)):t.end&&e.push(new Se(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(t=>{this._attributeMap[t.Name]=t}),this.Properties.Property=[];for(let t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){let e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(let t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new Se(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t=this.Id,r=[];r.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&r.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),r.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let n=this.formattedAttrs();for(let i in n)i==="Label"?t=n[i]:r.push(`<tr><td class="key">${i}</td><td class="value">${n[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
911
911
  <h4 align="center">${t}</h4>
912
912
  <table>
913
- ${s.join("")}
913
+ ${r.join("")}
914
914
  </table>
915
- </div>`}},yt=class extends en{wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as bo}from"@hpcc-js/util";var ys=class extends bo{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof ae?this.connection=e:this.connection=new ae(e),this.set({Wuid:t,...s})}};import{espTime2Seconds as Uo,StateObject as Eo}from"@hpcc-js/util";var Ws=class extends Eo{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof ae?this.connection=e:this.connection=new ae(e);let r=Uo(s.Value);this.set({Wuid:t,Seconds:Math.round(r*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var Mo=(0,Es.utcFormat)("%Y-%m-%dT%H:%M:%S.%LZ"),To=(0,Es.utcParse)("%Y-%m-%dT%H:%M:%S.%LZ"),wo=(0,Pr.format)(",");function No(n){return n&&!isNaN(+n)?wo(+n):n}var Er="DefinitionList",Bo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Qo=["Avg","Min","Max","Delta","StdDev"],Lo=["SkewMin","SkewMax","NodeMin","NodeMax"],Go=/[A-Z][a-z]*/g;function ko(n){for(let t of Lo){let s=n.indexOf(t);if(s===0){let i=n.slice(s+t.length);return{measure:"",ext:t,label:i}}}let e=n.match(Go);if(e?.length){let t=e.shift(),s=e.join("");for(let r of Qo){let i=s.indexOf(r);if(i===0)return s=s.slice(i+r.length),{measure:t,ext:r,label:s}}return{measure:t,ext:"",label:s}}return{measure:"",ext:"",label:n}}var Fr={};function vo(n){let e=Fr[n];return e||(e=ko(n),Fr[n]=e),e}function Me(n,e){return n.__formattedProps?.[e]??n[e]}function xs(n){if(n===void 0)return;let e=parseFloat(n);return isNaN(e)?void 0:e}function Vo(n,e,t){let s=vo(e);if(!t[s.measure]){t[s.label]=!0;let r=xs(n[`${s.measure}Avg${s.label}`]),i=xs(n[`${s.measure}Min${s.label}`]),o=xs(n[`${s.measure}Max${s.label}`]),c=xs(n[`${s.measure}StdDev${s.label}`]),d=Math.max((r-i)/c,(o-r)/c);return{Key:`${s.measure}${s.label}`,Value:Me(n,`${s.measure}${s.label}`),Avg:Me(n,`${s.measure}Avg${s.label}`),Min:Me(n,`${s.measure}Min${s.label}`),Max:Me(n,`${s.measure}Max${s.label}`),Delta:Me(n,`${s.measure}Delta${s.label}`),StdDev:Me(n,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(d)?void 0:d,SkewMin:Me(n,`SkewMin${s.label}`),SkewMax:Me(n,`SkewMax${s.label}`),NodeMin:Me(n,`NodeMin${s.label}`),NodeMax:Me(n,`NodeMax${s.label}`)}}return null}var bs=Po("workunit.ts"),sn=class extends Fo{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},Us=new sn,ot=class n extends Io{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",0)}get State(){return this.get("State")||_s[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new As;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>Cs.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new Ws(this.connection,this.Wuid,e))}_graphCache=new ls;get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(e=>this._graphCache.get(e,()=>new us(this,e,this.CTimers)))}get ThorLogList(){return this.get("ThorLogList")}get ResourceURLCount(){return this.get("ResourceURLCount",0)}get ResourceURLs(){return this.get("ResourceURLs",{URL:[]})}get CResourceURLs(){return this.ResourceURLs.URL.map(e=>new ds(this,e))}get TotalClusterTime(){return this.get("TotalClusterTime","")}get DateTimeScheduled(){return this.get("DateTimeScheduled")}get IsPausing(){return this.get("IsPausing")}get ThorLCR(){return this.get("ThorLCR")}get ApplicationValues(){return this.get("ApplicationValues",{ApplicationValue:[]})}get HasArchiveQuery(){return this.get("HasArchiveQuery")}get StateEx(){return this.get("StateEx")}get PriorityClass(){return this.get("PriorityClass")}get PriorityLevel(){return this.get("PriorityLevel")}get Snapshot(){return this.get("Snapshot")}get ResultLimit(){return this.get("ResultLimit")}get EventSchedule(){return this.get("EventSchedule")}get Query(){return this.get("Query")}get HelpersCount(){return this.get("HelpersCount",0)}get Helpers(){return this.get("Helpers",{ECLHelpFile:[]})}get DebugValues(){return this.get("DebugValues")}get AllowedClusters(){return this.get("AllowedClusters")}get ErrorCount(){return this.get("ErrorCount",0)}get WarningCount(){return this.get("WarningCount",0)}get InfoCount(){return this.get("InfoCount",0)}get AlertCount(){return this.get("AlertCount",0)}get SourceFileCount(){return this.get("SourceFileCount",0)}get SourceFiles(){return this.get("SourceFiles",{ECLSourceFile:[]})}get CSourceFiles(){return this.SourceFiles.ECLSourceFile.map(e=>new ys(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get AbortReason(){return this.get("AbortReason")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}get CostSavingPotential(){return this.get("CostSavingPotential")}get FailureDesc(){return this.get("FailureDesc")}get FileSummaries(){return this.get("FileSummaries")}static create(e){let t=new n(e);return t.connection.WUCreate().then(s=>(Us.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let r=Us.get({BaseUrl:e.baseUrl,Wuid:t},()=>new n(e,t));return s&&r.set(s),r}static existsLocal(e,t){return Us.has({BaseUrl:e,Wuid:t})}static submit(e,t,s,r=!1){return n.create(e).then(i=>i.update({QueryText:s})).then(i=>r?i.submit(t,Ke.Action.Compile):i.submit(t))}static compile(e,t,s){return n.submit(e,t,s,!0)}static query(e,t){return new ae(e).WUQuery(t).then(r=>r.Workunits.ECLWorkunit.map(function(i){return n.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new ae(e),this.topologyConnection=new ge(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:0})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(t=>(this.set(t.Workunit),this))}submit(e,t=Ke.Action.Run,s){let r;return e!==void 0?r=Promise.resolve(e):r=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===Ke.Action.Debug&&(t=Ke.Action.Run,this._debugMode=!0),r.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:s,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===Ke.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){return this.StateID===999}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(he.ECLWUActions.SetToFailed)}pause(){return this.WUAction(he.ECLWUActions.Pause)}pauseNow(){return this.WUAction(he.ECLWUActions.PauseNow)}resume(){return this.WUAction(he.ECLWUActions.Resume)}abort(){return this.WUAction(he.ECLWUActions.Abort)}protect(){return this.WUAction(he.ECLWUActions.Protect)}unprotect(){return this.WUAction(he.ECLWUActions.Unprotect)}delete(){return this.WUAction(he.ECLWUActions.Delete)}restore(){return this.WUAction(he.ECLWUActions.Restore)}deschedule(){return this.WUAction(he.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(he.ECLWUActions.Reschedule)}recover(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!0}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>n.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={},t,s){return this.WUDetails(e,t,s).then(r=>{switch(s){case"arraybuffer":return r;case"text":case"xsd":return r;default:return r.Scopes.Scope}})}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=new Map;for(let o of e.Activities?.Activity??[])r.set(o.Kind,o.Name);let i=new Array(t.length);for(let o=0;o<t.length;o++){let c=t[o],d={},C={};if(c.Properties?.Property)for(let V of c.Properties.Property){let j=V.Measure,X=V.Name,w=V.RawValue;if(j==="ns"&&(V.Measure="s"),X==="Kind"){let M=parseInt(w,10);V.Formatted=r.get(M)??w}switch(s[X]={Name:V.Name,Measure:V.Measure,Creator:V.Creator,CreatorType:V.CreatorType},V.Measure){case"bool":d[X]=!!+w;break;case"sz":d[X]=+w;break;case"s":d[X]=+w/1e9;break;case"ns":d[X]=+w;break;case"ts":d[X]=new Date(+w/1e3).toISOString();break;case"cnt":d[X]=+w;break;case"cost":d[X]=+w/1e6;break;case"node":d[X]=+w;break;case"skw":d[X]=+w;break;default:d[X]=w}C[X]=No(V.Formatted??d[X])}let l={id:c.Id,name:c.ScopeName,type:c.ScopeType,Kind:c.Kind,Label:c.Label,__formattedProps:C,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...d},E=l[Er];if(E)try{let V=JSON.parse(E.split("\\").join("\\\\")),j=[];for(let X=0;X<V.length;X++){let w=V[X].match(Bo);w&&j.push({filePath:(w[1]??"")+w[2]+w[3],line:parseInt(w[5],10),col:parseInt(w[6],10)})}l[Er]=j}catch{bs.error(`Unexpected "DefinitionList": ${E}`)}let A={},P=0,N="";for(let V in l)if(!V.startsWith("__")){let j=Vo(l,V,A);j&&(l.__groupedProps[j.Key]=j,!isNaN(j.StdDevs)&&j.StdDevs>P&&(P=j.StdDevs,N=j.Key))}l.__StdDevs=P,l.__StdDevsSource=N,i[o]=l}return{meta:e,columns:s,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={},t,s){return this.WUDetails(e,t,s).then(r=>{switch(s){case"arraybuffer":return r;case"text":case"xsd":return r;default:return r.Scopes.Scope.map(i=>new yt(this,i))}})}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let s=[],r={};t.Scopes.Scope.forEach(i=>{if(r[i.ScopeName])return r[i.ScopeName].update(i),null;{let o=new yt(this,i);return r[o.ScopeName]=o,o}});for(let i in r)if(r.hasOwnProperty(i)){let o=r[i],c=o.parentScope();c&&r[c]?r[c].children().push(o):s.push(o)}return s})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>ps(t))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let t={};e.forEach(r=>{t[r.ScopeName]=t[r.ScopeName]||{scope:r.ScopeName,start:null,elapsed:null,finish:null},r.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?t[r.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(t[r.ScopeName].start=i.Formatted)})});let s=[];for(let r in t){let i=t[r];if(i.start&&i.elapsed){let o=To(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Mo(o),s.push(i)}}return s.sort((r,i)=>r.start<i.start?-1:r.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(t.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw bs.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Us.set(this),e))}WUInfo(e={}){let t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(s=>(this.set(s.Workunit),t&&this.set({ResultViews:s.ResultViews}),s)).catch(s=>{if(!s.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw bs.warning(`Unexpected ESP exception: ${s.message}`),s;return{}})}WUResubmit(e){return this.connection.WUResubmit(Ur({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e,t,s){return this.connection.WUDetailsEx(Ur({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid}),t,s).then(r=>{switch(s){case"arraybuffer":case"text":case"xsd":return r;default:return r.Scopes===void 0?r.Scopes={Scope:[]}:r.Scopes.Scope===void 0&&(r.Scopes.Scope=[]),r}})}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:he.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new as({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(let r in t)t.hasOwnProperty(r)&&(s+=` ${r}='${t[r]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(r=>r)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(s=>{let r=s.children(e);return r.length?r[0]:new tn(e)}).catch(s=>(bs.error(s),Promise.resolve(new tn(e)))):Promise.resolve(new tn(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(t=>{if(t.name==="break")return t.$})}debugBreakpointAdd(e,t,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).then(r=>this.debugBreakpointResponseParser(r))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=Wr(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Oo(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(r=>r.children().map(i=>{let o={};return i.children().forEach(c=>{o[c.name]=c.content}),o}))}},nn="definition";function Ho(n){return n._[nn]!==void 0}function jo(n){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(n._[nn]);if(e){let[,t,s,r]=e;return t.replace(/\/\.\//g,"/"),{id:n._.id,file:t,line:+s,column:+r}}throw new Error(`Bad definition: ${n._[nn]}`)}function Oo(n,e){let t=[];for(let s of n.vertices)if(Ho(s)){let r=jo(s);(r&&!e||e===r.file)&&t.push(r)}return t.sort((s,r)=>s.line-r.line)}var Fs,Ir=class n extends Yo{connection;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get Build(){return this.get("Build")}get ThorClusterList(){return this.get("ThorClusterList")}get RoxieClusterList(){return this.get("RoxieClusterList")}get HThorClusterList(){return this.get("HThorClusterList")}get DFUJobs(){return this.get("DFUJobs")}get Running(){return this.get("Running",{ActiveWorkunit:[]})}get BannerContent(){return this.get("BannerContent")}get BannerColor(){return this.get("BannerColor")}get BannerSize(){return this.get("BannerSize")}get BannerScroll(){return this.get("BannerScroll")}get ChatURL(){return this.get("ChatURL")}get ShowBanner(){return this.get("ShowBanner")}get ShowChatURL(){return this.get("ShowChatURL")}get SortBy(){return this.get("SortBy")}get Descending(){return this.get("Descending")}get SuperUser(){return this.get("SuperUser")}get AccessRight(){return this.get("AccessRight")}get ServerJobQueues(){return this.get("ServerJobQueues")}get ActivityTime(){return this.get("ActivityTime")}get DaliDetached(){return this.get("DaliDetached")}static attach(e,t){return Fs||(Fs=new n(e)),t&&Fs.set(t),Fs}constructor(e){super(),e instanceof Rt?this.connection=e:this.connection=new Rt(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>ot.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=_o(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as Xo,scopedLogger as qo,StateObject as zo}from"@hpcc-js/util";var Jo=qo("logicalFile.ts"),rn=class extends Xo{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},Ko=new rn,Mr=class n extends zo{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get CompressionType(){return this.get("CompressionType")}get properties(){return this.get()}static attach(e,t,s,r){let i=Ko.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new n(e,t,s));return r&&i.set(r),i}constructor(e,t,s){super(),e instanceof Dt?this.connection=e:this.connection=new Dt(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let r={...t,...s};delete r.DFUFileParts,e.push(r)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Jo.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};import{Cache as Zo,StateObject as $o}from"@hpcc-js/util";var on=class extends Zo{constructor(){super(e=>e.Address)}},ea=new on,Ps=class n extends $o{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let r=ea.get({Address:t},()=>new n(e));return s&&r.set(s),r}constructor(e){super(),e instanceof ke?this.connection=e:this.connection=new ke(e)}};var Br=mt(Ys(),1);import{Cache as wr,StateObject as la,scopedLogger as ga}from"@hpcc-js/util";import{Cache as ra,exists as Tr,StateObject as ia}from"@hpcc-js/util";import{Cache as ta,StateObject as sa}from"@hpcc-js/util";var cn=class extends ta{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},na=new cn,at=class n extends sa{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>Ps.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let r=na.get({BaseUrl:e.baseUrl,Name:t},()=>new n(e,t));return s&&r.set(s),r}constructor(e,t){super(),e instanceof ge?(this.connection=e,this.machineConnection=new ke(e.connectionOptions())):(this.connection=new ge(e),this.machineConnection=new ke(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let s=[];for(let r of t.TargetClusterInfoList.TargetClusterInfo)for(let i of r.Processes.MachineInfoEx)s.push(i);return this.set("MachineInfoEx",s),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(let r of this.CMachineInfoEx)for(let i of r.Storage.StorageInfo){t+=i.Available,s+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function tg(n){let e;return n instanceof ge?e=n:e=new ge(n),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>at.attach(n,s.Name,s)))}var an={};function sg(n){if(!an[n.baseUrl]){let e;n instanceof ge?e=n:e=new ge(n),an[n.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,r,i;t.TargetClusters.TpClusterNameType.forEach(c=>{s||(s=c),!r&&c.IsDefault===!0&&(r=c),!i&&c.Type==="hthor"&&(i=c)});let o=r||i||s;return at.attach(n,o.Name,o)})}return an[n.baseUrl]}var un=class extends ra{constructor(){super(e=>e.BaseUrl)}},oa=new un,Is=class n extends ia{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>at.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=oa.get({BaseUrl:e.baseUrl},()=>new n(e));return t&&s.set(t),s}constructor(e){super(),e instanceof ge?this.connection=e:this.connection=new ge(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),r=this.connection.ip(),i=s==="https:"?"18002":"8002";if(Tr("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if(Tr("TpBindings.TpBinding",o))for(let c of o.TpBindings.TpBinding)c.Service===e&&c.Protocol+":"===s&&(i=c.Port)}return`${s}//${r}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){return this.isCallback(t)?e==="changed"&&super.on(e,t):e==="changed"&&super.on(e,t,s),this._monitor(),this}};function ve(n,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(n[e]=t)}function Wt(n){return n=""+n,n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function aa(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(n);if(!t)return 0;let s=+t[1]||0,r=+t[2]||0,i=+t[3]||0,o=+t[4]||0,c=+t[5]||0,d=+t[6]||0,C=+t[7]||0;return s*24*60*60+r*60*60+i*60+o+c/1e3+d/1e6+C/1e9}function Ve(n,e){let t=n.indexOf(e);return t!==-1?parseFloat(n.substring(0,t)):-1}function ca(n){if(n){if(!isNaN(+n))return parseFloat(n)}else return 0;let e=Ve(n,"Kb");return e>=0?e*1024:(e=Ve(n,"Mb"),e>=0?e*Math.pow(1024,2):(e=Ve(n,"Gb"),e>=0?e*Math.pow(1024,3):(e=Ve(n,"Tb"),e>=0?e*Math.pow(1024,4):(e=Ve(n,"Pb"),e>=0?e*Math.pow(1024,5):(e=Ve(n,"Eb"),e>=0?e*Math.pow(1024,6):(e=Ve(n,"Zb"),e>=0?e*Math.pow(1024,7):(e=Ve(n,"b"),e>=0?e:0)))))))}function ua(n){return n?parseFloat(n):0}var ln=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,s,r){this.noSpills=r,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,s),this.calcOutVertexVisibility(i,s)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),s-1),this.calcOutVertexVisibility(i.getTarget(),s-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(s=>{this.calcInVertexVisibility(s.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(s=>{this.calcOutVertexVisibility(s.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((r,i)=>{this.calcSubgraphVisibility(r,t-1)}),e.__hpcc_subgraphs.forEach((r,i)=>{this.m_visibleSubgraphs[r.__hpcc_id]=r}),e.__hpcc_vertices.forEach((r,i)=>{this.m_visibleVertices[r.__hpcc_id]=r});let s={};this.graph.edges.forEach((r,i)=>{r.getSource().__hpcc_parent!==r.getTarget().__hpcc_parent&&e===this.getCommonAncestor(r)&&(s[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]||(s[r.getSource().__hpcc_parent.__hpcc_id+"::"+r.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[r.__hpcc_id]=r))})}buildVertexString(e,t){let s="",r="",i=e.getProperties();for(let o in i)t&&o.indexOf("_kind")>=0?r+='<att name="_kind" value="point"/>':o==="id"||o==="label"?s+=" "+o+'="'+Wt(i[o])+'"':r+='<att name="'+o+'" value="'+Wt(i[o])+'"/>';return"<node"+s+">"+r+"</node>"}buildEdgeString(e){let t="",s="",r=e.getProperties();for(let i in r)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+Wt(r[i])+'"':s+='<att name="'+i+'" value="'+Wt(r[i])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){let s=[],r=[];this.getAncestors(e,s),this.getAncestors(t,r);let i=s.length-1,o=r.length-1,c=null;for(;i>=0&&o>=0&&s[i]===r[o];)c=s[i],--i,--o;return c}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((s,r)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),t.getOutEdges().forEach((s,r)=>{this.m_visibleEdges[s.__hpcc_id]=s}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getSource(),this.addSemiVisibleVertex(s);else break}let r=t.getTarget();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let i=r.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),r=i[0].getTarget(),this.addSemiVisibleVertex(r);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let r=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),r===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)s+='<att name="'+o+'" value="'+Wt(i[o])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},xt=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf("__")!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},He=class extends xt{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType=t==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}},$e=class extends xt{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(t=>{t.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},et=class extends xt{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,t){super(e,t),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},Ms=class n{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;let s=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(s.documentElement,"0")}isSubgraph(e){return e instanceof He}isVertex(e){return e instanceof $e}isEdge(e){return e instanceof et}getGlobalType(e){return e instanceof $e?3:e instanceof et?4:e instanceof He?2:e instanceof n?1:0}getGlobalTypeString(e){return e instanceof $e?"Vertex":e instanceof et?"Edge":e instanceof He?"Cluster":e instanceof n?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let r=new He(this,t);this.subgraphs.push(r),this.idx[t]=r;break;case"node":let i=new $e(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new et(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let s=this.idx[t];return Array.from(e.attributes).forEach(r=>{ve(s,r.name,r.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof He?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof $e?this.vertices=this.vertices.filter(t=>e!==t):e instanceof et&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(r=>{if(r.tagName===t)return s=r,!0}),s}walkDocument(e,t){let s=this.getItem(e,t);return e.childNodes.forEach(r=>{switch(r.nodeType){case 1:switch(r.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(r,"att");if(o){let E=this.getChildByTagName(o,"graph");if(E){i=!0;let A=this.walkDocument(E,r.getAttribute("id"));s.addSubgraph(A)}}if(!i){let E=this.walkDocument(r,r.getAttribute("id"));s.addVertex(E)}break;case"att":let c=r.getAttribute("name"),d="_"+c,C=r.getAttribute("value");c.indexOf("Time")===0?(ve(s,d,C),ve(s,c,""+aa(C))):c.indexOf("Size")===0?(ve(s,d,C),ve(s,c,""+ca(C))):c.indexOf("Skew")===0?(ve(s,d,C),ve(s,c,""+ua(C))):ve(s,c,C);break;case"edge":let l=this.walkDocument(r,r.getAttribute("id"));if(l.NumRowsProcessed!==void 0?l._eclwatchCount=l.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.Count!==void 0?l._eclwatchCount=l.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):l.count!==void 0&&(l._eclwatchCount=l.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),l.inputProgress&&(l._eclwatchInputProgress="["+l.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),l.SkewMaxRowsProcessed&&l.SkewMinRowsProcessed&&(l._eclwatchSkew="+"+l.SkewMaxRowsProcessed+", "+l.SkewMinRowsProcessed),!l._dependsOn){if(!l._childGraph){if(l._sourceActivity||l._targetActivity){l._isSpill=!0;let E=l.getSource();E&&(E._isSpill=!0);let A=l.getTarget();A&&(A._isSpill=!0)}}}s.addEdge(l);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof He&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,r){let i=new ln(this);return i.calcVisibility(e,t,s,r),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var Ts=ga("@hpcc-js/comms/ecl/query.ts"),pa=(0,Br.format)("~s");function da(n){return!isNaN(parseFloat(n))&&!isNaN(n-0)}var gn=class extends wr{constructor(){super(e=>wr.hash([e.QueryId,e.QuerySet]))}},ma=new gn,Nr=class n extends la{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,r){super(),e instanceof ae?this.wsWorkunitsService=e:this.wsWorkunitsService=new ae(e),this.topology=Is.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...r})}static attach(e,t,s,r){let i=ma.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new n(e,t,s));return r&&i.set(r),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let s of t?.TpBindings?.TpBinding??[])if(s?.Service==="ws_ecl"){let r=`${s.Protocol}://${globalThis.location.hostname}:${s.Port}`;return new Xt({baseUrl:r})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(t){Ts.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(t){Ts.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(s=>{let r=new Ms,i=!0;for(let o of s?.Graphs?.ECLGraphEx||[])i?(r.load(o.Graph),i=!1):r.merge(o.Graph);return r})}fetchDetailsNormalized(e={}){let t=ot.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(s=>{let r=s[0],i=s[1],c=s[2].map(d=>{let C=d.Id[0];if(C==="a"||C==="e"){let l=r.idx[d.Id.substring(1)];if(!l)return Ts.debug(`Missing graph data for metric ID: ${d.Id}`),d;let E=new Set(d.Properties.Property.map(P=>P.Name)),A=[];for(let P in l){let N=P.charAt(0);if(N!=="_"&&N===N.toUpperCase()&&!E.has(P)){let V=l[P],j=typeof V;if(j==="string"||j==="number"||j==="boolean"){let w=da(V)?parseFloat(V):V,M=V;P.indexOf("Time")>=0&&(w=w/1e9,M=pa(w)+"s"),A.push({Name:P,RawValue:w,Formatted:M})}}}A.length>0&&d.Properties.Property.push(...A)}return d});return t.normalizeDetails(i,c)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(s=>{for(let r in s)s[r]=s[r].Row;return s})??[]}catch(s){return Ts.debug(s.message??s),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};import{Cache as ha,Dispatch as fa,Message as Sa}from"@hpcc-js/util";var pn=class extends ha{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},Da=new pn,tt=class extends Sa{constructor(t,s,r){super();this.key=t;this.value=s;this.oldValue=r}key;value;oldValue;get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},Qr=class n{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new fa;static attach(e,t="HPCCApps",s,r=!0){return Da.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:r,Namespace:s},()=>new n(e,t,s,r))}constructor(e,t,s,r){e instanceof Ct?this.connection=e:this.connection=new Ct(e),this.Name=t,this.UserSpecific=r,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(r=>{let i=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new tt(e,t,i))}).catch(r=>{console.error(`Store.set("${e}", "${t}") failed:`,r)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let r=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new tt(e,s.Value,r)),s.Value}).catch(s=>{console.error(`Store.get(${e}) failed:`,s)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let s={},r=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete r[i.Key],s[i.Key]=i.Value,e&&this._dispatch.post(new tt(i.Key,i.Value,o))}),e)for(let i in r)this._dispatch.post(new tt(i,void 0,r[i]));return s}).catch(t=>(console.error("Store.getAll failed:",t),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let r=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new tt(e,void 0,r))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};import{Cache as Ra,scopedLogger as Ca,StateObject as Aa}from"@hpcc-js/util";var ya=Ca("@hpcc-js/comms/dfuWorkunit.ts");var dn=class extends Ra{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Lr=new dn,Gr=class n extends Aa{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",0)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get StateReason(){return this.get("StateReason")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){let s=new n(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(r=>(Lr.set(s),s.set(r.result),s))}static attach(e,t,s){let r=Lr.get({BaseUrl:e.baseUrl,ID:t},()=>new n(e,t));return s&&r.set(s),r}static sprayFixed(e,t){let s=new Je(e);return s.SprayFixedEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}static sprayVariable(e,t){let s=new Je(e);return s.SprayVariableEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}static despray(e,t){let s=new Je(e);return s.DesprayEx({...t}).then(r=>{let i=r.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>n.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){return this.State===999}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(St.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(t=>t).catch(t=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===St.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",r=>{this.isComplete()&&t([r])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,s);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),this.isComplete()&&(r.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let r=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(r.release(),t(this))})})}constructor(e,t){super(),this.connection=new Je(e),this.topologyConnection=new ge(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(t=>(this.set(t.result),t)).catch(t=>{if(!t.Exception.some(r=>r.Code===20080||r.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw ya.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};import*as zr from"node:child_process";import*as Jr from"node:crypto";import*as pe from"node:fs";import*as Te from"node:os";import*as fe from"node:path";import{exists as Ta,scopedLogger as wa,xml2json as Na}from"@hpcc-js/util";import*as st from"node:fs";import*as $ from"node:path";import{Dictionary as vr,DictionaryNoCase as kr,find as Wa,SAXStackParser as xa,scopedLogger as ba,XMLNode as Ua}from"@hpcc-js/util";var Ea=ba("clienttools/eclmeta"),Fa=!1;function ct(n,e,t){if(Fa){for(let s in n){let r=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&Ea.debug(r)}n.$&&ct(n.$,e+".$",t)}}var hn=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},fn=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,t){this.__attrs=t.$,this.definition=e,this.name=t.$.name,this.type=t.$.type}},ut=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,r,i=1,o=0,c=0,d=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=$.normalize(s),this.line=+i-1,this.start=+o,this.body=+c,this.end=+d,this.definitions=this.parseDefinitions(r)}parseDefinitions(e=[]){return e.map(t=>{let s=new Sn(this.sourcePath,t);return ct(t,"definition",s),s})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let t=[];return this.contains(e)&&(t.push(this),this.definitions.forEach(s=>{t=s.scopeStackAt(e).concat(t)})),t}_resolve(e=[],t){let s=t.split("."),r=s.shift(),i=Wa(e,o=>typeof o.name=="string"&&typeof r=="string"&&o.name.toLowerCase()===r.toLowerCase());return i&&i.definitions.length&&s.length?this._resolve(i.definitions,s.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Sn=class extends ut{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,t){super(t.$.name,t.$.type,e,t.children("Definition"),t.$.line,t.$.start,t.$.body,t.$.end),this.__attrs=t.$,this.exported=!!t.$.exported,this.shared=!!t.$.shared,this.fullname=t.$.fullname,this.inherittype=t.$.inherittype,this.attrs=this.parseAttrs(t.children("Attr")),this.fields=this.parseFields(t.children("Field"))}parseAttrs(e=[]){return e.map(t=>{let s=new hn(t);return ct(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new fn(this,t);return ct(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},ws=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},Dn=class extends ut{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let t=e.$.name.split(".");t.pop();let s=new Ua("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new ws(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new ws(t);return ct(t,"import",s),s})}resolve(e,t){let s;return!s&&t!==void 0&&this.scopeStackAt(t).some(i=>(s=i.resolve(e),!!s)),s||(s=super.resolve(e)),s}},Pa=n=>$.basename(n).indexOf(".")===0,Vr=n=>st.lstatSync(n).isDirectory()&&!Pa(n),Ia=n=>[".ecl",".ecllib"].indexOf($.extname(n).toLowerCase())>=0,Hr=n=>st.readdirSync(n).map(e=>$.join(n,e)).filter(e=>Vr(e)||Ia(e)),Rn=class extends ut{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},Cn=class extends ut{constructor(e,t){super(e,"folder",t,[])}suggestions(){return Hr(this.sourcePath).map(e=>({name:$.basename(e,".ecl"),type:"folder"}))}},An=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new kr;_sourceByPath=new vr;_test=new kr;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return jr(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let t of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[t]&&st.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){st.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let r of Hr(e))Vr(r)?this.visitFolder(r,t,s):this.visitFile(r,t,s)}visitFile(e,t,s=!1){let r=$.parse(e),i=$.join(r.dir,r.name),o=$.relative(t,i).split($.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Rn("",e))}visitFolder(e,t,s=!1){let r=$.relative(t,e).split($.sep).join(".");(s||!this._test.has(r))&&(this._test.set(r,new Cn(r,e)),this.walkChildFolders(e,t,s))}buildStack(e,t,s){let r=t.split(".");s&&e[e.length-1]===r[0]&&r.shift();let i=[...e,...r],o=i.join(".");return{stack:i,qid:o}}walkECLScope(e,t){let s=this.buildStack(e,t.name,!0);this._test.set(s.qid,t);for(let r of t.definitions)this.walkDefinition(s.stack,r)}walkField(e,t){let s=this.buildStack(e,t.name,!1);this._test.set(s.qid,t)}walkDefinition(e,t){let s=this.buildStack(e,t.name,!0);this.walkECLScope(e,t);for(let r of t.fields)this.walkField(s.stack,r)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let t of e)if(t.$.name){let s=new Dn(t);if(ct(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=$.dirname(o),--i;this.visitFolder(o,$.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new yn;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>$.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let r;if(!r&&this._test.has(t)&&(r=this._test.get(t).scope),!r&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let d of i.imports)if(d.name.toLowerCase()===o[0].toLowerCase()){d.ref?o[0]=d.ref:o.shift();break}let c=o.join(".");!r&&this._test.has(c)&&(r=this._test.get(c).scope),r||(c=[...i.name.split("."),...o].join("."),this._test.has(c)&&(r=this._test.get(c).scope))}return r}resolvePartialID(e,t,s){t=t.toLowerCase();let r=t.split(".");r.pop();let i=r.length===1?r[0]:r.join(".");return this.resolveQualifiedID(e,i,s)}},mn=new vr;function nt(n,e){let t=$.normalize(n);if(!mn.has(t)){let s=new An(t,e);mn.set(t,s),s.refresh()}return mn.get(t)}function Ma(n,e,t){if(e<0)return!1;let s=n.charAt(e);return(t?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(s)}function Up(n,e,t){for(;Ma(n,e,t);)e+=t?-1:1;return e+(t?1:-1)}var yn=class extends xa{sources=[];endXMLNode(e){e.name==="Source"&&this.sources.push(e),super.endXMLNode(e)}};var lt=wa("clienttools/eclcc"),Wn=Te.type()==="Windows_NT"?".exe":"";function Or(n){return n.split(`\r
915
+ </div>`}},tt=class extends Ns{wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as pa}from"@hpcc-js/util";var Jt=class extends pa{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,r){super(),e instanceof L?this.connection=e:this.connection=new L(e),this.set({Wuid:t,...r})}};import{espTime2Seconds as ga,StateObject as da}from"@hpcc-js/util";var zt=class extends da{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,r){super(),e instanceof L?this.connection=e:this.connection=new L(e);let n=ga(r.Value);this.set({Wuid:t,Seconds:Math.round(n*1e3)/1e3,HasSubGraphId:r.SubGraphId!==void 0,...r})}};var Sa=It("%Y-%m-%dT%H:%M:%S.%LZ"),Da=Pt("%Y-%m-%dT%H:%M:%S.%LZ"),Ra=Me(",");function Ca(s){return s&&!isNaN(+s)?Ra(+s):s}var Pn="DefinitionList",xa=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Aa=["Avg","Min","Max","Delta","StdDev"],Wa=["SkewMin","SkewMax","NodeMin","NodeMax"],ya=/[A-Z][a-z]*/g;function ba(s){for(let t of Wa){let r=s.indexOf(t);if(r===0){let i=s.slice(r+t.length);return{measure:"",ext:t,label:i}}}let e=s.match(ya);if(e?.length){let t=e.shift(),r=e.join("");for(let n of Aa){let i=r.indexOf(n);if(i===0)return r=r.slice(i+n.length),{measure:t,ext:n,label:r}}return{measure:t,ext:"",label:r}}return{measure:"",ext:"",label:s}}var Tn={};function Ua(s){let e=Tn[s];return e||(e=ba(s),Tn[s]=e),e}function Z(s,e){return s.__formattedProps?.[e]??s[e]}function Kt(s){if(s===void 0)return;let e=parseFloat(s);return isNaN(e)?void 0:e}function Ea(s,e,t){let r=Ua(e);if(!t[r.measure]){t[r.label]=!0;let n=Kt(s[`${r.measure}Avg${r.label}`]),i=Kt(s[`${r.measure}Min${r.label}`]),o=Kt(s[`${r.measure}Max${r.label}`]),a=Kt(s[`${r.measure}StdDev${r.label}`]),c=Math.max((n-i)/a,(o-n)/a);return{Key:`${r.measure}${r.label}`,Value:Z(s,`${r.measure}${r.label}`),Avg:Z(s,`${r.measure}Avg${r.label}`),Min:Z(s,`${r.measure}Min${r.label}`),Max:Z(s,`${r.measure}Max${r.label}`),Delta:Z(s,`${r.measure}Delta${r.label}`),StdDev:Z(s,`${r.measure}StdDev${r.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:Z(s,`SkewMin${r.label}`),SkewMax:Z(s,`SkewMax${r.label}`),NodeMin:Z(s,`NodeMin${r.label}`),NodeMax:Z(s,`NodeMax${r.label}`)}}return null}var Zt=ha("workunit.ts"),Ls=class extends ma{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},$t=new Ls,we=class s extends fa{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",0)}get State(){return this.get("State")||As[this.StateID]}get Protected(){return this.get("Protected",!1)}get Exceptions(){return this.get("Exceptions",{ECLException:[]})}get ResultViews(){return this.get("ResultViews",{View:[]})}_resultCache=new qt;get ResultCount(){return this.get("ResultCount",0)}get Results(){return this.get("Results",{ECLResult:[]})}get CResults(){return this.Results.ECLResult.map(e=>this._resultCache.get(e,()=>Xt.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new zt(this.connection,this.Wuid,e))}_graphCache=new Lt;get GraphCount(){return this.get("GraphCount",0)}get Graphs(){return this.get("Graphs",{ECLGraph:[]})}get CGraphs(){return this.Graphs.ECLGraph.map(e=>this._graphCache.get(e,()=>new Qt(this,e,this.CTimers)))}get ThorLogList(){return this.get("ThorLogList")}get ResourceURLCount(){return this.get("ResourceURLCount",0)}get ResourceURLs(){return this.get("ResourceURLs",{URL:[]})}get CResourceURLs(){return this.ResourceURLs.URL.map(e=>new vt(this,e))}get TotalClusterTime(){return this.get("TotalClusterTime","")}get DateTimeScheduled(){return this.get("DateTimeScheduled")}get IsPausing(){return this.get("IsPausing")}get ThorLCR(){return this.get("ThorLCR")}get ApplicationValues(){return this.get("ApplicationValues",{ApplicationValue:[]})}get HasArchiveQuery(){return this.get("HasArchiveQuery")}get StateEx(){return this.get("StateEx")}get PriorityClass(){return this.get("PriorityClass")}get PriorityLevel(){return this.get("PriorityLevel")}get Snapshot(){return this.get("Snapshot")}get ResultLimit(){return this.get("ResultLimit")}get EventSchedule(){return this.get("EventSchedule")}get Query(){return this.get("Query")}get HelpersCount(){return this.get("HelpersCount",0)}get Helpers(){return this.get("Helpers",{ECLHelpFile:[]})}get DebugValues(){return this.get("DebugValues")}get AllowedClusters(){return this.get("AllowedClusters")}get ErrorCount(){return this.get("ErrorCount",0)}get WarningCount(){return this.get("WarningCount",0)}get InfoCount(){return this.get("InfoCount",0)}get AlertCount(){return this.get("AlertCount",0)}get SourceFileCount(){return this.get("SourceFileCount",0)}get SourceFiles(){return this.get("SourceFiles",{ECLSourceFile:[]})}get CSourceFiles(){return this.SourceFiles.ECLSourceFile.map(e=>new Jt(this.connection,this.Wuid,e))}get VariableCount(){return this.get("VariableCount",0)}get Variables(){return this.get("Variables",{ECLResult:[]})}get TimerCount(){return this.get("TimerCount",0)}get HasDebugValue(){return this.get("HasDebugValue")}get ApplicationValueCount(){return this.get("ApplicationValueCount",0)}get XmlParams(){return this.get("XmlParams")}get AccessFlag(){return this.get("AccessFlag")}get ClusterFlag(){return this.get("ClusterFlag")}get ResultViewCount(){return this.get("ResultViewCount",0)}get DebugValueCount(){return this.get("DebugValueCount",0)}get WorkflowCount(){return this.get("WorkflowCount",0)}get Archived(){return this.get("Archived")}get RoxieCluster(){return this.get("RoxieCluster")}get DebugState(){return this.get("DebugState",{})}get Queue(){return this.get("Queue")}get Active(){return this.get("Active")}get Action(){return this.get("Action")}get Scope(){return this.get("Scope")}get AbortBy(){return this.get("AbortBy")}get AbortTime(){return this.get("AbortTime")}get AbortReason(){return this.get("AbortReason")}get Workflows(){return this.get("Workflows")}get TimingData(){return this.get("TimingData")}get HelpersDesc(){return this.get("HelpersDesc")}get GraphsDesc(){return this.get("GraphsDesc")}get SourceFilesDesc(){return this.get("SourceFilesDesc")}get ResultsDesc(){return this.get("ResultsDesc")}get VariablesDesc(){return this.get("VariablesDesc")}get TimersDesc(){return this.get("TimersDesc")}get DebugValuesDesc(){return this.get("DebugValuesDesc")}get ApplicationValuesDesc(){return this.get("ApplicationValuesDesc")}get WorkflowsDesc(){return this.get("WorkflowsDesc")}get ServiceNames(){return this.get("ServiceNames")}get CompileCost(){return this.get("CompileCost")}get ExecuteCost(){return this.get("ExecuteCost")}get FileAccessCost(){return this.get("FileAccessCost")}get NoAccess(){return this.get("NoAccess")}get ECLWUProcessList(){return this.get("ECLWUProcessList")}get CostSavingPotential(){return this.get("CostSavingPotential")}get FailureDesc(){return this.get("FailureDesc")}get FileSummaries(){return this.get("FileSummaries")}static create(e){let t=new s(e);return t.connection.WUCreate().then(r=>($t.set(t),t.set(r.Workunit),t))}static attach(e,t,r){let n=$t.get({BaseUrl:e.baseUrl,Wuid:t},()=>new s(e,t));return r&&n.set(r),n}static existsLocal(e,t){return $t.has({BaseUrl:e,Wuid:t})}static submit(e,t,r,n=!1){return s.create(e).then(i=>i.update({QueryText:r})).then(i=>n?i.submit(t,he.Action.Compile):i.submit(t))}static compile(e,t,r){return s.submit(e,t,r,!0)}static query(e,t){return new L(e).WUQuery(t).then(n=>n.Workunits.ECLWorkunit.map(function(i){return s.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new L(e),this.topologyConnection=new G(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:0})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(t=>(this.set(t.Workunit),this))}submit(e,t=he.Action.Run,r){let n;return e!==void 0?n=Promise.resolve(e):n=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===he.Action.Debug&&(t=he.Action.Run,this._debugMode=!0),n.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:r,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===he.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){return this.StateID===999}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(v.ECLWUActions.SetToFailed)}pause(){return this.WUAction(v.ECLWUActions.Pause)}pauseNow(){return this.WUAction(v.ECLWUActions.PauseNow)}resume(){return this.WUAction(v.ECLWUActions.Resume)}abort(){return this.WUAction(v.ECLWUActions.Abort)}protect(){return this.WUAction(v.ECLWUActions.Protect)}unprotect(){return this.WUAction(v.ECLWUActions.Unprotect)}delete(){return this.WUAction(v.ECLWUActions.Delete)}restore(){return this.WUAction(v.ECLWUActions.Restore)}deschedule(){return this.WUAction(v.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(v.ECLWUActions.Reschedule)}recover(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!0}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>s.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={},t,r){return this.WUDetails(e,t,r).then(n=>{switch(r){case"arraybuffer":return n;case"text":case"xsd":return n;default:return n.Scopes.Scope}})}normalizeDetails(e,t){let r={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},n=new Map;for(let o of e.Activities?.Activity??[])n.set(o.Kind,o.Name);let i=new Array(t.length);for(let o=0;o<t.length;o++){let a=t[o],c={},l={};if(a.Properties?.Property)for(let A of a.Properties.Property){let b=A.Measure,P=A.Name,R=A.RawValue;if(b==="ns"&&(A.Measure="s"),P==="Kind"){let S=parseInt(R,10);A.Formatted=n.get(S)??R}switch(r[P]={Name:A.Name,Measure:A.Measure,Creator:A.Creator,CreatorType:A.CreatorType},A.Measure){case"bool":c[P]=!!+R;break;case"sz":c[P]=+R;break;case"s":c[P]=+R/1e9;break;case"ns":c[P]=+R;break;case"ts":c[P]=new Date(+R/1e3).toISOString();break;case"cnt":c[P]=+R;break;case"cost":c[P]=+R/1e6;break;case"node":c[P]=+R;break;case"skw":c[P]=+R;break;default:c[P]=R}l[P]=Ca(A.Formatted??c[P])}let u={id:a.Id,name:a.ScopeName,type:a.ScopeType,Kind:a.Kind,Label:a.Label,__formattedProps:l,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},g=u[Pn];if(g)try{let A=JSON.parse(g.split("\\").join("\\\\")),b=[];for(let P=0;P<A.length;P++){let R=A[P].match(xa);R&&b.push({filePath:(R[1]??"")+R[2]+R[3],line:parseInt(R[5],10),col:parseInt(R[6],10)})}u[Pn]=b}catch{Zt.error(`Unexpected "DefinitionList": ${g}`)}let p={},f=0,D="";for(let A in u)if(!A.startsWith("__")){let b=Ea(u,A,p);b&&(u.__groupedProps[b.Key]=b,!isNaN(b.StdDevs)&&b.StdDevs>f&&(f=b.StdDevs,D=b.Key))}u.__StdDevs=f,u.__StdDevsSource=D,i[o]=u}return{meta:e,columns:r,data:i}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={},t,r){return this.WUDetails(e,t,r).then(n=>{switch(r){case"arraybuffer":return n;case"text":case"xsd":return n;default:return n.Scopes.Scope.map(i=>new tt(this,i))}})}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let r=[],n={};t.Scopes.Scope.forEach(i=>{if(n[i.ScopeName])return n[i.ScopeName].update(i),null;{let o=new tt(this,i);return n[o.ScopeName]=o,o}});for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],a=o.parentScope();a&&n[a]?n[a].children().push(o):r.push(o)}return r})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>kt(t))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let t={};e.forEach(n=>{t[n.ScopeName]=t[n.ScopeName]||{scope:n.ScopeName,start:null,elapsed:null,finish:null},n.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?t[n.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(t[n.ScopeName].start=i.Formatted)})});let r=[];for(let n in t){let i=t[n];if(i.start&&i.elapsed){let o=Da(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Sa(o),r.push(i)}}return r.sort((n,i)=>n.start<i.start?-1:n.start>i.start?1:0),r})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,r){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",n=>{this.isComplete()&&t([n])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,r);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,r)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,r)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(t.Workunits.ECLWorkunit.length===0?(this.clearState(this.Wuid),this.set("StateID",999)):this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(n=>n.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Zt.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),$t.set(this),e))}WUInfo(e={}){let t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(r=>(this.set(r.Workunit),t&&this.set({ResultViews:r.ResultViews}),r)).catch(r=>{if(!r.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Zt.warning(`Unexpected ESP exception: ${r.message}`),r;return{}})}WUResubmit(e){return this.connection.WUResubmit(In({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e,t,r){return this.connection.WUDetailsEx(In({ScopeFilter:{MaxDepth:9999},ScopeOptions:{IncludeMatchedScopesInResults:!0,IncludeScope:!0,IncludeId:!1,IncludeScopeType:!1},PropertyOptions:{IncludeName:!0,IncludeRawValue:!1,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},e,{WUID:this.Wuid}),t,r).then(n=>{switch(r){case"arraybuffer":case"text":case"xsd":return n;default:return n.Scopes===void 0?n.Scopes={Scope:[]}:n.Scopes.Scope===void 0&&(n.Scopes.Scope=[]),n}})}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:v.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new Bt({baseUrl:""}),r={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(r)}WUCDebug(e,t={}){let r="";for(let n in t)t.hasOwnProperty(n)&&(r+=` ${n}='${t[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${r}/>`}).then(n=>n)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(r=>{let n=r.children(e);return n.length?n[0]:new Qs(e)}).catch(r=>(Zt.error(r),Promise.resolve(new Qs(e)))):Promise.resolve(new Qs(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(t=>{if(t.name==="break")return t.$})}debugBreakpointAdd(e,t,r){return this.debug("breakpoint",{id:e,mode:t,action:r}).then(n=>this.debugBreakpointResponseParser(n))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=Un(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Pa(t,e))}debugPrint(e,t=0,r=10){return this.debug("print",{edgeID:e,startRow:t,numRows:r}).then(n=>n.children().map(i=>{let o={};return i.children().forEach(a=>{o[a.name]=a.content}),o}))}},Gs="definition";function Fa(s){return s._[Gs]!==void 0}function Ia(s){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(s._[Gs]);if(e){let[,t,r,n]=e;return t.replace(/\/\.\//g,"/"),{id:s._.id,file:t,line:+r,column:+n}}throw new Error(`Bad definition: ${s._[Gs]}`)}function Pa(s,e){let t=[];for(let r of s.vertices)if(Fa(r)){let n=Ia(r);(n&&!e||e===n.file)&&t.push(n)}return t.sort((r,n)=>r.line-n.line)}var es,Mn=class s extends Ma{connection;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get Build(){return this.get("Build")}get ThorClusterList(){return this.get("ThorClusterList")}get RoxieClusterList(){return this.get("RoxieClusterList")}get HThorClusterList(){return this.get("HThorClusterList")}get DFUJobs(){return this.get("DFUJobs")}get Running(){return this.get("Running",{ActiveWorkunit:[]})}get BannerContent(){return this.get("BannerContent")}get BannerColor(){return this.get("BannerColor")}get BannerSize(){return this.get("BannerSize")}get BannerScroll(){return this.get("BannerScroll")}get ChatURL(){return this.get("ChatURL")}get ShowBanner(){return this.get("ShowBanner")}get ShowChatURL(){return this.get("ShowChatURL")}get SortBy(){return this.get("SortBy")}get Descending(){return this.get("Descending")}get SuperUser(){return this.get("SuperUser")}get AccessRight(){return this.get("AccessRight")}get ServerJobQueues(){return this.get("ServerJobQueues")}get ActivityTime(){return this.get("ActivityTime")}get DaliDetached(){return this.get("DaliDetached")}static attach(e,t){return es||(es=new s(e)),t&&es.set(t),es}constructor(e){super(),e instanceof ze?this.connection=e:this.connection=new ze(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>we.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=Ta(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as wa,scopedLogger as Ba,StateObject as Na}from"@hpcc-js/util";var Qa=Ba("logicalFile.ts"),ks=class extends wa{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},La=new ks,wn=class s extends Na{connection;get BaseUrl(){return this.connection.baseUrl}get Cluster(){return this.get("Cluster")}get Name(){return this.get("Name")}get Filename(){return this.get("Filename")}get Prefix(){return this.get("Prefix")}get NodeGroup(){return this.get("NodeGroup")}get NumParts(){return this.get("NumParts")}get Description(){return this.get("Description")}get Dir(){return this.get("Dir")}get PathMask(){return this.get("PathMask")}get Filesize(){return this.get("Filesize")}get FileSizeInt64(){return this.get("FileSizeInt64")}get RecordSize(){return this.get("RecordSize")}get RecordCount(){return this.get("RecordCount")}get RecordSizeInt64(){return this.get("RecordSizeInt64")}get RecordCountInt64(){return this.get("RecordCountInt64")}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner")}get JobName(){return this.get("JobName")}get Persistent(){return this.get("Persistent")}get Format(){return this.get("Format")}get MaxRecordSize(){return this.get("MaxRecordSize")}get CsvSeparate(){return this.get("CsvSeparate")}get CsvQuote(){return this.get("CsvQuote")}get CsvTerminate(){return this.get("CsvTerminate")}get CsvEscape(){return this.get("CsvEscape")}get Modified(){return this.get("Modified")}get Ecl(){return this.get("Ecl")}get Stat(){return this.get("Stat")}get DFUFilePartsOnClusters(){return this.get("DFUFilePartsOnClusters")}get isSuperfile(){return this.get("isSuperfile")}get ShowFileContent(){return this.get("ShowFileContent")}get subfiles(){return this.get("subfiles")}get Superfiles(){return this.get("Superfiles")}get ProtectList(){return this.get("ProtectList")}get FromRoxieCluster(){return this.get("FromRoxieCluster")}get Graphs(){return this.get("Graphs")}get UserPermission(){return this.get("UserPermission")}get ContentType(){return this.get("ContentType")}get CompressedFileSize(){return this.get("CompressedFileSize")}get PercentCompressed(){return this.get("PercentCompressed")}get IsCompressed(){return this.get("IsCompressed")}get BrowseData(){return this.get("BrowseData")}get jsonInfo(){return this.get("jsonInfo")}get binInfo(){return this.get("binInfo")}get PackageID(){return this.get("PackageID")}get Partition(){return this.get("Partition")}get Blooms(){return this.get("Blooms")}get ExpireDays(){return this.get("ExpireDays")}get KeyType(){return this.get("KeyType")}get IsRestricted(){return this.get("IsRestricted")}get AtRestCost(){return this.get("AtRestCost")}get AccessCost(){return this.get("AccessCost")}get StateID(){return this.get("StateID")}get ExpirationDate(){return this.get("ExpirationDate")}get ExtendedIndexInfo(){return this.get("ExtendedIndexInfo")}get CompressionType(){return this.get("CompressionType")}get properties(){return this.get()}static attach(e,t,r,n){let i=La.get({BaseUrl:e.baseUrl,Cluster:t,Name:r},()=>new s(e,t,r));return n&&i.set(n),i}constructor(e,t,r){super(),e instanceof He?this.connection=e:this.connection=new He(e),this.clear({Cluster:t,Name:r})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let r of t?.DFUFileParts?.DFUPart||[]){let n={...t,...r};delete n.DFUFileParts,e.push(n)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail,ProtectList:e?.FileDetail?.ProtectList??{DFUFileProtect:[]}}),e.FileDetail)).catch(e=>{if(!e.Exception.some(r=>r.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw Qa.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchAllLogicalFiles(){return this.connection.recursiveFetchLogicalFiles([this])}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};import{Cache as Ga,StateObject as ka}from"@hpcc-js/util";var vs=class extends Ga{constructor(){super(e=>e.Address)}},va=new vs,ts=class s extends ka{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,r){let n=va.get({Address:t},()=>new s(e));return r&&n.set(r),n}constructor(e){super(),e instanceof re?this.connection=e:this.connection=new re(e)}};import{Cache as Nn,StateObject as za,scopedLogger as Ka}from"@hpcc-js/util";import{Cache as _a,exists as Bn,StateObject as Oa}from"@hpcc-js/util";import{Cache as Va,StateObject as Ha}from"@hpcc-js/util";var Hs=class extends Va{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},ja=new Hs,Be=class s extends Ha{connection;machineConnection;get BaseUrl(){return this.connection.baseUrl}get Name(){return this.get("Name")}get Prefix(){return this.get("Prefix")}get Type(){return this.get("Type")}get IsDefault(){return this.get("IsDefault")}get TpClusters(){return this.get("TpClusters")}get TpEclCCServers(){return this.get("TpEclCCServers")}get TpEclServers(){return this.get("TpEclServers")}get TpEclAgents(){return this.get("TpEclAgents")}get TpEclSchedulers(){return this.get("TpEclSchedulers")}get MachineInfoEx(){return this.get("MachineInfoEx",[])}get CMachineInfoEx(){return this.MachineInfoEx.map(e=>ts.attach(this.machineConnection,e.Address,e))}static attach(e,t,r){let n=ja.get({BaseUrl:e.baseUrl,Name:t},()=>new s(e,t));return r&&n.set(r),n}constructor(e,t){super(),e instanceof G?(this.connection=e,this.machineConnection=new re(e.connectionOptions())):(this.connection=new G(e),this.machineConnection=new re(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let r=[];for(let n of t.TargetClusterInfoList.TargetClusterInfo)for(let i of n.Processes.MachineInfoEx)r.push(i);return this.set("MachineInfoEx",r),this.CMachineInfoEx})}machineStats(){let e=0,t=0,r=0;for(let n of this.CMachineInfoEx)for(let i of n.Storage.StorageInfo){t+=i.Available,r+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(r?t/r:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function Vg(s){let e;return s instanceof G?e=s:e=new G(s),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(r=>Be.attach(s,r.Name,r)))}var Vs={};function Hg(s){if(!Vs[s.baseUrl]){let e;s instanceof G?e=s:e=new G(s),Vs[s.baseUrl]=e.TpListTargetClusters({}).then(t=>{let r,n,i;t.TargetClusters.TpClusterNameType.forEach(a=>{r||(r=a),!n&&a.IsDefault===!0&&(n=a),!i&&a.Type==="hthor"&&(i=a)});let o=n||i||r;return Be.attach(s,o.Name,o)})}return Vs[s.baseUrl]}var js=class extends _a{constructor(){super(e=>e.BaseUrl)}},Ya=new js,ss=class s extends Oa{connection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get TargetClusters(){return this.get("TargetClusters")}get CTargetClusters(){return this.TargetClusters.map(e=>Be.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let r=Ya.get({BaseUrl:e.baseUrl},()=>new s(e));return t&&r.set(t),r}constructor(e){super(),e instanceof G?this.connection=e:this.connection=new G(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let r=this.connection.protocol(),n=this.connection.ip(),i=r==="https:"?"18002":"8002";if(Bn("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if(Bn("TpBindings.TpBinding",o))for(let a of o.TpBindings.TpBinding)a.Service===e&&a.Protocol+":"===r&&(i=a.Port)}return`${r}//${n}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,r){return this.isCallback(t)?e==="changed"&&super.on(e,t):e==="changed"&&super.on(e,t,r),this._monitor(),this}};function oe(s,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(s[e]=t)}function st(s){return s=""+s,s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;").replace(/\r/g,"&#13;")}function Xa(s){if(s){if(!isNaN(+s))return parseFloat(s)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(s);if(!t)return 0;let r=+t[1]||0,n=+t[2]||0,i=+t[3]||0,o=+t[4]||0,a=+t[5]||0,c=+t[6]||0,l=+t[7]||0;return r*24*60*60+n*60*60+i*60+o+a/1e3+c/1e6+l/1e9}function ae(s,e){let t=s.indexOf(e);return t!==-1?parseFloat(s.substring(0,t)):-1}function qa(s){if(s){if(!isNaN(+s))return parseFloat(s)}else return 0;let e=ae(s,"Kb");return e>=0?e*1024:(e=ae(s,"Mb"),e>=0?e*Math.pow(1024,2):(e=ae(s,"Gb"),e>=0?e*Math.pow(1024,3):(e=ae(s,"Tb"),e>=0?e*Math.pow(1024,4):(e=ae(s,"Pb"),e>=0?e*Math.pow(1024,5):(e=ae(s,"Eb"),e>=0?e*Math.pow(1024,6):(e=ae(s,"Zb"),e>=0?e*Math.pow(1024,7):(e=ae(s,"b"),e>=0?e:0)))))))}function Ja(s){return s?parseFloat(s):0}var _s=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,r,n){this.noSpills=n,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,r),this.calcOutVertexVisibility(i,r)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),r-1),this.calcOutVertexVisibility(i.getTarget(),r-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(r=>{this.calcInVertexVisibility(r.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(r=>{this.calcOutVertexVisibility(r.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((n,i)=>{this.calcSubgraphVisibility(n,t-1)}),e.__hpcc_subgraphs.forEach((n,i)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n}),e.__hpcc_vertices.forEach((n,i)=>{this.m_visibleVertices[n.__hpcc_id]=n});let r={};this.graph.edges.forEach((n,i)=>{n.getSource().__hpcc_parent!==n.getTarget().__hpcc_parent&&e===this.getCommonAncestor(n)&&(r[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]||(r[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[n.__hpcc_id]=n))})}buildVertexString(e,t){let r="",n="",i=e.getProperties();for(let o in i)t&&o.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':o==="id"||o==="label"?r+=" "+o+'="'+st(i[o])+'"':n+='<att name="'+o+'" value="'+st(i[o])+'"/>';return"<node"+r+">"+n+"</node>"}buildEdgeString(e){let t="",r="",n=e.getProperties();for(let i in n)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+st(n[i])+'"':r+='<att name="'+i+'" value="'+st(n[i])+'"/>';return"<edge"+t+">"+r+"</edge>"}getAncestors(e,t){let r=e.__hpcc_parent;for(;r;)t.push(r),r=r.__hpcc_parent}getCommonAncestorV(e,t){let r=[],n=[];this.getAncestors(e,r),this.getAncestors(t,n);let i=r.length-1,o=n.length-1,a=null;for(;i>=0&&o>=0&&r[i]===n[o];)a=r[i],--i,--o;return a}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((r,n)=>{this.m_visibleSubgraphs[r.__hpcc_id]=r})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((r,n)=>{this.m_visibleEdges[r.__hpcc_id]=r}),t.getOutEdges().forEach((r,n)=>{this.m_visibleEdges[r.__hpcc_id]=r}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],r=t.getSource();for(this.addSemiVisibleVertex(r);this.noSpills&&r.isSpill();){let i=r.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),r=i[0].getSource(),this.addSemiVisibleVertex(r);else break}let n=t.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getTarget(),this.addSemiVisibleVertex(n);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let r="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)r+='<att name="'+o+'" value="'+st(i[o])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+r+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},rt=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf("__")!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},ce=class extends rt{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType=t==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,r)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,r)=>{e.vertexVisited(t)})}},De=class extends rt{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(t=>{t.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},Re=class extends rt{_globalType="Edge";_sourceActivity;source;_targetActivity;target;constructor(e,t){super(e,t),this._globalType="Edge"}remove(){this.__hpcc_graph.subgraphs.forEach(e=>{e.removeEdge(this)}),this.__hpcc_graph.removeItem(this)}getSource(){return this.__hpcc_graph.idx[this._sourceActivity||this.source]}setSource(e){this._sourceActivity?this._sourceActivity=e.__hpcc_id:this.source&&(this.source=e.__hpcc_id),this.__widget&&this.__widget.setSource(this.getSource().__widget)}getTarget(){return this.__hpcc_graph.idx[this._targetActivity||this.target]}},rs=class s{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;let r=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(r.documentElement,"0")}isSubgraph(e){return e instanceof ce}isVertex(e){return e instanceof De}isEdge(e){return e instanceof Re}getGlobalType(e){return e instanceof De?3:e instanceof Re?4:e instanceof ce?2:e instanceof s?1:0}getGlobalTypeString(e){return e instanceof De?"Vertex":e instanceof Re?"Edge":e instanceof ce?"Cluster":e instanceof s?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let n=new ce(this,t);this.subgraphs.push(n),this.idx[t]=n;break;case"node":let i=new De(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new Re(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let r=this.idx[t];return Array.from(e.attributes).forEach(n=>{oe(r,n.name,n.value)}),r}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof ce?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof De?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Re&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let r=null;return Array.from(e.childNodes).some(n=>{if(n.tagName===t)return r=n,!0}),r}walkDocument(e,t){let r=this.getItem(e,t);return e.childNodes.forEach(n=>{switch(n.nodeType){case 1:switch(n.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(n,"att");if(o){let g=this.getChildByTagName(o,"graph");if(g){i=!0;let p=this.walkDocument(g,n.getAttribute("id"));r.addSubgraph(p)}}if(!i){let g=this.walkDocument(n,n.getAttribute("id"));r.addVertex(g)}break;case"att":let a=n.getAttribute("name"),c="_"+a,l=n.getAttribute("value");a.indexOf("Time")===0?(oe(r,c,l),oe(r,a,""+Xa(l))):a.indexOf("Size")===0?(oe(r,c,l),oe(r,a,""+qa(l))):a.indexOf("Skew")===0?(oe(r,c,l),oe(r,a,""+Ja(l))):oe(r,a,l);break;case"edge":let u=this.walkDocument(n,n.getAttribute("id"));if(u.NumRowsProcessed!==void 0?u._eclwatchCount=u.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):u.Count!==void 0?u._eclwatchCount=u.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):u.count!==void 0&&(u._eclwatchCount=u.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),u.inputProgress&&(u._eclwatchInputProgress="["+u.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),u.SkewMaxRowsProcessed&&u.SkewMinRowsProcessed&&(u._eclwatchSkew="+"+u.SkewMaxRowsProcessed+", "+u.SkewMinRowsProcessed),!u._dependsOn){if(!u._childGraph){if(u._sourceActivity||u._targetActivity){u._isSpill=!0;let g=u.getSource();g&&(g._isSpill=!0);let p=u.getTarget();p&&(p._isSpill=!0)}}}r.addEdge(u);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),r}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof ce&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,r,n){let i=new _s(this);return i.calcVisibility(e,t,r,n),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var ns=Ka("@hpcc-js/comms/ecl/query.ts"),Za=Me("~s");function $a(s){return!isNaN(parseFloat(s))&&!isNaN(s-0)}var Os=class extends Nn{constructor(){super(e=>Nn.hash([e.QueryId,e.QuerySet]))}},ec=new Os,Qn=class s extends za{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,r,n){super(),e instanceof L?this.wsWorkunitsService=e:this.wsWorkunitsService=new L(e),this.topology=ss.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:r,...n})}static attach(e,t,r,n){let i=ec.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:r},()=>new s(e,t,r));return n&&i.set(n),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let r of t?.TpBindings?.TpBinding??[])if(r?.Service==="ws_ecl"){let n=`${r.Protocol}://${globalThis.location.hostname}:${r.Port}`;return new Ct({baseUrl:n})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(t){ns.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(t){ns.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(r=>{let n=new rs,i=!0;for(let o of r?.Graphs?.ECLGraphEx||[])i?(n.load(o.Graph),i=!1):n.merge(o.Graph);return n})}fetchDetailsNormalized(e={}){let t=we.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(r=>{let n=r[0],i=r[1],a=r[2].map(c=>{let l=c.Id[0];if(l==="a"||l==="e"){let u=n.idx[c.Id.substring(1)];if(!u)return ns.debug(`Missing graph data for metric ID: ${c.Id}`),c;let g=new Set(c.Properties.Property.map(f=>f.Name)),p=[];for(let f in u){let D=f.charAt(0);if(D!=="_"&&D===D.toUpperCase()&&!g.has(f)){let A=u[f],b=typeof A;if(b==="string"||b==="number"||b==="boolean"){let R=$a(A)?parseFloat(A):A,S=A;f.indexOf("Time")>=0&&(R=R/1e9,S=Za(R)+"s"),p.push({Name:f,RawValue:R,Formatted:S})}}}p.length>0&&c.Properties.Property.push(...p)}return c});return t.normalizeDetails(i,a)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(r=>{for(let n in r)r[n]=r[n].Row;return r})??[]}catch(r){return ns.debug(r.message??r),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};import{Cache as tc,Dispatch as sc,Message as rc}from"@hpcc-js/util";var Ys=class extends tc{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},nc=new Ys,Ce=class extends rc{constructor(t,r,n){super();this.key=t;this.value=r;this.oldValue=n}key;value;oldValue;get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},Ln=class s{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new sc;static attach(e,t="HPCCApps",r,n=!0){return nc.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:n,Namespace:r},()=>new s(e,t,r,n))}constructor(e,t,r,n){e instanceof Ke?this.connection=e:this.connection=new Ke(e),this.Name=t,this.UserSpecific=n,this.Namespace=r}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,r=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(n=>{let i=this._knownValues[e];this._knownValues[e]=t,r&&this._dispatch.post(new Ce(e,t,i))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(r=>{let n=this._knownValues[e];return this._knownValues[e]=r.Value,t&&this._dispatch.post(new Ce(e,r.Value,n)),r.Value}).catch(r=>{console.error(`Store.get(${e}) failed:`,r)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let r={},n=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete n[i.Key],r[i.Key]=i.Value,e&&this._dispatch.post(new Ce(i.Key,i.Value,o))}),e)for(let i in n)this._dispatch.post(new Ce(i,void 0,n[i]));return r}).catch(t=>(console.error("Store.getAll failed:",t),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(r=>{let n=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new Ce(e,void 0,n))}).catch(r=>{console.error(`Store.delete(${e}) failed:`,r)})}monitor(e){return this._dispatch.attach(e)}};import{Cache as ic,scopedLogger as oc,StateObject as ac}from"@hpcc-js/util";var cc=oc("@hpcc-js/comms/dfuWorkunit.ts");var Xs=class extends ic{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Gn=new Xs,kn=class s extends ac{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}get properties(){return this.get()}get ID(){return this.get("ID")}get DFUServerName(){return this.get("DFUServerName")}get ClusterName(){return this.get("ClusterName")}get JobName(){return this.get("JobName")}get Queue(){return this.get("Queue")}get User(){return this.get("User")}get isProtected(){return this.get("isProtected")}get Command(){return this.get("Command")}get CommandMessage(){return this.get("CommandMessage")}get PercentDone(){return this.get("PercentDone")}get SecsLeft(){return this.get("SecsLeft")}get ProgressMessage(){return this.get("ProgressMessage")}get SummaryMessage(){return this.get("SummaryMessage")}get State(){return this.get("State",0)}get SourceLogicalName(){return this.get("SourceLogicalName")}get SourceIP(){return this.get("SourceIP")}get SourceFilePath(){return this.get("SourceFilePath")}get SourceDali(){return this.get("SourceDali")}get SourceRecordSize(){return this.get("SourceRecordSize")}get SourceFormat(){return this.get("SourceFormat")}get RowTag(){return this.get("RowTag")}get SourceNumParts(){return this.get("SourceNumParts")}get SourceDirectory(){return this.get("SourceDirectory")}get DestLogicalName(){return this.get("DestLogicalName")}get DestGroupName(){return this.get("DestGroupName")}get DestDirectory(){return this.get("DestDirectory")}get DestIP(){return this.get("DestIP")}get DestFilePath(){return this.get("DestFilePath")}get DestFormat(){return this.get("DestFormat")}get DestNumParts(){return this.get("DestNumParts")}get DestRecordSize(){return this.get("DestRecordSize")}get Replicate(){return this.get("Replicate")}get Overwrite(){return this.get("Overwrite")}get Compress(){return this.get("Compress")}get SourceCsvSeparate(){return this.get("SourceCsvSeparate")}get SourceCsvQuote(){return this.get("SourceCsvQuote")}get SourceCsvTerminate(){return this.get("SourceCsvTerminate")}get SourceCsvEscape(){return this.get("SourceCsvEscape")}get TimeStarted(){return this.get("TimeStarted")}get TimeStopped(){return this.get("TimeStopped")}get StateMessage(){return this.get("StateMessage")}get StateReason(){return this.get("StateReason")}get MonitorEventName(){return this.get("MonitorEventName")}get MonitorSub(){return this.get("MonitorSub")}get MonitorShotLimit(){return this.get("MonitorShotLimit")}get SourceDiffKeyName(){return this.get("SourceDiffKeyName")}get DestDiffKeyName(){return this.get("DestDiffKeyName")}get Archived(){return this.get("Archived")}get encrypt(){return this.get("encrypt")}get decrypt(){return this.get("decrypt")}get failIfNoSourceFile(){return this.get("failIfNoSourceFile")}get recordStructurePresent(){return this.get("recordStructurePresent")}get quotedTerminator(){return this.get("quotedTerminator")}get preserveCompression(){return this.get("preserveCompression")}get expireDays(){return this.get("expireDays")}get PreserveFileParts(){return this.get("PreserveFileParts")}get FileAccessCost(){return this.get("FileAccessCost")}get KbPerSecAve(){return this.get("KbPerSecAve")}get KbPerSec(){return this.get("KbPerSec")}static create(e,t){let r=new s(e);return r.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(n=>(Gn.set(r),r.set(n.result),r))}static attach(e,t,r){let n=Gn.get({BaseUrl:e.baseUrl,ID:t},()=>new s(e,t));return r&&n.set(r),n}static sprayFixed(e,t){let r=new ge(e);return r.SprayFixedEx({...t}).then(n=>{let i=n.wuid;return r.GetDFUWorkunit({wuid:i}).then(o=>s.attach(e,i,o.result))})}static sprayVariable(e,t){let r=new ge(e);return r.SprayVariableEx({...t}).then(n=>{let i=n.wuid;return r.GetDFUWorkunit({wuid:i}).then(o=>s.attach(e,i,o.result))})}static despray(e,t){let r=new ge(e);return r.DesprayEx({...t}).then(n=>{let i=n.wuid;return r.GetDFUWorkunit({wuid:i}).then(o=>s.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){return this.State===999}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(Ve.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(t=>t).catch(t=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===Ve.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,r){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",n=>{this.isComplete()&&t([n])});break;case"changed":super.on(e,t);break;default:}else e==="changed"&&super.on(e,t,r);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,r)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,r)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}constructor(e,t){super(),this.connection=new ge(e),this.topologyConnection=new G(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(t=>(this.set(t.result),t)).catch(t=>{if(!t.Exception.some(n=>n.Code===20080||n.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw cc.warning(`Unexpected ESP exception: ${t.message}`),t;return{}})}};import*as zn from"node:child_process";import*as Kn from"node:crypto";import*as k from"node:fs";import*as se from"node:os";import*as V from"node:path";import{exists as Dc,scopedLogger as Rc,xml2json as Cc}from"@hpcc-js/util";import*as xe from"node:fs";import*as w from"node:path";import{Dictionary as Vn,DictionaryNoCase as vn,find as uc,SAXStackParser as lc,scopedLogger as pc,XMLNode as gc}from"@hpcc-js/util";var dc=pc("clienttools/eclmeta"),mc=!1;function Ne(s,e,t){if(mc){for(let r in s){let n=`${e}.${r}`;r!=="$"&&t[r]===void 0&&t[r.toLowerCase()+"s"]===void 0&&dc.debug(n)}s.$&&Ne(s.$,e+".$",t)}}var Js=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},zs=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,t){this.__attrs=t.$,this.definition=e,this.name=t.$.name,this.type=t.$.type}},Qe=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,r,n,i=1,o=0,a=0,c=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=w.normalize(r),this.line=+i-1,this.start=+o,this.body=+a,this.end=+c,this.definitions=this.parseDefinitions(n)}parseDefinitions(e=[]){return e.map(t=>{let r=new Ks(this.sourcePath,t);return Ne(t,"definition",r),r})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let t=[];return this.contains(e)&&(t.push(this),this.definitions.forEach(r=>{t=r.scopeStackAt(e).concat(t)})),t}_resolve(e=[],t){let r=t.split("."),n=r.shift(),i=uc(e,o=>typeof o.name=="string"&&typeof n=="string"&&o.name.toLowerCase()===n.toLowerCase());return i&&i.definitions.length&&r.length?this._resolve(i.definitions,r.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Ks=class extends Qe{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,t){super(t.$.name,t.$.type,e,t.children("Definition"),t.$.line,t.$.start,t.$.body,t.$.end),this.__attrs=t.$,this.exported=!!t.$.exported,this.shared=!!t.$.shared,this.fullname=t.$.fullname,this.inherittype=t.$.inherittype,this.attrs=this.parseAttrs(t.children("Attr")),this.fields=this.parseFields(t.children("Field"))}parseAttrs(e=[]){return e.map(t=>{let r=new Js(t);return Ne(t,"attr",r),r})}parseFields(e=[]){return e.map(t=>{let r=new zs(this,t);return Ne(t,"field",r),r})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},is=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},Zs=class extends Qe{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let t=e.$.name.split(".");t.pop();let r=new gc("");r.appendAttribute("name","$"),r.appendAttribute("ref",t.join(".")),this.imports=[new is(r),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let r=new is(t);return Ne(t,"import",r),r})}resolve(e,t){let r;return!r&&t!==void 0&&this.scopeStackAt(t).some(i=>(r=i.resolve(e),!!r)),r||(r=super.resolve(e)),r}},hc=s=>w.basename(s).indexOf(".")===0,Hn=s=>xe.lstatSync(s).isDirectory()&&!hc(s),fc=s=>[".ecl",".ecllib"].indexOf(w.extname(s).toLowerCase())>=0,jn=s=>xe.readdirSync(s).map(e=>w.join(s,e)).filter(e=>Hn(e)||fc(e)),$s=class extends Qe{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},er=class extends Qe{constructor(e,t){super(e,"folder",t,[])}suggestions(){return jn(this.sourcePath).map(e=>({name:w.basename(e,".ecl"),type:"folder"}))}},tr=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new vn;_sourceByPath=new Vn;_test=new vn;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return _n(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let t of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[t]&&xe.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){xe.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,r=!1){for(let n of jn(e))Hn(n)?this.visitFolder(n,t,r):this.visitFile(n,t,r)}visitFile(e,t,r=!1){let n=w.parse(e),i=w.join(n.dir,n.name),o=w.relative(t,i).split(w.sep).join(".");(r||!this._test.has(o))&&this._test.set(o,new $s("",e))}visitFolder(e,t,r=!1){let n=w.relative(t,e).split(w.sep).join(".");(r||!this._test.has(n))&&(this._test.set(n,new er(n,e)),this.walkChildFolders(e,t,r))}buildStack(e,t,r){let n=t.split(".");r&&e[e.length-1]===n[0]&&n.shift();let i=[...e,...n],o=i.join(".");return{stack:i,qid:o}}walkECLScope(e,t){let r=this.buildStack(e,t.name,!0);this._test.set(r.qid,t);for(let n of t.definitions)this.walkDefinition(r.stack,n)}walkField(e,t){let r=this.buildStack(e,t.name,!1);this._test.set(r.qid,t)}walkDefinition(e,t){let r=this.buildStack(e,t.name,!0);this.walkECLScope(e,t);for(let n of t.fields)this.walkField(r.stack,n)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let t of e)if(t.$.name){let r=new Zs(t);if(Ne(t,"source",r),this._sourceByID.set(r.name,r),this._sourceByPath.set(r.sourcePath,r),r.name){let i=r.name.split(".").length;if(i>1){let o=r.sourcePath;for(;i>1;)o=w.dirname(o),--i;this.visitFolder(o,w.dirname(o))}}this.walkSource(r)}}parseMetaXML(e){let t=new sr;return t.parse(e),this.parseSources(t.sources),t.sources.map(r=>w.normalize(r.$.sourcePath))}resolveQualifiedID(e,t,r){let n;if(!n&&this._test.has(t)&&(n=this._test.get(t).scope),!n&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let c of i.imports)if(c.name.toLowerCase()===o[0].toLowerCase()){c.ref?o[0]=c.ref:o.shift();break}let a=o.join(".");!n&&this._test.has(a)&&(n=this._test.get(a).scope),n||(a=[...i.name.split("."),...o].join("."),this._test.has(a)&&(n=this._test.get(a).scope))}return n}resolvePartialID(e,t,r){t=t.toLowerCase();let n=t.split(".");n.pop();let i=n.length===1?n[0]:n.join(".");return this.resolveQualifiedID(e,i,r)}},qs=new Vn;function Ae(s,e){let t=w.normalize(s);if(!qs.has(t)){let r=new tr(t,e);qs.set(t,r),r.refresh()}return qs.get(t)}function Sc(s,e,t){if(e<0)return!1;let r=s.charAt(e);return(t?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(r)}function dm(s,e,t){for(;Sc(s,e,t);)e+=t?-1:1;return e+(t?1:-1)}var sr=class extends lc{sources=[];endXMLNode(e){e.name==="Source"&&this.sources.push(e),super.endXMLNode(e)}};var Le=Rc("clienttools/eclcc"),rr=se.type()==="Windows_NT"?".exe":"";function On(s){return s.split(`\r
916
916
  `).join(`
917
917
  `).split("\r").join(`
918
- `)}var Ut=class{prefix="";major=0;minor=0;patch=0;postfix="";constructor(e){let t=e.split(" ");if(t.length){let s=/(?:(\w+)_)?(\d+)\.(\d+)\.(\d+)(?:-(.*))?/.exec(t[t.length-1]);s&&(this.prefix=s[1]||"",this.major=+s[2]||0,this.minor=+s[3]||0,this.patch=+s[4]||0,this.postfix=s[5]||"")}}parse(e){}exists(){return this.major!==0||this.minor!==0||this.patch!==0||this.postfix!==""}compare(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch?-1:this.postfix===""&&e.postfix!==""?1:this.postfix.localeCompare(e.postfix)}toString(){return`${this.prefix}_${this.major}.${this.minor}.${this.patch}-${this.postfix}`}},_r="error",Yr="warning",Bs=class{_checked;errWarn=[];errOther=[];constructor(e){this._checked=e}checked(){return this._checked}all(){return this.errWarn}errors(){return this.errWarn.filter(e=>e.severity===_r)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===Yr)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[_r,Yr].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},Qs=class extends Bs{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(Te.EOL)){let r=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(s);if(r){let[,i,o,c,d,C,l]=r,E=+o,A=+c,P=C+": "+l;this.errWarn.push({filePath:i,line:E,col:A,msg:P,severity:d});continue}if(r=/(error|warning|info): (.*)/i.exec(s),r){let[,i,o]=r;this.errWarn.push({filePath:"",line:0,col:0,msg:o,severity:i});continue}r=/\d error(s?), \d warning(s?)/.exec(s),!r&&(lt.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},xn=class extends Bs{_lines;constructor(e,t,s){super(s);let r=pe.readFileSync(e,"utf8");if(r=r.replace(/\r\n/g,`
919
- `),this._lines=r.split(`
920
- `),t&&t.length)for(let i of t.split(Te.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,c,d,C,l]=o,E=`${d} ${C||""}: ${l}`,[A,P]=this.locate(d);this.errWarn.push({filePath:e,line:A,col:P,msg:E,severity:c});continue}o||(lt.warning(`parseECLErrors: Unable to parse "${i}"`),this.errOther.push(i))}this._checked=s}locate(e){let t=e.split("/");if(t.length&&t[0]===""&&t.shift(),t.length>0){let s=0;for(let r of this._lines){let i="<"+t[0];if((r.indexOf(i+" ")>=0||r.indexOf(i+">")>=0)&&(t.shift(),t.length===0))return[s+1,r.indexOf(i)+1];++s}}return[0,0]}};function bn(n,e,t){t=t||[],t.push(n);for(let s in n)if(n.hasOwnProperty(s)){let r=n[s];e(s,r,t),r instanceof Array?r.forEach(i=>{bn(i,e,t)}):typeof r=="object"&&bn(r,e,t)}t.pop()}var Un=class{jsonWU;constructor(e){this.jsonWU=e}bpGetValidLocations(e){let t=[];if(Ta("W_LOCAL.Graphs",this.jsonWU)){let s="";bn(this.jsonWU.W_LOCAL.Graphs,(r,i,o)=>{if(r==="$"&&i.id&&(s=i.id),r==="$"&&i.name==="definition"){let c=/([a-z,A-Z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(i.value);if(c){let[,d,C,l]=c,E=+C,A=+l;e===d&&t.push({file:d,line:E,col:A,id:s})}}})}return t}},Et=class n{eclccPath;envchkPath;eclBundlePath;binPath;cwd;includeFolders;_legacyMode;_args;_version;constructor(e,t,s=[],r=!1,i=[],o){this.eclccPath=e,this.binPath=fe.dirname(this.eclccPath),this.envchkPath=fe.join(this.binPath,"envchk"+Wn),this.eclBundlePath=fe.join(this.binPath,"ecl-bundle"+Wn),this.cwd=fe.normalize(t||this.binPath),this.includeFolders=s,this._legacyMode=r,this._args=i,this._version=o}clone(e,t,s=!1,r=[]){return new n(this.eclccPath,e,t,s,r,this._version)}exists(e){try{return pe.accessSync(e),!0}catch{}return!1}args(e=[]){let t=[...this._args];return this._legacyMode&&t.push("-legacy"),t.concat(this.includeFolders.map(s=>"-I"+fe.normalize(s))).concat(e)}version(){return this._version?Promise.resolve(this._version):this.execFile(this.eclccPath,this.binPath,this.args(["--version"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>(this._version=new Ut(e.stdout),this._version))}versionSync(){return this._version}_paths={};paths(){return this.execFile(this.eclccPath,this.cwd,this.args(["-showpaths"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>{if(e&&e.stdout&&e.stdout.length){let t=e.stdout.split(/\r?\n/);for(let s of t){let r=s.split("=");r.length===2&&(this._paths[r[0]]=r[1])}}return this._paths})}loadXMLDoc(e,t){return new Promise((s,r)=>{let i=pe.readFileSync(e,"ascii"),o=Na(i);t&&pe.unlink(e,c=>{}),s(o)})}createWU(e){let t=fe.join(Te.tmpdir(),`eclcc-wu-tmp-${Jr.randomBytes(8).toString("hex")}`),s=["-o"+t,"-wu"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(s),"eclcc",`Cannot find ${this.eclccPath}`).then(r=>{let i=fe.normalize(t+".xml");return(this.exists(i)?this.loadXMLDoc(i,!0):Promise.resolve({})).then(c=>new Un(c))})}createArchive(e){let t=["-E"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(t),"eclcc",`Cannot find ${this.eclccPath}`).then(s=>({content:s.stdout,err:new Qs(s.stderr,[])}))}attachWorkspace(){return nt(this.cwd)}fetchMeta(e){return Promise.all([nt(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args(["-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([t,s])=>{try{s&&s.stdout&&s.stdout.length&&t.parseMetaXML(s.stdout)}catch(r){lt.error(`fetchMeta: Error parsing XML - ${r?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([nt(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args([...t,"-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([s,r])=>{let i=[];try{r&&r.stdout&&r.stdout.length&&(i=s.parseMetaXML(r.stdout))}catch(o){lt.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new Qs(r?r.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([nt(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([s,r])=>new xn(e,r?r.stderr:"",[]))}bundleList(){let e=/\|(.*)\|(.*)\|(.*)\|/g;return Promise.all([fetch("https://raw.githubusercontent.com/hpcc-systems/ecl-bundles/master/README.rst").then(t=>t.text()).then(t=>{let s=[],r=e.exec(t);for(;r;)s.push({name:r[1].trim(),description:r[2].trim(),url:r[3].trim()}),r=e.exec(t);return s}),this.execFile(this.eclBundlePath,this.cwd,this.args(["list"]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(t=>Or(t.stdout).split(`
921
- `)).then(t=>{let s={};return Promise.all(t.filter(r=>!!r).map(r=>this.execFile(this.eclBundlePath,this.cwd,this.args(["info",r]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(i=>Or(i.stdout).split(`
922
- `)).then(i=>{let o={};i.forEach(c=>{let d=c.split(":");o[d.shift().trim()]=d.join(":").trim()}),s[r]={name:r,props:o}}))).then(()=>s)})]).then(([t,s])=>{t.forEach(r=>{s[r.name]&&(r.props=s[r.name].props,delete s[r.name])});for(let r in s)t.push({name:r,url:"",description:"",props:s[r].props});return t}).catch(t=>[])}bundleInstall(e){return Promise.all([nt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["install",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}bundleUninstall(e){return Promise.all([nt(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["uninstall",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}execFile(e,t,s,r,i){return new Promise((o,c)=>{lt.debug(`${e} ${s.join(" ")}`);let d=zr.spawn(e,s,{cwd:t}),C="",l="";d.stdout.on("data",E=>{C+=E.toString()}),d.stderr.on("data",E=>{l+=E.toString()}),d.on("close",(E,A)=>{o({code:E,stdout:C.trim(),stderr:l.trim()})})})}};function Ns(n,e){if(n){let t=fe.join(n,"HPCCSystems");if(pe.existsSync(t)&&pe.statSync(t).isDirectory()){if(Te.type()!=="Windows_NT"){let s=fe.join(t,"bin","eclcc");pe.existsSync(s)&&e.push(new Et(s))}pe.readdirSync(t).forEach(s=>{let r=fe.join(t,s,"clienttools","bin","eclcc"+Wn);if(pe.existsSync(r)){let i=fe.basename(s);new Ut(i).exists()&&e.push(new Et(r))}})}}}var bt;function Tp(){bt=void 0}function Ba(){if(bt)return bt;let n=[];switch(Te.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&Ns(e,n);let t=process.env.ProgramFiles||"";t&&Ns(t,n),!e&&!t&&Ns("c:\\Program Files (x86)",n);break;case"Linux":case"Darwin":Ns("/opt",n);break;default:break}return bt=Promise.all(n.map(e=>e.version())).then(()=>(n.sort((e,t)=>t.versionSync().compare(e.versionSync())),n)),bt}var Xr="";function qr(n){let e=`Using eclccPath setting: ${n}`;Xr!==e&&(lt.info(e),Xr=e)}function jr(n="",e="",t=".",s=[],r=!1,i=[]){return n&&pe.existsSync(n)?(qr(n),Promise.resolve(new Et(n,t,s,r,i))):Ba().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let c=new Ut(e),d,C;for(let E of o){let A=E.versionSync();if(A.exists()&&(d||(d=E),!C&&c.major===A.major&&(C=E),c.major===A.major&&c.minor===A.minor))return E.clone(t,s,r,i)}let l=C||d;return qr(l.eclccPath),l.clone(t,s,r,i)})}Ft.DOMParser=Qa;if(Ft.fetch===void 0)throw new Error("@hpcc-js/comms requires Node.js >= 18.0.0 for native fetch support");Ft.__hpcc_undiciFetch=La;Ft.__hpcc_rejectUnauthorizedAgent=new Ga({connect:{rejectUnauthorized:!1}});var gt="";ye.globalAgent.options.ca!==void 0&&(Array.isArray(ye.globalAgent.options.ca)&&ye.globalAgent.options.ca.length?typeof ye.globalAgent.options.ca[0]=="string"?gt=ye.globalAgent.options.ca.join(`
923
- `):ye.globalAgent.options.ca[0]instanceof Kr&&(gt=ye.globalAgent.options.ca.map(n=>n.toString()).join(`
924
- `)):typeof ye.globalAgent.options.ca=="string"?gt=ye.globalAgent.options.ca:ye.globalAgent.options.ca instanceof Kr&&(gt=ye.globalAgent.options.ca.toString()),gt+=`
925
- `);Ft.__hpcc_trustwaveAgent=new ye.Agent({ca:gt+Bn});export{kn as AccessService,vn as AccountService,Ir as Activity,hn as Attr,Ze as Attribute,ja as BUILD_VERSION,en as BaseScope,Et as ClientTools,Vn as CloudService,Hn as CodesignService,vs as Connection,Bc as DFUArrayActions,Lc as DFUChangeProtection,Gc as DFUChangeRestriction,Qc as DFUDefFileFormat,Dt as DFUService,Gr as DFUWorkunit,dn as DFUWorkunitCache,On as DFUXRefService,jn as DaliService,Sn as Definition,us as ECLGraph,ut as ECLScope,Vs as ESPConnection,ze as ESPExceptions,Xt as EclService,Qs as EclccErrors,Yn as ElkService,xn as EnvchkErrors,Bs as Errors,fn as Field,Rn as File,St as FileSpray,Je as FileSprayService,Zi as FileSprayStates,Cn as Folder,$s as GlobalResultCache,ls as GraphCache,ws as Import,Un as LocalWorkunit,oo as LogType,qn as LogaccessService,Mr as LogicalFile,rn as LogicalFileCache,Ps as Machine,on as MachineCache,ke as MachineService,Va as PKG_NAME,Ha as PKG_VERSION,Zn as PackageProcessService,Qo as PropertyType,Nr as Query,Ms as QueryGraph,Lo as RelatedProperty,ds as Resource,$n as ResourcesService,Cs as Result,As as ResultCache,Rt as SMCService,tr as SashaService,yt as Scope,Sr as ScopeEdge,gs as ScopeGraph,hr as ScopeSubgraph,fr as ScopeVertex,v as Service,Dn as Source,ys as SourceFile,Qr as Store,pn as StoreCache,Ct as StoreService,ao as TargetAudience,at as TargetCluster,cn as TargetClusterCache,Ws as Timer,Is as Topology,un as TopologyCache,ge as TopologyService,tt as ValueChangedMessage,Ut as Version,_s as WUStateID,Ke as WUUpdate,An as Workspace,ot as Workunit,sn as WorkunitCache,ae as WorkunitsService,as as WorkunitsServiceEx,Gn as WsAccess,Hs as WsCodesign,it as WsDfu,te as WsLogaccess,ir as WsSMC,er as WsSasha,ar as WsTopology,he as WsWorkunits,mr as XGMMLEdge,qs as XGMMLGraph,pr as XGMMLSubgraph,dr as XGMMLVertex,ms as XSDNode,Ss as XSDSchema,fs as XSDSimpleType,hs as XSDXMLNode,nt as attachWorkspace,Tp as clearAllClientToolsCache,Gt as createConnection,ps as createGraph,Wr as createXGMMLGraph,sg as defaultTargetCluster,Oi as deserializeResponse,qi as get,qa as hookSend,Xa as instanceOfIConnection,Ya as instanceOfIOptions,Ji as isArray,ur as isECLResult,sc as isExceptions,vu as isWUInfoWorkunit,ku as isWUQueryECLWorkunit,_i as jsonp,Ba as locateAllClientTools,jr as locateClientTools,Js as parseXSD,Ju as parseXSD2,Xi as post,Up as qualifiedIDBoundary,zi as send,qe as serializeRequest,za as setTransportFactory,vo as splitMetric,tg as targetClusters,bn as walkXmlJson};
918
+ `)}var it=class{prefix="";major=0;minor=0;patch=0;postfix="";constructor(e){let t=e.split(" ");if(t.length){let r=/(?:(\w+)_)?(\d+)\.(\d+)\.(\d+)(?:-(.*))?/.exec(t[t.length-1]);r&&(this.prefix=r[1]||"",this.major=+r[2]||0,this.minor=+r[3]||0,this.patch=+r[4]||0,this.postfix=r[5]||"")}}parse(e){}exists(){return this.major!==0||this.minor!==0||this.patch!==0||this.postfix!==""}compare(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch?-1:this.postfix===""&&e.postfix!==""?1:this.postfix.localeCompare(e.postfix)}toString(){return`${this.prefix}_${this.major}.${this.minor}.${this.patch}-${this.postfix}`}},Yn="error",Xn="warning",as=class{_checked;errWarn=[];errOther=[];constructor(e){this._checked=e}checked(){return this._checked}all(){return this.errWarn}errors(){return this.errWarn.filter(e=>e.severity===Yn)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===Xn)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[Yn,Xn].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},cs=class extends as{constructor(e,t){if(super(t),e&&e.length)for(let r of e.split(se.EOL)){let n=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(r);if(n){let[,i,o,a,c,l,u]=n,g=+o,p=+a,f=l+": "+u;this.errWarn.push({filePath:i,line:g,col:p,msg:f,severity:c});continue}if(n=/(error|warning|info): (.*)/i.exec(r),n){let[,i,o]=n;this.errWarn.push({filePath:"",line:0,col:0,msg:o,severity:i});continue}n=/\d error(s?), \d warning(s?)/.exec(r),!n&&(Le.warning(`parseECLErrors: Unable to parse "${r}"`),this.errOther.push(r))}this._checked=t}},nr=class extends as{_lines;constructor(e,t,r){super(r);let n=k.readFileSync(e,"utf8");if(n=n.replace(/\r\n/g,`
919
+ `),this._lines=n.split(`
920
+ `),t&&t.length)for(let i of t.split(se.EOL)){let o=/(Warning|Error) : Path\=(\S*?)(\[\S*\])? Message\=(.*)/.exec(i);if(o){let[,a,c,l,u]=o,g=`${c} ${l||""}: ${u}`,[p,f]=this.locate(c);this.errWarn.push({filePath:e,line:p,col:f,msg:g,severity:a});continue}o||(Le.warning(`parseECLErrors: Unable to parse "${i}"`),this.errOther.push(i))}this._checked=r}locate(e){let t=e.split("/");if(t.length&&t[0]===""&&t.shift(),t.length>0){let r=0;for(let n of this._lines){let i="<"+t[0];if((n.indexOf(i+" ")>=0||n.indexOf(i+">")>=0)&&(t.shift(),t.length===0))return[r+1,n.indexOf(i)+1];++r}}return[0,0]}};function ir(s,e,t){t=t||[],t.push(s);for(let r in s)if(s.hasOwnProperty(r)){let n=s[r];e(r,n,t),n instanceof Array?n.forEach(i=>{ir(i,e,t)}):typeof n=="object"&&ir(n,e,t)}t.pop()}var or=class{jsonWU;constructor(e){this.jsonWU=e}bpGetValidLocations(e){let t=[];if(Dc("W_LOCAL.Graphs",this.jsonWU)){let r="";ir(this.jsonWU.W_LOCAL.Graphs,(n,i,o)=>{if(n==="$"&&i.id&&(r=i.id),n==="$"&&i.name==="definition"){let a=/([a-z,A-Z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(i.value);if(a){let[,c,l,u]=a,g=+l,p=+u;e===c&&t.push({file:c,line:g,col:p,id:r})}}})}return t}},ot=class s{eclccPath;envchkPath;eclBundlePath;binPath;cwd;includeFolders;_legacyMode;_args;_version;constructor(e,t,r=[],n=!1,i=[],o){this.eclccPath=e,this.binPath=V.dirname(this.eclccPath),this.envchkPath=V.join(this.binPath,"envchk"+rr),this.eclBundlePath=V.join(this.binPath,"ecl-bundle"+rr),this.cwd=V.normalize(t||this.binPath),this.includeFolders=r,this._legacyMode=n,this._args=i,this._version=o}clone(e,t,r=!1,n=[]){return new s(this.eclccPath,e,t,r,n,this._version)}exists(e){try{return k.accessSync(e),!0}catch{}return!1}args(e=[]){let t=[...this._args];return this._legacyMode&&t.push("-legacy"),t.concat(this.includeFolders.map(r=>"-I"+V.normalize(r))).concat(e)}version(){return this._version?Promise.resolve(this._version):this.execFile(this.eclccPath,this.binPath,this.args(["--version"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>(this._version=new it(e.stdout),this._version))}versionSync(){return this._version}_paths={};paths(){return this.execFile(this.eclccPath,this.cwd,this.args(["-showpaths"]),"eclcc",`Cannot find ${this.eclccPath}`).then(e=>{if(e&&e.stdout&&e.stdout.length){let t=e.stdout.split(/\r?\n/);for(let r of t){let n=r.split("=");n.length===2&&(this._paths[n[0]]=n[1])}}return this._paths})}loadXMLDoc(e,t){return new Promise((r,n)=>{let i=k.readFileSync(e,"ascii"),o=Cc(i);t&&k.unlink(e,a=>{}),r(o)})}createWU(e){let t=V.join(se.tmpdir(),`eclcc-wu-tmp-${Kn.randomBytes(8).toString("hex")}`),r=["-o"+t,"-wu"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(r),"eclcc",`Cannot find ${this.eclccPath}`).then(n=>{let i=V.normalize(t+".xml");return(this.exists(i)?this.loadXMLDoc(i,!0):Promise.resolve({})).then(a=>new or(a))})}createArchive(e){let t=["-E"].concat([e]);return this.execFile(this.eclccPath,this.cwd,this.args(t),"eclcc",`Cannot find ${this.eclccPath}`).then(r=>({content:r.stdout,err:new cs(r.stderr,[])}))}attachWorkspace(){return Ae(this.cwd)}fetchMeta(e){return Promise.all([Ae(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args(["-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([t,r])=>{try{r&&r.stdout&&r.stdout.length&&t.parseMetaXML(r.stdout)}catch(n){Le.error(`fetchMeta: Error parsing XML - ${n?.message??"unknown"}`)}return t})}syntaxCheck(e,t=["-syntax"]){return Promise.all([Ae(this.cwd),this.execFile(this.eclccPath,this.cwd,this.args([...t,"-M",e]),"eclcc",`Cannot find ${this.eclccPath}`)]).then(([r,n])=>{let i=[];try{n&&n.stdout&&n.stdout.length&&(i=r.parseMetaXML(n.stdout))}catch(o){Le.error(`syntaxCheck: Error parsing XML - ${o?.message??"unknown"}`)}return new cs(n?n.stderr:"",i)})}envCheck(e,t=[]){return Promise.all([Ae(this.cwd),this.execFile(this.envchkPath,this.cwd,this.args([...t,e]),"envchk",`Cannot find ${this.envchkPath}`)]).then(([r,n])=>new nr(e,n?n.stderr:"",[]))}bundleList(){let e=/\|(.*)\|(.*)\|(.*)\|/g;return Promise.all([fetch("https://raw.githubusercontent.com/hpcc-systems/ecl-bundles/master/README.rst").then(t=>t.text()).then(t=>{let r=[],n=e.exec(t);for(;n;)r.push({name:n[1].trim(),description:n[2].trim(),url:n[3].trim()}),n=e.exec(t);return r}),this.execFile(this.eclBundlePath,this.cwd,this.args(["list"]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(t=>On(t.stdout).split(`
921
+ `)).then(t=>{let r={};return Promise.all(t.filter(n=>!!n).map(n=>this.execFile(this.eclBundlePath,this.cwd,this.args(["info",n]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`).then(i=>On(i.stdout).split(`
922
+ `)).then(i=>{let o={};i.forEach(a=>{let c=a.split(":");o[c.shift().trim()]=c.join(":").trim()}),r[n]={name:n,props:o}}))).then(()=>r)})]).then(([t,r])=>{t.forEach(n=>{r[n.name]&&(n.props=r[n.name].props,delete r[n.name])});for(let n in r)t.push({name:n,url:"",description:"",props:r[n].props});return t}).catch(t=>[])}bundleInstall(e){return Promise.all([Ae(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["install",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,r])=>r)}bundleUninstall(e){return Promise.all([Ae(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["uninstall",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,r])=>r)}execFile(e,t,r,n,i){return new Promise((o,a)=>{Le.debug(`${e} ${r.join(" ")}`);let c=zn.spawn(e,r,{cwd:t}),l="",u="";c.stdout.on("data",g=>{l+=g.toString()}),c.stderr.on("data",g=>{u+=g.toString()}),c.on("close",(g,p)=>{o({code:g,stdout:l.trim(),stderr:u.trim()})})})}};function os(s,e){if(s){let t=V.join(s,"HPCCSystems");if(k.existsSync(t)&&k.statSync(t).isDirectory()){if(se.type()!=="Windows_NT"){let r=V.join(t,"bin","eclcc");k.existsSync(r)&&e.push(new ot(r))}k.readdirSync(t).forEach(r=>{let n=V.join(t,r,"clienttools","bin","eclcc"+rr);if(k.existsSync(n)){let i=V.basename(r);new it(i).exists()&&e.push(new ot(n))}})}}}var nt;function Rm(){nt=void 0}function xc(){if(nt)return nt;let s=[];switch(se.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&os(e,s);let t=process.env.ProgramFiles||"";t&&os(t,s),!e&&!t&&os("c:\\Program Files (x86)",s);break;case"Linux":case"Darwin":os("/opt",s);break;default:break}return nt=Promise.all(s.map(e=>e.version())).then(()=>(s.sort((e,t)=>t.versionSync().compare(e.versionSync())),s)),nt}var qn="";function Jn(s){let e=`Using eclccPath setting: ${s}`;qn!==e&&(Le.info(e),qn=e)}function _n(s="",e="",t=".",r=[],n=!1,i=[]){return s&&k.existsSync(s)?(Jn(s),Promise.resolve(new ot(s,t,r,n,i))):xc().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let a=new it(e),c,l;for(let g of o){let p=g.versionSync();if(p.exists()&&(c||(c=g),!l&&a.major===p.major&&(l=g),a.major===p.major&&a.minor===p.minor))return g.clone(t,r,n,i)}let u=l||c;return Jn(u.eclccPath),u.clone(t,r,n,i)})}at.DOMParser=Ac;if(at.fetch===void 0)throw new Error("@hpcc-js/comms requires Node.js >= 18.0.0 for native fetch support");at.__hpcc_undiciFetch=Wc;at.__hpcc_rejectUnauthorizedAgent=new yc({connect:{rejectUnauthorized:!1}});var Ge="";_.globalAgent.options.ca!==void 0&&(Array.isArray(_.globalAgent.options.ca)&&_.globalAgent.options.ca.length?typeof _.globalAgent.options.ca[0]=="string"?Ge=_.globalAgent.options.ca.join(`
923
+ `):_.globalAgent.options.ca[0]instanceof Zn&&(Ge=_.globalAgent.options.ca.map(s=>s.toString()).join(`
924
+ `)):typeof _.globalAgent.options.ca=="string"?Ge=_.globalAgent.options.ca:_.globalAgent.options.ca instanceof Zn&&(Ge=_.globalAgent.options.ca.toString()),Ge+=`
925
+ `);at.__hpcc_trustwaveAgent=new _.Agent({ca:Ge+cr});export{gr as AccessService,dr as AccountService,Mn as Activity,Js as Attr,Se as Attribute,Fc as BUILD_VERSION,Ns as BaseScope,ot as ClientTools,mr as CloudService,hr as CodesignService,ps as Connection,Cu as DFUArrayActions,Au as DFUChangeProtection,Wu as DFUChangeRestriction,xu as DFUDefFileFormat,He as DFUService,kn as DFUWorkunit,Xs as DFUWorkunitCache,Sr as DFUXRefService,fr as DaliService,Ks as Definition,Qt as ECLGraph,Qe as ECLScope,gs as ESPConnection,pe as ESPExceptions,Ct as EclService,cs as EclccErrors,Rr as ElkService,nr as EnvchkErrors,as as Errors,zs as Field,$s as File,Ve as FileSpray,ge as FileSprayService,Ri as FileSprayStates,er as Folder,Bs as GlobalResultCache,Lt as GraphCache,is as Import,or as LocalWorkunit,Ei as LogType,xr as LogaccessService,wn as LogicalFile,ks as LogicalFileCache,ts as Machine,vs as MachineCache,re as MachineService,Uc as PKG_NAME,Ec as PKG_VERSION,Wr as PackageProcessService,Aa as PropertyType,Qn as Query,rs as QueryGraph,Wa as RelatedProperty,vt as Resource,yr as ResourcesService,Xt as Result,qt as ResultCache,ze as SMCService,Ur as SashaService,tt as Scope,Cn as ScopeEdge,Gt as ScopeGraph,Dn as ScopeSubgraph,Rn as ScopeVertex,x as Service,Zs as Source,Jt as SourceFile,Ln as Store,Ys as StoreCache,Ke as StoreService,Fi as TargetAudience,Be as TargetCluster,Hs as TargetClusterCache,zt as Timer,ss as Topology,js as TopologyCache,G as TopologyService,Ce as ValueChangedMessage,it as Version,As as WUStateID,he as WUUpdate,tr as Workspace,we as Workunit,Ls as WorkunitCache,L as WorkunitsService,Bt as WorkunitsServiceEx,pr as WsAccess,ds as WsCodesign,Ue as WsDfu,N as WsLogaccess,$r as WsSMC,br as WsSasha,en as WsTopology,v as WsWorkunits,Sn as XGMMLEdge,Is as XGMMLGraph,hn as XGMMLSubgraph,fn as XGMMLVertex,Vt as XSDNode,_t as XSDSchema,jt as XSDSimpleType,Ht as XSDXMLNode,Ae as attachWorkspace,Rm as clearAllClientToolsCache,pt as createConnection,kt as createGraph,Un as createXGMMLGraph,Hg as defaultTargetCluster,pi as deserializeResponse,hi as get,wc as hookSend,Mc as instanceOfIConnection,Tc as instanceOfIOptions,Si as isArray,sn as isECLResult,Vc as isExceptions,Jl as isWUInfoWorkunit,ql as isWUQueryECLWorkunit,gi as jsonp,xc as locateAllClientTools,_n as locateClientTools,Ts as parseXSD,Bp as parseXSD2,mi as post,dm as qualifiedIDBoundary,fi as send,le as serializeRequest,Bc as setTransportFactory,Ua as splitMetric,Vg as targetClusters,ir as walkXmlJson};
926
926
  //# sourceMappingURL=index.js.map