@hpcc-js/comms 3.12.0 → 3.12.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.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +1 -1
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +9 -9
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.js +10 -10
- package/dist/node/index.js.map +3 -3
- package/package.json +3 -3
- package/src/connection.ts +2 -2
- package/src/index.common.ts +0 -1
- package/src/index.node.ts +1 -8
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>e(t,"name",{value:n,configurable:!0});import{scopedLogger as n,join as s,promiseTimeout as r,exists as i,deepMixin as o,xml2json as c,StateObject as a,Cache as u,Graph as h,Subgraph as l,Vertex as d,Edge as p,SAXStackParser as g,Stack as m,espTime2Seconds as S,deepMixinT as f,XMLNode as _,debounce as U,Message as y,Dispatch as v}from"@hpcc-js/util";const C="@hpcc-js/comms",R="3.12.0",D="3.16.0",b=n("comms/connection.ts");function F(e){return"baseUrl"in e}t(F,"instanceOfIOptions");const W={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function T(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone}function A(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function w(e,t=!0,n=""){if(n&&(n+="."),"object"!=typeof e)return A(e,t);const s=[];for(const r in e)if(e.hasOwnProperty(r))if(e[r]instanceof Array){let i=!1;e[r].forEach((e,o)=>{"object"==typeof e?(i=!0,s.push(w(e,t,n+A(`${r}.${o}`,t)))):s.push(n+A(`${r}_i${o}`,t)+"="+w(e,t))}),i&&s.push(n+A(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(s.push(w(e[r].Item,t,n+A(r,t))),s.push(n+A(`${r}.itemcount`,t)+"="+e[r].Item.length)):s.push(w(e[r],t,n+A(r,t))):void 0!==e[r]?s.push(n+A(r,t)+"="+A(e[r],t)):s.push(n+A(r,t));return s.join("&")}function P(e){return JSON.parse(e)}function x(e,n,r={},i="json",o){return o&&console.warn("Header attributes ignored for JSONP connections"),new Promise((o,c)=>{let a=1e3*e.timeoutSecs;const u="jsonp_callback_"+Math.round(999999*Math.random());window[u]=function(e){a=0,p(),o("json"===i&&"string"==typeof e?P(e):e)};const h=document.createElement("script");let l=s(e.baseUrl,n);l+=l.indexOf("?")>=0?"&":"?",h.src=l+"jsonp="+u+"&"+w(r,e.encodeRequest),document.body.appendChild(h);const d=setInterval(function(){a<=0?clearInterval(d):(a-=5e3,a<=0?(clearInterval(d),b.error("Request timeout: "+h.src),p(),c(Error("Request timeout: "+h.src))):b.debug("Request pending ("+a/1e3+" sec): "+h.src))},5e3);function p(){delete window[u],document.body.removeChild(h)}t(p,"doCallback")})}function L(e){return e.userID?{Authorization:`Basic ${btoa(`${e.userID}:${e.password}`)}`}:{}}t(T,"instanceOfIConnection"),t(A,"encode"),t(w,"serializeRequest"),t(P,"deserializeResponse"),t(x,"jsonp"),t(L,"authHeader");const E={};function M(e,n,i,o,c){function a(e){if(e.ok)return"json"===c?e.json():e.text();throw new Error(e.statusText)}return o={...L(e),...o},i={credentials:E[e.baseUrl]?"omit":"include",...i,headers:o},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):i.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(i.agent=fetch.__trustwaveAgent)),t(a,"handleResponse"),r(1e3*e.timeoutSecs,fetch(s(e.baseUrl,n),i).then(a).catch(t=>(i.credentials=E[e.baseUrl]?"include":"omit",fetch(s(e.baseUrl,n),i).then(a).then(t=>(E[e.baseUrl]=!E[e.baseUrl],t)))))}function N(e,t,n,s="json",r){let i;return n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,t,{method:"post",body:w(n,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function I(e,t,n,s="json",r){let i;return n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),M(e,`${t}?${w(n,e.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function j(e,t,n,s="json",r){let i;switch(e.type){case"jsonp":i=x(e,t,n,s,r);break;case"get":i=I(e,t,n,s,r);break;default:i=N(e,t,n,s,r)}return i}t(M,"doFetch"),t(N,"post"),t(I,"get"),t(j,"send");let k=j;function G(e){const t=k;return e&&(k=e),t}t(G,"hookSend");const V=class _Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return 0===arguments.length?this._opts:(this._opts={...W,...e},this)}send(e,t,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,k,s):k(this._opts,e,t,n,s)}clone(){return new _Connection(this.opts())}};t(V,"Connection");let Q=V,B=/* @__PURE__ */t(function(e){return new Q(e)},"createConnection");function O(e){const t=B;return B=e,t}function X(e){return"[object Array]"===Object.prototype.toString.call(e)}t(O,"setTransportFactory"),t(X,"isArray");const H=class _ESPExceptions extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,n){super("ESPException: "+n.Source),this.action=e,this.request=t,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};t(H,"ESPExceptions");let $=H;function J(e){return e instanceof $||e.isESPExceptions&&Array.isArray(e.Exception)}function q(e){return void 0!==e.send}t(J,"isExceptions"),t(q,"isConnection");const Y=class _ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=q(e)?e:B(e),this._service=t,this._version=n}service(e){return void 0===e?this._service:(this._service=e,this)}version(e){return void 0===e?this._version:(this._version=e,this)}toESPStringArray(e,t){if(X(e[t])){for(let n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},n="json",r=!1,i,o){const c={...t,ver_:this._version};let a;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let u="json";switch(n){case"text":a=s(this._service,e),u="text";break;case"xsd":a=s(this._service,e+".xsd"),u="text";break;case"json2":a=s(this._service,e+"/json"),n="json";const t=e.split("/");e=t.pop();break;default:a=s(this._service,e+".json")}return this._connection.send(a,c,u).then(t=>{if("json"===n){let n;if(t&&t.Exceptions)throw new $(e,c,t.Exceptions);if(t&&(n=t[o||e+"Response"]),!n)throw new $(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t})}clone(){return new _ESPConnection(this._connection.clone(),this._service,this._version)}};t(Y,"ESPConnection");let z=Y;const Z=class _Service{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new z(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};t(Z,"Service");let K=Z;var ee,te,ne;te=ee||(ee={}),(ne=te.DFUWUActions||(te.DFUWUActions={})).Delete="Delete",ne.Protect="Protect",ne.Unprotect="Unprotect",ne.Restore="Restore",ne.SetToFailed="SetToFailed",ne.Archive="Archive";const se=class _FileSprayServiceBase extends K{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};t(se,"FileSprayServiceBase");let re=se;var ie=/* @__PURE__ */(e=>(e[e.unknown=0]="unknown",e[e.scheduled=1]="scheduled",e[e.queued=2]="queued",e[e.started=3]="started",e[e.aborted=4]="aborted",e[e.failed=5]="failed",e[e.finished=6]="finished",e[e.monitoring=7]="monitoring",e[e.aborting=8]="aborting",e[e.notfound=999]="notfound",e))(ie||{});const oe=class _FileSprayService extends re{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")}};t(oe,"FileSprayService");let ce=oe;var ae,ue,he,le,de,pe,ge;ue=ae||(ae={}),(he=ue.ViewMemberType||(ue.ViewMemberType={})).User="User",he.Group="Group",(le=ue.UserSortBy||(ue.UserSortBy={})).username="username",le.fullname="fullname",le.passwordexpiration="passwordexpiration",le.employeeID="employeeID",le.employeeNumber="employeeNumber",(de=ue.GroupSortBy||(ue.GroupSortBy={})).Name="Name",de.ManagedBy="ManagedBy",(pe=ue.AccountTypeReq||(ue.AccountTypeReq={})).Any="Any",pe.User="User",pe.Group="Group",(ge=ue.ResourcePermissionSortBy||(ue.ResourcePermissionSortBy={})).Name="Name",ge.Type="Type",(ue.ResourceSortBy||(ue.ResourceSortBy={})).Name="Name";const me=class _AccessServiceBase extends K{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}};t(me,"AccessServiceBase");let Se=me;const fe=class _AccessService extends Se{};t(fe,"AccessService");let _e=fe;const Ue=class _AccountServiceBase extends K{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}};t(Ue,"AccountServiceBase");let ye=Ue;const ve=class _AccountService extends ye{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>20043===e.Code))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})}};t(ve,"AccountService");let Ce=ve;const Re=class _CloudServiceBase extends K{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}};t(Re,"CloudServiceBase");let De=Re;const be=n("@hpcc-js/comms/services/wsCloud.ts");function Fe(e){return void 0!==e?.Pods}function We(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}function Te(e){return e.filter(e=>{const t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===t["app.kubernetes.io/part-of"]}).map(e=>{const t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((e,t)=>e+(t.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:We(e)}}})}t(Fe,"isGetPODsResponse_v1_02"),t(We,"mapPorts"),t(Te,"mapPods");const Ae=class _CloudService extends De{getPODs(){return super.GetPODs({}).then(e=>{if(Fe(e))return e.Pods?.Pod??[];try{const t="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return Te(t?.items??[])}catch(t){return be.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};t(Ae,"CloudService");let we=Ae;var Pe,xe;((xe=Pe||(Pe={})).SigningMethodType||(xe.SigningMethodType={})).gpg="gpg";const Le=class _CodesignServiceBase extends K{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e){return this._connection.send("ListUserIDs",e,"json",!1,void 0,"ListUserIDsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_codesignPingResponse")}Sign(e){return this._connection.send("Sign",e,"json",!1,void 0,"SignResponse")}Verify(e){return this._connection.send("Verify",e,"json",!1,void 0,"VerifyResponse")}};t(Le,"CodesignServiceBase");let Ee=Le;const Me=class _CodesignService extends Ee{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return super.Sign({SigningMethod:Pe.SigningMethodType.gpg,...e})}};t(Me,"CodesignService");let Ne=Me;const Ie=class _DaliServiceBase extends K{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};t(Ie,"DaliServiceBase");let je=Ie;const ke=class _DaliService extends je{};t(ke,"DaliService");let Ge=ke;var Ve,Qe,Be,Oe,Xe,He,$e,Je,qe;Qe=Ve||(Ve={}),(Be=Qe.DFUArrayActions||(Qe.DFUArrayActions={})).Delete="Delete",Be.AddToSuperfile="Add To Superfile",Be.ChangeProtection="Change Protection",Be.ChangeRestriction="Change Restriction",(Oe=Qe.DFUChangeProtection||(Qe.DFUChangeProtection={}))[Oe.NoChange=0]="NoChange",Oe[Oe.Protect=1]="Protect",Oe[Oe.Unprotect=2]="Unprotect",Oe[Oe.UnprotectAll=3]="UnprotectAll",(Xe=Qe.DFUChangeRestriction||(Qe.DFUChangeRestriction={}))[Xe.NoChange=0]="NoChange",Xe[Xe.Restrict=1]="Restrict",Xe[Xe.Unrestricted=2]="Unrestricted",(He=Qe.DFUDefFileFormat||(Qe.DFUDefFileFormat={})).xml="xml",He.def="def",($e=Qe.FileAccessRole||(Qe.FileAccessRole={})).Token="Token",$e.Engine="Engine",$e.External="External",(Je=Qe.SecAccessType||(Qe.SecAccessType={})).None="None",Je.Access="Access",Je.Read="Read",Je.Write="Write",Je.Full="Full",(qe=Qe.DFUFileType||(Qe.DFUFileType={})).Flat="Flat",qe.Index="Index",qe.Xml="Xml",qe.Csv="Csv",qe.Json="Json",qe.IndexLocal="IndexLocal",qe.IndexPartitioned="IndexPartitioned",qe.Unset="Unset";const Ye=class _DfuServiceBase extends K{constructor(e){super(e,"WsDfu","1.67")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,void 0,"DFUMetaInquiryResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};t(Ye,"DfuServiceBase");let ze=Ye;const Ze=Ve.DFUArrayActions,Ke=Ve.DFUDefFileFormat,et=Ve.DFUChangeProtection,tt=Ve.DFUChangeRestriction,nt=class _DFUService extends ze{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],n=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{for(const n of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(n);for(const t of e?.FileDetail?.subfiles?.Item??[])n.push(t)}))),n.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};t(nt,"DFUService");let st=nt;const rt=class _DFUXRefServiceBase extends K{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e,"json",!1,void 0,"DFUXRefArrayActionResponse")}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e,"json",!1,void 0,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,void 0,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,void 0,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,"json",!1,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,"json",!1,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,void 0,"DFUXRefUnusedFilesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDFUXRefPingResponse")}};t(rt,"DFUXRefServiceBase");let it=rt;const ot=class _DFUXRefService extends it{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")}};t(ot,"DFUXRefService");let ct=ot;function at(e,t){const n=typeof t;switch(n){case"boolean":case"number":case"string":return{id:e,type:n};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:ut(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const n=typeof t.Item[0];if("string"===n||"number"===n)return{id:e,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:e,type:"object",fields:ht(t)}}default:throw new Error("Unknown field type")}}function ut(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const n in e)t.push(at(n,e[n]));return t}function ht(e){const t={};for(const n in e)t[n]=at(n,e[n]);return t}t(at,"jsonToIField"),t(ut,"jsonToIFieldArr"),t(ht,"jsonToIFieldObj");const lt=class _EclService extends K{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(e=>{const t=JSON.parse(e);for(const n in t)return t[n];return{}}).then(ut)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const n in t)return t[n].Results;return{}}).then(e=>{const t={};for(const n in e)t[n]=ut(e[n]);return t})}submit(e,t,n){const s=`submit/query/${e}/${t}`;return this._connection.send(s,n,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new $(s,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}};t(lt,"EclService");let dt=lt;const pt=class _ElkServiceBase extends K{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e,"json",!1,void 0,"GetConfigDetailsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_elkPingResponse")}};t(pt,"ElkServiceBase");let gt=pt;const mt=class _ElkService extends gt{};t(mt,"ElkService");let St=mt;var ft,_t,Ut,yt,vt,Ct,Rt,Dt,bt,Ft;_t=ft||(ft={}),(Ut=_t.LogColumnType||(_t.LogColumnType={})).global="global",Ut.workunits="workunits",Ut.components="components",Ut.audience="audience",Ut.class="class",Ut.instance="instance",Ut.node="node",Ut.message="message",Ut.logid="logid",Ut.processid="processid",Ut.threadid="threadid",Ut.timestamp="timestamp",Ut.pod="pod",Ut.traceid="traceid",Ut.spanid="spanid",(yt=_t.LogColumnValueType||(_t.LogColumnValueType={})).string="string",yt.numeric="numeric",yt.datetime="datetime",yt.enum="enum",yt.epoch="epoch",(vt=_t.LogAccessType||(_t.LogAccessType={}))[vt.All=0]="All",vt[vt.ByJobID=1]="ByJobID",vt[vt.ByComponent=2]="ByComponent",vt[vt.ByLogType=3]="ByLogType",vt[vt.ByTargetAudience=4]="ByTargetAudience",vt[vt.BySourceInstance=5]="BySourceInstance",vt[vt.BySourceNode=6]="BySourceNode",vt[vt.ByFieldName=7]="ByFieldName",vt[vt.ByPod=8]="ByPod",vt[vt.ByTraceID=9]="ByTraceID",vt[vt.BySpanID=10]="BySpanID",(Ct=_t.LogAccessStatusCode||(_t.LogAccessStatusCode={}))[Ct.Success=0]="Success",Ct[Ct.Warning=1]="Warning",Ct[Ct.Fail=2]="Fail",(Rt=_t.LogAccessFilterOperator||(_t.LogAccessFilterOperator={}))[Rt.NONE=0]="NONE",Rt[Rt.AND=1]="AND",Rt[Rt.OR=2]="OR",(Dt=_t.LogSelectColumnMode||(_t.LogSelectColumnMode={}))[Dt.MIN=0]="MIN",Dt[Dt.DEFAULT=1]="DEFAULT",Dt[Dt.ALL=2]="ALL",Dt[Dt.CUSTOM=3]="CUSTOM",(bt=_t.SortColumType||(_t.SortColumType={}))[bt.ByDate=0]="ByDate",bt[bt.ByJobID=1]="ByJobID",bt[bt.ByComponent=2]="ByComponent",bt[bt.ByLogType=3]="ByLogType",bt[bt.ByTargetAudience=4]="ByTargetAudience",bt[bt.BySourceInstance=5]="BySourceInstance",bt[bt.BySourceNode=6]="BySourceNode",bt[bt.ByFieldName=7]="ByFieldName",bt[bt.ByPod=8]="ByPod",bt[bt.ByTraceID=9]="ByTraceID",bt[bt.BySpanID=10]="BySpanID",(Ft=_t.SortDirection||(_t.SortDirection={}))[Ft.ASC=0]="ASC",Ft[Ft.DSC=1]="DSC";const Wt=class _LogaccessServiceBase extends K{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")}};t(Wt,"LogaccessServiceBase");let Tt=Wt;const At=n("@hpcc-js/comms/services/wsLogaccess.ts");var wt=/* @__PURE__ */(e=>(e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e))(wt||{}),Pt=/* @__PURE__ */(e=>(e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e))(Pt||{});const xt=class _LogaccessService extends Tt{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){const n=await this.GetLogAccessInfo(),s={};n.Columns.Column.forEach(e=>s[e.LogType]=e.Name);const r=/* @__PURE__ */t(e=>{const t={};for(const n in s)t[n]=e?.fields?Object.assign({},...e.fields)[s[n]]??"":"";return t},"convertLogLine"),i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:ft.LogAccessType.All}}]}},Range:{StartDate:/* @__PURE__ */new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:ft.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:ft.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(const t in e){let n,r;if(t in s&&(n=Object.values(ft.LogColumnType).includes(t)?t:s[t]),n){switch(n){case ft.LogColumnType.workunits:case"hpcc.log.jobid":r=ft.LogAccessType.ByJobID;break;case ft.LogColumnType.audience:case"hpcc.log.audience":r=ft.LogAccessType.ByTargetAudience;break;case ft.LogColumnType.class:case"hpcc.log.class":r=ft.LogAccessType.ByLogType;break;case ft.LogColumnType.components:case"kubernetes.container.name":r=ft.LogAccessType.ByComponent;break;default:r=ft.LogAccessType.ByFieldName,n=s[t]}if(Array.isArray(e[t]))e[t].forEach(e=>{r===ft.LogAccessType.ByComponent&&(e+="*"),o.push({LogCategory:r,SearchField:n,SearchByValue:e})});else{let s=e[t];r===ft.LogAccessType.ByComponent&&(s+="*"),o.push({LogCategory:r,SearchField:n,SearchByValue:s})}}}if(o.length>2){let e=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((t,n)=>{let s=ft.LogAccessFilterOperator.AND;n>0?(o[n-1].SearchField===t.SearchField&&(s=ft.LogAccessFilterOperator.OR),n===o.length-1?(e.Operator=s,e.rightFilter=t):(e.Operator=s,e.rightBinaryFilter={BinaryLogFilter:[{leftFilter:t}]},e=e.rightBinaryFilter.BinaryLogFilter[0])):e.leftFilter=t})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:ft.LogAccessType.All},o[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:o[0]?.LogCategory,SearchField:o[0]?.SearchField,SearchByValue:o[0]?.SearchByValue}),o[1]?.SearchField&&(i.Filter.Operator=ft.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=ft.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:o[1]?.LogCategory,SearchField:o[1]?.SearchField,SearchByValue:o[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(e=>{try{const t=JSON.parse(e.LogLines);let s=[];switch(n.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":s=t.lines?.map(r)??[];break;default:At.warning(`Unknown RemoteLogManagerType: ${n.RemoteLogManagerType}`),s=[]}return{lines:s,total:e.TotalLogLinesAvailable??1e4}}catch(t){At.error(t.message??t)}return{lines:[],total:0}})}};t(xt,"LogaccessService");let Lt=xt;function Et(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Mt(e){return 1===e.length&&(e=Nt(e)),{left:/* @__PURE__ */t(function(t,n,s,r){for(null==s&&(s=0),null==r&&(r=t.length);s<r;){var i=s+r>>>1;e(t[i],n)<0?s=i+1:r=i}return s},"left"),right:/* @__PURE__ */t(function(t,n,s,r){for(null==s&&(s=0),null==r&&(r=t.length);s<r;){var i=s+r>>>1;e(t[i],n)>0?r=i:s=i+1}return s},"right")}}function Nt(e){return function(t,n){return Et(e(t),n)}}function It(e){return null===e?NaN:+e}function jt(e,t){var n,s,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(n=e[i])&&n>=n)for(s=n;++i<r;)null!=(n=e[i])&&n>s&&(s=n)}else for(;++i<r;)if(null!=(n=t(e[i],i,e))&&n>=n)for(s=n;++i<r;)null!=(n=t(e[i],i,e))&&n>s&&(s=n);return s}function kt(e,t){var n,s=e.length,r=s,i=-1,o=0;if(null==t)for(;++i<s;)isNaN(n=It(e[i]))?--r:o+=n;else for(;++i<s;)isNaN(n=It(t(e[i],i,e)))?--r:o+=n;if(r)return o/r}var Gt,Vt,Qt,Bt;t(Et,"ascending"),t(Mt,"bisector"),t(Nt,"ascendingComparator"),Mt(Et),t(It,"number"),t(jt,"d3Max"),t(kt,"d3Mean"),Vt=Gt||(Gt={}),(Qt=Vt.ThresholdType||(Vt.ThresholdType={}))[Qt.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",Qt[Qt.THRESHOLD_MB=1]="THRESHOLD_MB",(Bt=Vt.TpMachineType||(Vt.TpMachineType={})).ALLNODES="ALLNODES",Bt.THORMACHINES="THORMACHINES",Bt.HOLEMACHINES="HOLEMACHINES",Bt.ROXIEMACHINES="ROXIEMACHINES",Bt.MACHINES="MACHINES",Bt.AVAILABLEMACHINES="AVAILABLEMACHINES",Bt.DROPZONE="DROPZONE",Bt.STANDBYNNODE="STANDBYNNODE",Bt.THORSPARENODES="THORSPARENODES",Bt.HOLESTANDBYNODES="HOLESTANDBYNODES";const Ot=class _MachineServiceBase extends K{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e,"json",!1,void 0,"GetComponentStatusResponse")}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e,"json",!1,void 0,"GetComponentUsageResponse")}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e,"json",!1,void 0,"GetMachineInfoResponse")}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e,"json",!1,void 0,"GetMachineInfoResponseEx")}GetMetrics(e){return this._connection.send("GetMetrics",e,"json",!1,void 0,"MetricsResponse")}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e,"json",!1,void 0,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e,"json",!1,void 0,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e,"json",!1,void 0,"GetTargetClusterUsageResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_machinePingResponse")}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e,"json",!1,void 0,"UpdateComponentStatusResponse")}};t(Ot,"MachineServiceBase");let Xt=Ot;const Ht=class _MachineService extends Xt{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(e=>i("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{const t=e.ComponentUsages.ComponentUsage.map(e=>{const t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{const t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:kt(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:jt(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed)}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce((e,t)=>e+(t.Description||""),""),mean:kt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:jt(t.filter(e=>!isNaN(e.max)),e=>e.max)}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce((e,t)=>e+(t.MachineUsagesDescription||""),""),mean:kt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:jt(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}};t(Ht,"MachineService");let $t=Ht;const Jt=class _PackageProcessServiceBase extends K{constructor(e){super(e,"WsPackageProcess","1.07")}ActivatePackage(e){return this._connection.send("ActivatePackage",e,"json",!1,void 0,"ActivatePackageResponse")}AddPackage(e){return this._connection.send("AddPackage",e,"json",!1,void 0,"AddPackageResponse")}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e,"json",!1,void 0,"AddPartToPackageMapResponse")}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e,"json",!1,void 0,"CopyPackageMapResponse")}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e,"json",!1,void 0,"DeActivatePackageResponse")}DeletePackage(e){return this._connection.send("DeletePackage",e,"json",!1,void 0,"DeletePackageResponse")}Echo(e){return this._connection.send("Echo",e,"json",!1,void 0,"EchoResponse")}GetPackage(e){return this._connection.send("GetPackage",e,"json",!1,void 0,"GetPackageResponse")}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e,"json",!1,void 0,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,void 0,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e,"json",!1,void 0,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e,"json",!1,void 0,"GetQueryFileMappingResponse")}ListPackage(e){return this._connection.send("ListPackage",e,"json",!1,void 0,"ListPackageResponse")}ListPackages(e){return this._connection.send("ListPackages",e,"json",!1,void 0,"ListPackagesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,void 0,"RemovePartFromPackageMapResponse")}ValidatePackage(e){return this._connection.send("ValidatePackage",e,"json",!1,void 0,"ValidatePackageResponse")}};t(Jt,"PackageProcessServiceBase");let qt=Jt;const Yt=class _PackageProcessService extends qt{};t(Yt,"PackageProcessService");let zt=Yt;const Zt=class _ResourcesServiceBase extends K{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)}};t(Zt,"ResourcesServiceBase");let Kt=Zt;const en=class _ResourcesService extends Kt{};t(en,"ResourcesService");let tn=en;var nn,sn,rn;sn=nn||(nn={}),(rn=sn.WUTypes||(sn.WUTypes={})).ECL="ECL",rn.DFU="DFU";const on=class _SashaServiceBase extends K{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};t(on,"SashaServiceBase");let cn=on;const an=class _SashaService extends cn{};t(an,"SashaService");let un=an;var hn,ln,dn,pn;ln=hn||(hn={}),(dn=ln.LockModes||(ln.LockModes={})).ALL="ALL",dn.READ="READ",dn.WRITE="WRITE",dn.HOLD="HOLD",dn.SUB="SUB",(pn=ln.RoxieControlCmdType||(ln.RoxieControlCmdType={})).Attach="Attach",pn.Detach="Detach",pn.State="State",pn.Reload="Reload",pn.ReloadRetry="ReloadRetry",pn.MemLock="MemLock",pn.MemUnlock="MemUnlock",pn.GetMemLocked="GetMemLocked";const gn=class _SMCServiceBase extends K{constructor(e){super(e,"WsSMC","1.28")}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")}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")}};t(gn,"SMCServiceBase");let mn=gn;const Sn=class _SMCService extends mn{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}};t(Sn,"SMCService");let fn=Sn;const _n=class _storeServiceBase extends K{constructor(e){super(e,"wsstore","1.02")}CreateStore(e){return this._connection.send("CreateStore",e,"json",!1,void 0,"CreateStoreResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"DeleteResponse")}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e,"json",!1,void 0,"DeleteNamespaceResponse")}Fetch(e){return this._connection.send("Fetch",e,"json",!1,void 0,"FetchResponse")}FetchAll(e){return this._connection.send("FetchAll",e,"json",!1,void 0,"FetchAllResponse")}FetchKeyMetadata(e){return this._connection.send("FetchKeyMetadata",e,"json",!1,void 0,"FetchKeyMDResponse")}ListKeys(e){return this._connection.send("ListKeys",e,"json",!1,void 0,"ListKeysResponse")}ListNamespaces(e){return this._connection.send("ListNamespaces",e,"json",!1,void 0,"ListNamespacesResponse")}ListStores(e){return this._connection.send("ListStores",e,"json",!1,void 0,"ListStoresResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"wsstorePingResponse")}Set(e){return this._connection.send("Set",e,"json",!1,void 0,"SetResponse")}};t(_n,"storeServiceBase");let Un=_n;const yn=class _StoreService extends Un{Delete(e){return super.Delete(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Success:!0};throw e})}Fetch(e){return super.Fetch(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Value:void 0};throw e})}};t(yn,"StoreService");let vn=yn;var Cn,Rn,Dn,bn;Rn=Cn||(Cn={}),(Dn=Rn.TpConfigResponseFormat||(Rn.TpConfigResponseFormat={})).XML="XML",Dn.YAML="YAML",(bn=Rn.RoxieQueueFilter||(Rn.RoxieQueueFilter={})).All="All",bn.QueriesOnly="QueriesOnly",bn.WorkunitsOnly="WorkunitsOnly",(e=>{e.ALLNODES="ALLNODES",e.THORMACHINES="THORMACHINES",e.HOLEMACHINES="HOLEMACHINES",e.ROXIEMACHINES="ROXIEMACHINES",e.MACHINES="MACHINES",e.AVAILABLEMACHINES="AVAILABLEMACHINES",e.DROPZONE="DROPZONE",e.STANDBYNNODE="STANDBYNNODE",e.THORSPARENODES="THORSPARENODES",e.HOLESTANDBYNODES="HOLESTANDBYNODES"})(Rn.TpMachineType||(Rn.TpMachineType={}));const Fn=class _TopologyServiceBase extends K{constructor(e){super(e,"WsTopology","1.33")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpComponentConfiguration(e){return this._connection.send("TpComponentConfiguration",e,"json",!1,void 0,"TpComponentConfigurationResponse")}TpConfiguredComponents(e){return this._connection.send("TpConfiguredComponents",e,"json",!1,void 0,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")}};t(Fn,"TopologyServiceBase");let Wn=Fn;const Tn=class _TopologyService extends Wn{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(e=>{if(e.default)return e.default;let t,n;return e.TpLogicalClusters.TpLogicalCluster.some((e,s)=>(0===s&&(n=e),"hthor"===e.Type&&(t=e,!0))),t||n})}};t(Tn,"TopologyService");let An=Tn;var wn,Pn,xn,Ln,En,Mn,Nn,In,jn,kn,Gn,Vn,Qn,Bn,On;Pn=wn||(wn={}),(xn=Pn.ECLWUActions||(Pn.ECLWUActions={})).Abort="Abort",xn.Delete="Delete",xn.Deschedule="Deschedule",xn.Reschedule="Reschedule",xn.Pause="Pause",xn.PauseNow="PauseNow",xn.Protect="Protect",xn.Unprotect="Unprotect",xn.Restore="Restore",xn.Resume="Resume",xn.SetToFailed="SetToFailed",xn.Archive="Archive",(e=>{e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"})(Pn.LogSelectColumnMode||(Pn.LogSelectColumnMode={})),(e=>{e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"})(Pn.SortDirection||(Pn.SortDirection={})),(Ln=Pn.LogEventClass||(Pn.LogEventClass={})).ALL="ALL",Ln.DIS="DIS",Ln.ERR="ERR",Ln.WRN="WRN",Ln.INF="INF",Ln.PRO="PRO",Ln.MET="MET",Ln.EVT="EVT",(En=Pn.WUDetailsAttrValueType||(Pn.WUDetailsAttrValueType={})).Single="Single",En.List="List",En.Multi="Multi",(Mn=Pn.EclDefinitionActions||(Pn.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",Mn.Deploy="Deploy",Mn.Publish="Publish",(Nn=Pn.ErrorMessageFormat||(Pn.ErrorMessageFormat={})).xml="xml",Nn.json="json",Nn.text="text",(In=Pn.LogAccessLogFormat||(Pn.LogAccessLogFormat={}))[In.XML=0]="XML",In[In.JSON=1]="JSON",In[In.CSV=2]="CSV",(jn=Pn.WUExceptionSeverity||(Pn.WUExceptionSeverity={})).info="info",jn.warning="warning",jn.error="error",jn.alert="alert",(kn=Pn.WUQueryFilterSuspendedType||(Pn.WUQueryFilterSuspendedType={})).Allqueries="All queries",kn.Notsuspended="Not suspended",kn.Suspended="Suspended",kn.Suspendedbyuser="Suspended by user",kn.Suspendedbyfirstnode="Suspended by first node",kn.Suspendedbyanynode="Suspended by any node",(Gn=Pn.WUQuerySetFilterType||(Pn.WUQuerySetFilterType={})).All="All",Gn.Id="Id",Gn.Name="Name",Gn.Alias="Alias",Gn.Status="Status",(Vn=Pn.WUProtectFilter||(Pn.WUProtectFilter={})).All="All",Vn.Protected="Protected",Vn.NotProtected="NotProtected",(Pn.QuerySetAliasActionTypes||(Pn.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(Qn=Pn.QuerysetImportActivation||(Pn.QuerysetImportActivation={})).None="None",Qn.ActivateImportedActive="ActivateImportedActive",(Bn=Pn.QuerySetQueryActionTypes||(Pn.QuerySetQueryActionTypes={})).Suspend="Suspend",Bn.Unsuspend="Unsuspend",Bn.ToggleSuspend="ToggleSuspend",Bn.Activate="Activate",Bn.Delete="Delete",Bn.DeleteQueriesAndWUs="DeleteQueriesAndWUs",Bn.RemoveAllAliases="RemoveAllAliases",Bn.ResetQueryStats="ResetQueryStats",(On=Pn.WUQueryActivationMode||(Pn.WUQueryActivationMode={}))[On.DoNotActivateQuery=0]="DoNotActivateQuery",On[On.ActivateQuery=1]="ActivateQuery",On[On.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",On[On.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";const Xn=class _WorkunitsServiceBase extends K{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};t(Xn,"WorkunitsServiceBase");let Hn=Xn;var $n,Jn,qn,Yn=/* @__PURE__ */(e=>(e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound",e))(Yn||{});function zn(e){return"string"==typeof e.Name}function Zn(e){return void 0!==e.TotalClusterTime}function Kn(e){return void 0!==e.StateEx}Jn=$n||($n={}),(qn=Jn.Action||(Jn.Action={}))[qn.Unknown=0]="Unknown",qn[qn.Compile=1]="Compile",qn[qn.Check=2]="Check",qn[qn.Run=3]="Run",qn[qn.ExecuteExisting=4]="ExecuteExisting",qn[qn.Pause=5]="Pause",qn[qn.PauseNow=6]="PauseNow",qn[qn.Resume=7]="Resume",qn[qn.Debug=8]="Debug",qn[qn.__size=9]="__size",t(zn,"isECLResult"),t(Zn,"isWUQueryECLWorkunit"),t(Kn,"isWUInfoWorkunit");const es=class _WorkunitsService extends Hn{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(e=>o({Workunits:{ECLWorkunit:[]}},e))}WUInfo(e){const 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}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(e=>{const t=c(e.Result).children();return t.length?t[0]:null})}};t(es,"WorkunitsService");let ts=es;const ns=class _WorkunitsServiceEx extends Hn{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};t(ns,"WorkunitsServiceEx");let ss=ns;function rs(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function is(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,s=e.slice(0,n);return[s.length>1?s[0]+s.slice(2):s,+e.slice(n+1)]}function os(e){return(e=is(Math.abs(e)))?e[1]:NaN}function cs(e,t){return function(n,s){for(var r=n.length,i=[],o=0,c=e[0],a=0;r>0&&c>0&&(a+c+1>s&&(c=Math.max(1,s-a)),i.push(n.substring(r-=c,r+c)),!((a+=c+1)>s));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function as(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}t(rs,"formatDecimal"),t(is,"formatDecimalParts"),t(os,"exponent"),t(cs,"formatGroup"),t(as,"formatNumerals");var us,hs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ls(e){if(!(t=hs.exec(e)))throw new Error("invalid format: "+e);var t;return new ds({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ds(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ps(e){e:for(var t,n=e.length,s=1,r=-1;s<n;++s)switch(e[s]){case".":r=t=s;break;case"0":0===r&&(r=s),t=s;break;default:if(!+e[s])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}function gs(e,t){var n=is(e,t);if(!n)return e+"";var s=n[0],r=n[1],i=r-(us=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+is(e,Math.max(0,t+i-1))[0]}function ms(e,t){var n=is(e,t);if(!n)return e+"";var s=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+s:s.length>r+1?s.slice(0,r+1)+"."+s.slice(r+1):s+new Array(r-s.length+2).join("0")}t(ls,"formatSpecifier"),ls.prototype=ds.prototype,t(ds,"FormatSpecifier"),ds.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},t(ps,"formatTrim"),t(gs,"formatPrefixAuto"),t(ms,"formatRounded");const Ss={"%":/* @__PURE__ */t(function(e,t){return(100*e).toFixed(t)},"%"),b:/* @__PURE__ */t(function(e){return Math.round(e).toString(2)},"b"),c:/* @__PURE__ */t(function(e){return e+""},"c"),d:rs,e:/* @__PURE__ */t(function(e,t){return e.toExponential(t)},"e"),f:/* @__PURE__ */t(function(e,t){return e.toFixed(t)},"f"),g:/* @__PURE__ */t(function(e,t){return e.toPrecision(t)},"g"),o:/* @__PURE__ */t(function(e){return Math.round(e).toString(8)},"o"),p:/* @__PURE__ */t(function(e,t){return ms(100*e,t)},"p"),r:ms,s:gs,X:/* @__PURE__ */t(function(e){return Math.round(e).toString(16).toUpperCase()},"X"),x:/* @__PURE__ */t(function(e){return Math.round(e).toString(16)},"x")};function fs(e){return e}t(fs,"identity");var _s,Us,ys=Array.prototype.map,vs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Cs(e){var n=void 0===e.grouping||void 0===e.thousands?fs:cs(ys.call(e.grouping,Number),e.thousands+""),s=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?fs:as(ys.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",a=e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var h=(e=ls(e)).fill,l=e.align,d=e.sign,p=e.symbol,g=e.zero,m=e.width,S=e.comma,f=e.precision,_=e.trim,U=e.type;"n"===U?(S=!0,U="g"):Ss[U]||(void 0===f&&(f=12),_=!0,U="g"),(g||"0"===h&&"="===l)&&(g=!0,h="0",l="=");var y="$"===p?s:"#"===p&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",v="$"===p?r:/[%p]/.test(U)?c:"",C=Ss[U],R=/[defgprs%]/.test(U);function D(e){var t,s,r,c=y,p=v;if("c"===U)p=C(e)+p,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:C(Math.abs(e),f),_&&(e=ps(e)),D&&0===+e&&"+"!==d&&(D=!1),c=(D?"("===d?d:a:"-"===d||"("===d?"":d)+c,p=("s"===U?vs[8+us/3]:"")+p+(D&&"("===d?")":""),R)for(t=-1,s=e.length;++t<s;)if(48>(r=e.charCodeAt(t))||r>57){p=(46===r?i+e.slice(t+1):e.slice(t))+p,e=e.slice(0,t);break}}S&&!g&&(e=n(e,1/0));var b=c.length+e.length+p.length,F=b<m?new Array(m-b+1).join(h):"";switch(S&&g&&(e=n(F+e,F.length?m-p.length:1/0),F=""),l){case"<":e=c+e+p+F;break;case"=":e=c+F+e+p;break;case"^":e=F.slice(0,b=F.length>>1)+c+e+p+F.slice(b);break;default:e=F+c+e+p}return o(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),t(D,"format"),D.toString=function(){return e+""},D}function l(e,t){var n=h(((e=ls(e)).type="f",e)),s=3*Math.max(-8,Math.min(8,Math.floor(os(t)/3))),r=Math.pow(10,-s),i=vs[8+s/3];return function(e){return n(r*e)+i}}return t(h,"newFormat"),t(l,"formatPrefix"),{format:h,formatPrefix:l}}function Rs(e){return _s=Cs(e),Us=_s.format,_s.formatPrefix,_s}t(Cs,"formatLocale$1"),Rs({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t(Rs,"defaultLocale$1");var Ds=/* @__PURE__ */new Date,bs=/* @__PURE__ */new Date;function Fs(e,n,s,r){function i(t){return e(t=0===arguments.length?/* @__PURE__ */new Date:/* @__PURE__ */new Date(+t)),t}return t(i,"interval"),i.floor=function(t){return e(t=/* @__PURE__ */new Date(+t)),t},i.ceil=function(t){return e(t=new Date(t-1)),n(t,1),e(t),t},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,t){return n(e=/* @__PURE__ */new Date(+e),null==t?1:Math.floor(t)),e},i.range=function(t,s,r){var o,c=[];if(t=i.ceil(t),r=null==r?1:Math.floor(r),!(t<s&&r>0))return c;do{c.push(o=/* @__PURE__ */new Date(+t)),n(t,r),e(t)}while(o<t&&t<s);return c},i.filter=function(t){return Fs(function(n){if(n>=n)for(;e(n),!t(n);)n.setTime(n-1)},function(e,s){if(e>=e)if(s<0)for(;++s<=0;)for(;n(e,-1),!t(e););else for(;--s>=0;)for(;n(e,1),!t(e););})},s&&(i.count=function(t,n){return Ds.setTime(+t),bs.setTime(+n),e(Ds),e(bs),Math.floor(s(Ds,bs))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}t(Fs,"newInterval");var Ws=864e5,Ts=6048e5,As=Fs(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Ws},function(e){return e.getDate()-1});function ws(e){return Fs(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Ts})}As.range,t(ws,"weekday");var Ps=ws(0),xs=ws(1),Ls=ws(2),Es=ws(3),Ms=ws(4),Ns=ws(5),Is=ws(6);Ps.range,xs.range,Ls.range,Es.range,Ms.range,Ns.range,Is.range;var js=Fs(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});js.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Fs(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},js.range;var ks=Fs(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Ws},function(e){return e.getUTCDate()-1});function Gs(e){return Fs(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Ts})}ks.range,t(Gs,"utcWeekday");var Vs=Gs(0),Qs=Gs(1),Bs=Gs(2),Os=Gs(3),Xs=Gs(4),Hs=Gs(5),$s=Gs(6);Vs.range,Qs.range,Bs.range,Os.range,Xs.range,Hs.range,$s.range;var Js=Fs(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function qs(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ys(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function zs(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Zs(e){var n=e.dateTime,s=e.date,r=e.time,i=e.periods,o=e.days,c=e.shortDays,a=e.months,u=e.shortMonths,h=ar(i),l=ur(i),d=ar(o),p=ur(o),g=ar(c),m=ur(c),S=ar(a),f=ur(a),_=ar(u),U=ur(u),y={a:E,A:M,b:N,B:I,c:null,d:wr,e:wr,f:Mr,g:Hr,G:Jr,H:Pr,I:xr,j:Lr,L:Er,m:Nr,M:Ir,p:j,q:k,Q:fi,s:_i,S:jr,u:kr,U:Gr,V:Qr,w:Br,W:Or,x:null,X:null,y:Xr,Y:$r,Z:qr,"%":Si},v={a:G,A:V,b:Q,B:B,c:null,d:Yr,e:Yr,f:ti,g:di,G:gi,H:zr,I:Zr,j:Kr,L:ei,m:ni,M:si,p:O,q:X,Q:fi,s:_i,S:ri,u:ii,U:oi,V:ai,w:ui,W:hi,x:null,X:null,y:li,Y:pi,Z:mi,"%":Si},C={a:W,A:T,b:A,B:w,c:P,d:yr,e:yr,f:Fr,g:Sr,G:mr,H:Cr,I:Cr,j:vr,L:br,m:Ur,M:Rr,p:F,q:_r,Q:Tr,s:Ar,S:Dr,u:lr,U:dr,V:pr,w:hr,W:gr,x:x,X:L,y:Sr,Y:mr,Z:fr,"%":Wr};function R(e,t){return function(n){var s,r,i,o=[],c=-1,a=0,u=e.length;for(n instanceof Date||(n=/* @__PURE__ */new Date(+n));++c<u;)37===e.charCodeAt(c)&&(o.push(e.slice(a,c)),null!=(r=nr[s=e.charAt(++c)])?s=e.charAt(++c):r="e"===s?" ":"0",(i=t[s])&&(s=i(n,r)),o.push(s),a=c+1);return o.push(e.slice(a,c)),o.join("")}}function D(e,t){return function(n){var s,r,i=zs(1900,void 0,1);if(b(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(r=(s=Ys(zs(i.y,0,1))).getUTCDay(),s=r>4||0===r?Qs.ceil(s):Qs(s),s=ks.offset(s,7*(i.V-1)),i.y=s.getUTCFullYear(),i.m=s.getUTCMonth(),i.d=s.getUTCDate()+(i.w+6)%7):(r=(s=qs(zs(i.y,0,1))).getDay(),s=r>4||0===r?xs.ceil(s):xs(s),s=As.offset(s,7*(i.V-1)),i.y=s.getFullYear(),i.m=s.getMonth(),i.d=s.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),r="Z"in i?Ys(zs(i.y,0,1)).getUTCDay():qs(zs(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(r+5)%7:i.w+7*i.U-(r+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,Ys(i)):qs(i)}}function b(e,t,n,s){for(var r,i,o=0,c=t.length,a=n.length;o<c;){if(s>=a)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=C[r in nr?t.charAt(o++):r])||(s=i(e,n,s))<0)return-1}else if(r!=n.charCodeAt(s++))return-1}return s}function F(e,t,n){var s=h.exec(t.slice(n));return s?(e.p=l[s[0].toLowerCase()],n+s[0].length):-1}function W(e,t,n){var s=g.exec(t.slice(n));return s?(e.w=m[s[0].toLowerCase()],n+s[0].length):-1}function T(e,t,n){var s=d.exec(t.slice(n));return s?(e.w=p[s[0].toLowerCase()],n+s[0].length):-1}function A(e,t,n){var s=_.exec(t.slice(n));return s?(e.m=U[s[0].toLowerCase()],n+s[0].length):-1}function w(e,t,n){var s=S.exec(t.slice(n));return s?(e.m=f[s[0].toLowerCase()],n+s[0].length):-1}function P(e,t,s){return b(e,n,t,s)}function x(e,t,n){return b(e,s,t,n)}function L(e,t,n){return b(e,r,t,n)}function E(e){return c[e.getDay()]}function M(e){return o[e.getDay()]}function N(e){return u[e.getMonth()]}function I(e){return a[e.getMonth()]}function j(e){return i[+(e.getHours()>=12)]}function k(e){return 1+~~(e.getMonth()/3)}function G(e){return c[e.getUTCDay()]}function V(e){return o[e.getUTCDay()]}function Q(e){return u[e.getUTCMonth()]}function B(e){return a[e.getUTCMonth()]}function O(e){return i[+(e.getUTCHours()>=12)]}function X(e){return 1+~~(e.getUTCMonth()/3)}return y.x=R(s,y),y.X=R(r,y),y.c=R(n,y),v.x=R(s,v),v.X=R(r,v),v.c=R(n,v),t(R,"newFormat"),t(D,"newParse"),t(b,"parseSpecifier"),t(F,"parsePeriod"),t(W,"parseShortWeekday"),t(T,"parseWeekday"),t(A,"parseShortMonth"),t(w,"parseMonth"),t(P,"parseLocaleDateTime"),t(x,"parseLocaleDate"),t(L,"parseLocaleTime"),t(E,"formatShortWeekday"),t(M,"formatWeekday"),t(N,"formatShortMonth"),t(I,"formatMonth"),t(j,"formatPeriod"),t(k,"formatQuarter"),t(G,"formatUTCShortWeekday"),t(V,"formatUTCWeekday"),t(Q,"formatUTCShortMonth"),t(B,"formatUTCMonth"),t(O,"formatUTCPeriod"),t(X,"formatUTCQuarter"),{format:/* @__PURE__ */t(function(e){var t=R(e+="",y);return t.toString=function(){return e},t},"format"),parse:/* @__PURE__ */t(function(e){var t=D(e+="",!1);return t.toString=function(){return e},t},"parse"),utcFormat:/* @__PURE__ */t(function(e){var t=R(e+="",v);return t.toString=function(){return e},t},"utcFormat"),utcParse:/* @__PURE__ */t(function(e){var t=D(e+="",!0);return t.toString=function(){return e},t},"utcParse")}}Js.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Fs(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},Js.range,t(qs,"localDate"),t(Ys,"utcDate"),t(zs,"newDate"),t(Zs,"formatLocale");var Ks,er,tr,nr={"-":"",_:" ",0:"0"},sr=/^\s*\d+/,rr=/^%/,ir=/[\\^$*+?|[\]().{}]/g;function or(e,t,n){var s=e<0?"-":"",r=(s?-e:e)+"",i=r.length;return s+(i<n?new Array(n-i+1).join(t)+r:r)}function cr(e){return e.replace(ir,"\\$&")}function ar(e){return new RegExp("^(?:"+e.map(cr).join("|")+")","i")}function ur(e){for(var t={},n=-1,s=e.length;++n<s;)t[e[n].toLowerCase()]=n;return t}function hr(e,t,n){var s=sr.exec(t.slice(n,n+1));return s?(e.w=+s[0],n+s[0].length):-1}function lr(e,t,n){var s=sr.exec(t.slice(n,n+1));return s?(e.u=+s[0],n+s[0].length):-1}function dr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.U=+s[0],n+s[0].length):-1}function pr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.V=+s[0],n+s[0].length):-1}function gr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.W=+s[0],n+s[0].length):-1}function mr(e,t,n){var s=sr.exec(t.slice(n,n+4));return s?(e.y=+s[0],n+s[0].length):-1}function Sr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.y=+s[0]+(+s[0]>68?1900:2e3),n+s[0].length):-1}function fr(e,t,n){var s=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return s?(e.Z=s[1]?0:-(s[2]+(s[3]||"00")),n+s[0].length):-1}function _r(e,t,n){var s=sr.exec(t.slice(n,n+1));return s?(e.q=3*s[0]-3,n+s[0].length):-1}function Ur(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.m=s[0]-1,n+s[0].length):-1}function yr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.d=+s[0],n+s[0].length):-1}function vr(e,t,n){var s=sr.exec(t.slice(n,n+3));return s?(e.m=0,e.d=+s[0],n+s[0].length):-1}function Cr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.H=+s[0],n+s[0].length):-1}function Rr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.M=+s[0],n+s[0].length):-1}function Dr(e,t,n){var s=sr.exec(t.slice(n,n+2));return s?(e.S=+s[0],n+s[0].length):-1}function br(e,t,n){var s=sr.exec(t.slice(n,n+3));return s?(e.L=+s[0],n+s[0].length):-1}function Fr(e,t,n){var s=sr.exec(t.slice(n,n+6));return s?(e.L=Math.floor(s[0]/1e3),n+s[0].length):-1}function Wr(e,t,n){var s=rr.exec(t.slice(n,n+1));return s?n+s[0].length:-1}function Tr(e,t,n){var s=sr.exec(t.slice(n));return s?(e.Q=+s[0],n+s[0].length):-1}function Ar(e,t,n){var s=sr.exec(t.slice(n));return s?(e.s=+s[0],n+s[0].length):-1}function wr(e,t){return or(e.getDate(),t,2)}function Pr(e,t){return or(e.getHours(),t,2)}function xr(e,t){return or(e.getHours()%12||12,t,2)}function Lr(e,t){return or(1+As.count(js(e),e),t,3)}function Er(e,t){return or(e.getMilliseconds(),t,3)}function Mr(e,t){return Er(e,t)+"000"}function Nr(e,t){return or(e.getMonth()+1,t,2)}function Ir(e,t){return or(e.getMinutes(),t,2)}function jr(e,t){return or(e.getSeconds(),t,2)}function kr(e){var t=e.getDay();return 0===t?7:t}function Gr(e,t){return or(Ps.count(js(e)-1,e),t,2)}function Vr(e){var t=e.getDay();return t>=4||0===t?Ms(e):Ms.ceil(e)}function Qr(e,t){return e=Vr(e),or(Ms.count(js(e),e)+(4===js(e).getDay()),t,2)}function Br(e){return e.getDay()}function Or(e,t){return or(xs.count(js(e)-1,e),t,2)}function Xr(e,t){return or(e.getFullYear()%100,t,2)}function Hr(e,t){return or((e=Vr(e)).getFullYear()%100,t,2)}function $r(e,t){return or(e.getFullYear()%1e4,t,4)}function Jr(e,t){var n=e.getDay();return or((e=n>=4||0===n?Ms(e):Ms.ceil(e)).getFullYear()%1e4,t,4)}function qr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+or(t/60|0,"0",2)+or(t%60,"0",2)}function Yr(e,t){return or(e.getUTCDate(),t,2)}function zr(e,t){return or(e.getUTCHours(),t,2)}function Zr(e,t){return or(e.getUTCHours()%12||12,t,2)}function Kr(e,t){return or(1+ks.count(Js(e),e),t,3)}function ei(e,t){return or(e.getUTCMilliseconds(),t,3)}function ti(e,t){return ei(e,t)+"000"}function ni(e,t){return or(e.getUTCMonth()+1,t,2)}function si(e,t){return or(e.getUTCMinutes(),t,2)}function ri(e,t){return or(e.getUTCSeconds(),t,2)}function ii(e){var t=e.getUTCDay();return 0===t?7:t}function oi(e,t){return or(Vs.count(Js(e)-1,e),t,2)}function ci(e){var t=e.getUTCDay();return t>=4||0===t?Xs(e):Xs.ceil(e)}function ai(e,t){return e=ci(e),or(Xs.count(Js(e),e)+(4===Js(e).getUTCDay()),t,2)}function ui(e){return e.getUTCDay()}function hi(e,t){return or(Qs.count(Js(e)-1,e),t,2)}function li(e,t){return or(e.getUTCFullYear()%100,t,2)}function di(e,t){return or((e=ci(e)).getUTCFullYear()%100,t,2)}function pi(e,t){return or(e.getUTCFullYear()%1e4,t,4)}function gi(e,t){var n=e.getUTCDay();return or((e=n>=4||0===n?Xs(e):Xs.ceil(e)).getUTCFullYear()%1e4,t,4)}function mi(){return"+0000"}function Si(){return"%"}function fi(e){return+e}function _i(e){return Math.floor(+e/1e3)}function Ui(e){return(Ks=Zs(e)).format,Ks.parse,er=Ks.utcFormat,tr=Ks.utcParse,Ks}t(or,"pad"),t(cr,"requote"),t(ar,"formatRe"),t(ur,"formatLookup"),t(hr,"parseWeekdayNumberSunday"),t(lr,"parseWeekdayNumberMonday"),t(dr,"parseWeekNumberSunday"),t(pr,"parseWeekNumberISO"),t(gr,"parseWeekNumberMonday"),t(mr,"parseFullYear"),t(Sr,"parseYear"),t(fr,"parseZone"),t(_r,"parseQuarter"),t(Ur,"parseMonthNumber"),t(yr,"parseDayOfMonth"),t(vr,"parseDayOfYear"),t(Cr,"parseHour24"),t(Rr,"parseMinutes"),t(Dr,"parseSeconds"),t(br,"parseMilliseconds"),t(Fr,"parseMicroseconds"),t(Wr,"parseLiteralPercent"),t(Tr,"parseUnixTimestamp"),t(Ar,"parseUnixTimestampSeconds"),t(wr,"formatDayOfMonth"),t(Pr,"formatHour24"),t(xr,"formatHour12"),t(Lr,"formatDayOfYear"),t(Er,"formatMilliseconds"),t(Mr,"formatMicroseconds"),t(Nr,"formatMonthNumber"),t(Ir,"formatMinutes"),t(jr,"formatSeconds"),t(kr,"formatWeekdayNumberMonday"),t(Gr,"formatWeekNumberSunday"),t(Vr,"dISO"),t(Qr,"formatWeekNumberISO"),t(Br,"formatWeekdayNumberSunday"),t(Or,"formatWeekNumberMonday"),t(Xr,"formatYear"),t(Hr,"formatYearISO"),t($r,"formatFullYear"),t(Jr,"formatFullYearISO"),t(qr,"formatZone"),t(Yr,"formatUTCDayOfMonth"),t(zr,"formatUTCHour24"),t(Zr,"formatUTCHour12"),t(Kr,"formatUTCDayOfYear"),t(ei,"formatUTCMilliseconds"),t(ti,"formatUTCMicroseconds"),t(ni,"formatUTCMonthNumber"),t(si,"formatUTCMinutes"),t(ri,"formatUTCSeconds"),t(ii,"formatUTCWeekdayNumberMonday"),t(oi,"formatUTCWeekNumberSunday"),t(ci,"UTCdISO"),t(ai,"formatUTCWeekNumberISO"),t(ui,"formatUTCWeekdayNumberSunday"),t(hi,"formatUTCWeekNumberMonday"),t(li,"formatUTCYear"),t(di,"formatUTCYearISO"),t(pi,"formatUTCFullYear"),t(gi,"formatUTCFullYearISO"),t(mi,"formatUTCZone"),t(Si,"formatLiteralPercent"),t(fi,"formatUnixTimestamp"),t(_i,"formatUnixTimestampSeconds"),Ui({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"]}),t(Ui,"defaultLocale");const yi=class _ECLGraph extends a{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,n){super(),this.wu=e;let s=0;for(const r of n)if(r.GraphName===t.Name&&!r.HasSubGraphId){s=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:s,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>Bi(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>Bi(e))}};t(yi,"ECLGraph");let vi=yi;const Ci=class _GraphCache extends u{constructor(){super(e=>u.hash([e.Name]))}};t(Ci,"GraphCache");let Ri=Ci;function Di(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach(e=>{Di(e,t,n)}),n.pop()}function bi(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}t(Di,"walkXmlJson"),t(bi,"flattenAtt");const Fi=class _XGMMLGraph extends h{};t(Fi,"XGMMLGraph");let Wi=Fi;const Ti=class _XGMMLSubgraph extends l{};t(Ti,"XGMMLSubgraph");let Ai=Ti;const wi=class _XGMMLVertex extends d{};t(wi,"XGMMLVertex");let Pi=wi;const xi=class _XGMMLEdge extends p{};t(xi,"XGMMLEdge");let Li=xi;function Ei(e,t){const n={},s={},r={},i=new Wi(e=>e._.id),o=[i.root];return Di(t,(e,t,i,c)=>{const a=o[o.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){const e=a.createSubgraph(bi(i));o.push(e),n[t.id]=e}const e=a.createVertex(bi(i));s[t.id]=e;break;case"edge":const c=a.createEdge(s[t.source],s[t.target],bi(i));r[t.id]=c}}),i}t(Ei,"createXGMMLGraph");const Mi=class _ScopeGraph extends h{};t(Mi,"ScopeGraph");let Ni=Mi;const Ii=class _ScopeSubgraph extends l{};t(Ii,"ScopeSubgraph");let ji=Ii;const ki=class _ScopeVertex extends d{};t(ki,"ScopeVertex");let Gi=ki;const Vi=class _ScopeEdge extends p{};t(Vi,"ScopeEdge");let Qi=Vi;function Bi(e){const t={},n={},s={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new Ni(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new Ni(e=>e._.Id,o),t[o.ScopeName]=r.root);const e=o.parentScope().split(":");let i=t[o.parentScope()];for(;e.length&&!i;)i=t[e.join(":")],e.pop();if(i){const e=i;t[o.ScopeName]=e.createSubgraph(o)}else console.warn(`Missing SG:Parent (${o.Id}): ${o.parentScope()}`);break;case"activity":const c=t[o.parentScope()];c?s[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":n[o.ScopeName]=o;break;case"function":const a=s[o.parentScope()];a?a._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in n){const e=n[o],s=t[e.parentScope()];if(s){const t=s;try{const n=r.vertex(e.attr("IdSource").RawValue),s=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(n,s,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}t(Bi,"createGraph");const Oi=class _Resource extends a{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;const n=t.split("\\").join("/"),s=n.split("/"),r="res/"+this.wu.Wuid+"/";let i="",o="";0===n.indexOf(r)&&(i=n.substr(r.length),o=s[s.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:i})}};t(Oi,"Resource");let Xi=Oi;const Hi=class _XSDNode{e;constructor(e){this.e=e}fix(){delete this.e}};t(Hi,"XSDNode");let $i=Hi;const Ji=class _XSDXMLNode extends $i{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){const e=this._children[t];"Row"===e.name&&void 0===e.type&&(this._children.push(...e._children),this._children.splice(t,1))}const e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return"All"===e.name&&void 0===e.type}setOfType(){const e=this.children();if(void 0===this.type&&2===e.length){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":case"xs:nonNegativeInteger":case"xs:double":e=8;break;case"xs:string":e=32;break;default:const t="0123456789",n=this.type.lastIndexOf("_"),s=n>0?n:this.type.length;let r=s-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<s&&(e=parseInt(this.type.substring(r+1,s),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}};t(Ji,"XSDXMLNode");let qi=Ji;const Yi=class _XSDSimpleType extends $i{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}}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(Yi,"XSDSimpleType");let zi=Yi;const Zi=class _XSDSchema{root;simpleTypes={};fields(){return this.root.children()}};t(Zi,"XSDSchema");let Ki=Zi;const eo=class _XSDParser extends g{schema=new Ki;simpleType;simpleTypes={};xsdStack=new m;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new qi(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 zi(e)}}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":const t=this.xsdStack.top();for(const n in e.$)t.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};t(eo,"XSDParser");let to=eo;function no(e){const t=new to;return t.parse(e),t.schema}t(no,"parseXSD");const so=class _XSDParser2 extends to{_rootName;schema=new Ki;simpleTypes={};xsdStack=new m;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":const t=new qi(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 zi(e)}}endXMLNode(e){if("xsd:element"===e.name){this.xsdStack.pop().fix()}super.endXMLNode(e)}};t(so,"XSDParser2");let ro=so;function io(e,t){const n=new ro(t);return n.parse(e),n.schema}t(io,"parseXSD2");const oo=class _GlobalResultCache extends u{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}};t(oo,"GlobalResultCache");let co=oo;const ao=new co,uo=class _Result extends a{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,n,s){let r;return Array.isArray(s)?(r=ao.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new _Result(e,t,n,s)),r.set(n)):void 0===s&&("number"==typeof n?r=ao.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+n},()=>new _Result(e,t,n)):"string"==typeof n&&(r=ao.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new _Result(e,t,n)))),r}static attachLogicalFile(e,t,n){return ao.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new _Result(e,t,n,!0))}constructor(e,t,n,s){super(),this.connection=e instanceof ts?e:new ts(e),"boolean"==typeof s&&!0===s?this.set({NodeGroup:t,LogicalFileName:n}):zn(n)&&Array.isArray(s)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:s}):void 0===s?"number"==typeof n?this.set({Wuid:t,ResultSequence:n}):"string"==typeof n?this.set({Wuid:t,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return-1!==this.Total}bypassCache(e){return void 0===e?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(e=>e.Result?.XmlSchema?.xml?(this.xsdSchema=no(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,n=!1,s={},r,o){const c=o??this._bypassCache;return this.WUResult(e,t,!n,s,r,c).then(e=>{const t=e.Result;return delete e.Result,this.set({...e}),i("XmlSchema.xml",t)&&(this.xsdSchema=no(t.XmlSchema.xml)),i("Row",t)?t.Row:this.ResultName&&i(this.ResultName,t)?t[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,n=!1,s={},r,i=!1){const o={NamedValue:{itemcount:0}};for(const a in s)o.NamedValue[o.NamedValue.itemcount++]={Name:a,Value:s[a]};const c={FilterBy:o};return this.Wuid&&void 0!==this.ResultName?(c.Wuid=this.Wuid,c.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(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=n,c.BypassCachedResult=i,this.connection.WUResult(c,r).then(e=>e)}};t(uo,"Result");let ho=uo;const lo=class _ResultCache extends u{constructor(){super(e=>u.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};t(lo,"ResultCache");let po=lo;const go=class _Attribute extends a{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)}};t(go,"Attribute");let mo=go;const So=class _BaseScope extends a{_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(){const e=[],t={start:null,end:null};return this.Properties.Property.forEach(n=>{"ts"===n.Measure&&n.Name.indexOf("Started")>=0?t.start=n:this.ScopeName&&"ts"===n.Measure&&n.Name.indexOf("Finished")>=0?t.end=n:e.push(new mo(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new mo(this,t.start))):t.start?e.push(new mo(this,t.start)):t.end&&e.push(new mo(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(const t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){const 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(const t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return void 0!==this._attributeMap[e]}attr(e){return this._attributeMap[e]||new mo(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const n=[];t=this.Id,n.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&n.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),n.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);const s=this.formattedAttrs();for(const r in s)"Label"===r?t=s[r]:n.push(`<tr><td class="key">${r}</td><td class="value">${s[r]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">${t}</h4>\n <table>\n ${n.join("")}\n </table>\n </div>`}};t(So,"BaseScope");let fo=So;const _o=class _Scope extends fo{wu;constructor(e,t){super(t),this.wu=e}};t(_o,"Scope");let Uo=_o;const yo=class _SourceFile extends a{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,n){super(),this.connection=e instanceof ts?e:new ts(e),this.set({Wuid:t,...n})}};t(yo,"SourceFile");let vo=yo;const Co=class _Timer extends a{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,n){super(),this.connection=e instanceof ts?e:new ts(e);const s=S(n.Value);this.set({Wuid:t,Seconds:Math.round(1e3*s)/1e3,HasSubGraphId:void 0!==n.SubGraphId,...n})}};t(Co,"Timer");let Ro=Co;const Do=er("%Y-%m-%dT%H:%M:%S.%LZ"),bo=tr("%Y-%m-%dT%H:%M:%S.%LZ"),Fo=Us(",");function Wo(e){return e&&!isNaN(+e)?Fo(+e):e}t(Wo,"formatNum");const To="DefinitionList",Ao=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,wo=["Avg","Min","Max","Delta","StdDev"],Po=["SkewMin","SkewMax","NodeMin","NodeMax"],xo=/[A-Z][a-z]*/g;function Lo(e){for(const n of Po){const t=e.indexOf(n);if(0===t){return{measure:"",ext:n,label:e.slice(t+n.length)}}}const t=e.match(xo);if(t?.length){const e=t.shift();let n=t.join("");for(const t of wo){const s=n.indexOf(t);if(0===s)return n=n.slice(s+t.length),{measure:e,ext:t,label:n}}return{measure:e,ext:"",label:n}}return{measure:"",ext:"",label:e}}t(Lo,"_splitMetric");const Eo={};function Mo(e){let t=Eo[e];return t||(t=Lo(e),Eo[e]=t),t}function No(e,t){return e.__formattedProps?.[t]??e[t]}function Io(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function jo(e,t,n){const s=Mo(t);if(!n[s.measure]){n[s.label]=!0;const t=Io(e[`${s.measure}Avg${s.label}`]),r=Io(e[`${s.measure}Min${s.label}`]),i=Io(e[`${s.measure}Max${s.label}`]),o=Io(e[`${s.measure}StdDev${s.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${s.measure}${s.label}`,Value:No(e,`${s.measure}${s.label}`),Avg:No(e,`${s.measure}Avg${s.label}`),Min:No(e,`${s.measure}Min${s.label}`),Max:No(e,`${s.measure}Max${s.label}`),Delta:No(e,`${s.measure}Delta${s.label}`),StdDev:No(e,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:No(e,`SkewMin${s.label}`),SkewMax:No(e,`SkewMax${s.label}`),NodeMin:No(e,`NodeMin${s.label}`),NodeMax:No(e,`NodeMax${s.label}`)}}return null}t(Mo,"splitMetric"),t(No,"formatValue"),t(Io,"safeParseFloat"),t(jo,"formatValues");const ko=n("workunit.ts"),Go=class _WorkunitCache extends u{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}};t(Go,"WorkunitCache");let Vo=Go;const Qo=new Vo,Bo=class _Workunit extends a{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",Yn.Unknown)}get State(){return this.get("State")||Yn[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 po;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,()=>ho.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){const 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 Ro(this.connection,this.Wuid,e))}_graphCache=new Ri;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 vi(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 Xi(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 vo(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 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")}static create(e){const t=new _Workunit(e);return t.connection.WUCreate().then(e=>(Qo.set(t),t.set(e.Workunit),t))}static attach(e,t,n){const s=Qo.get({BaseUrl:e.baseUrl,Wuid:t},()=>new _Workunit(e,t));return n&&s.set(n),s}static existsLocal(e,t){return Qo.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,s=!1){return _Workunit.create(e).then(e=>e.update({QueryText:n})).then(e=>s?e.submit(t,$n.Action.Compile):e.submit(t))}static compile(e,t,n){return _Workunit.submit(e,t,n,!0)}static query(e,t){return new ts(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return _Workunit.attach(e,t.Wuid,t)}))}constructor(e,t){super(),this.connection=new ts(e),this.topologyConnection=new An(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:Yn.Unknown})}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(e=>(this.set(e.Workunit),this))}submit(e,t=$n.Action.Run,n){let s;return s=void 0!==e?Promise.resolve(e):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,t===$n.Action.Debug&&(t=$n.Action.Run,this._debugMode=!0),s.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(n=>(this.set(n.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case Yn.Compiled:return"compile"===this.ActionEx||this._submitAction===$n.Action.Compile;case Yn.Completed:case Yn.Failed:case Yn.Aborted:case Yn.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case Yn.Aborted:case Yn.Failed:return!0}return!1}isDeleted(){return this.StateID===Yn.NotFound}isDebugging(){switch(this.StateID){case Yn.DebugPaused:case Yn.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case Yn.Compiled:case Yn.Running:case Yn.Aborting:case Yn.Blocked:case Yn.DebugPaused:case Yn.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(wn.ECLWUActions.SetToFailed)}pause(){return this.WUAction(wn.ECLWUActions.Pause)}pauseNow(){return this.WUAction(wn.ECLWUActions.PauseNow)}resume(){return this.WUAction(wn.ECLWUActions.Resume)}abort(){return this.WUAction(wn.ECLWUActions.Abort)}protect(){return this.WUAction(wn.ECLWUActions.Protect)}unprotect(){return this.WUAction(wn.ECLWUActions.Unprotect)}delete(){return this.WUAction(wn.ECLWUActions.Delete)}restore(){return this.WUAction(wn.ECLWUActions.Restore)}deschedule(){return this.WUAction(wn.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(wn.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>_Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID!==Yn.Compiled||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={}){return this.WUDetails(e).then(e=>e.Scopes.Scope)}normalizeDetails(e,t){const n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},s=/* @__PURE__ */new Map;for(const o of e.Activities?.Activity??[])s.set(o.Kind,o.Name);const r=new Array(t.length);for(let o=0;o<t.length;o++){const e=t[o],c={},a={};if(e.Id&&e.Properties?.Property)for(const t of e.Properties.Property){const e=t.Measure,r=t.Name,i=t.RawValue;if("ns"===e&&(t.Measure="s"),"Kind"===r){const e=parseInt(i,10);t.Formatted=s.get(e)??i}switch(n[r]={Name:t.Name,Measure:t.Measure,Creator:t.Creator,CreatorType:t.CreatorType},t.Measure){case"bool":c[r]=!!+i;break;case"sz":case"ns":case"cnt":case"node":case"skw":c[r]=+i;break;case"s":c[r]=+i/1e9;break;case"ts":c[r]=new Date(+i/1e3).toISOString();break;case"cost":c[r]=+i/1e6;break;default:c[r]=i}a[r]=Wo(t.Formatted??c[r])}const u={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},h=u[To];if(h)try{const e=JSON.parse(h.split("\\").join("\\\\")),t=[];for(let n=0;n<e.length;n++){const s=e[n].match(Ao);s&&t.push({filePath:(s[1]??"")+s[2]+s[3],line:parseInt(s[5],10),col:parseInt(s[6],10)})}u[To]=t}catch(i){ko.error(`Unexpected "DefinitionList": ${h}`)}const l={};let d=0,p="";for(const t in u)if(!t.startsWith("__")){const e=jo(u,t,l);e&&(u.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>d&&(d=e.StdDevs,p=e.Key))}u.__StdDevs=d,u.__StdDevsSource=p,r[o]=u}return{meta:e,columns:n,data:r}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(e=>this.normalizeDetails(e[0],e[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope.map(e=>new Uo(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],n={};e.Scopes.Scope.forEach(e=>{if(n[e.ScopeName])return n[e.ScopeName].update(e),null;{const t=new Uo(this,e);return n[t.ScopeName]=t,t}});for(const s in n)if(n.hasOwnProperty(s)){const e=n[s],r=e.parentScope();r&&n[r]?n[r].children().push(e):t.push(e)}return t})}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(e=>Bi(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{const t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(n=>{"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});const n=[];for(const s in t){const e=t[s];if(e.start&&e.elapsed){const t=bo(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=Do(t),n.push(e)}}return n.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),n})}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,n){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(0===e.Workunits.ECLWorkunit.length?(this.clearState(this.Wuid),this.set("StateID",Yn.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>20081===e.Code&&(this.clearState(this.Wuid),this.set("StateID",Yn.NotFound),!0)))throw ko.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Qo.set(this),e))}WUInfo(e={}){const t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(e=>(this.set(e.Workunit),t&&this.set({ResultViews:e.ResultViews}),e)).catch(e=>{if(!e.Exception.some(e=>20080===e.Code&&(this.clearState(this.Wuid),this.set("StateID",Yn.NotFound),!0)))throw ko.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit(f({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(f({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})).then(e=>f({Scopes:{Scope:[]}},e))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(e=>this.refresh().then(()=>(this._monitor(),e)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:wn.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new ss({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(n)}WUCDebug(e,t={}){let n="";for(const s in t)t.hasOwnProperty(s)&&(n+=` ${s}='${t[s]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(e=>e)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(t=>{const n=t.children(e);return n.length?n[0]:new _(e)}).catch(t=>(ko.error(t),Promise.resolve(new _(e)))):Promise.resolve(new _(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{const 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(e=>{if("break"===e.name)return e.$})}debugBreakpointAdd(e,t,n){return this.debug("breakpoint",{id:e,mode:t,action:n}).then(e=>this.debugBreakpointResponseParser(e))}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=Ei(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Jo(t,e))}debugPrint(e,t=0,n=10){return this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}};t(Bo,"Workunit");let Oo=Bo;const Xo="definition";function Ho(e){return void 0!==e._[Xo]}function $o(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[Xo]);if(t){const[,n,s,r]=t;return n.replace(/\/\.\//g,"/"),{id:e._.id,file:n,line:+s,column:+r}}throw new Error(`Bad definition: ${e._[Xo]}`)}function Jo(e,t){const n=[];for(const s of e.vertices)if(Ho(s)){const e=$o(s);(e&&!t||t===e.file)&&n.push(e)}return n.sort((e,t)=>e.line-t.line)}let qo;t(Ho,"hasECLDefinition"),t($o,"getECLDefinition"),t(Jo,"breakpointLocations");const Yo=class _Activity extends a{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 qo||(qo=new _Activity(e)),t&&qo.set(t),qo}constructor(e){super(),this.connection=e instanceof fn?e:new fn(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>Oo.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=U(async()=>{const e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};t(Yo,"Activity");let zo=Yo;const Zo=n("logicalFile.ts"),Ko=class _LogicalFileCache extends u{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}};t(Ko,"LogicalFileCache");let ec=Ko;const tc=new ec,nc=class _LogicalFile extends a{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,n,s){const r=tc.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new _LogicalFile(e,t,n));return s&&r.set(s),r}constructor(e,t,n){super(),this.connection=e instanceof st?e:new st(e),this.clear({Cluster:t,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){const e=[];for(const t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(const n of t?.DFUFileParts?.DFUPart||[]){const s={...t,...n};delete s.DFUFileParts,e.push(s)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e))}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(e=>20038===e.Code&&(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0)))throw Zo.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||[])}};t(nc,"LogicalFile");let sc=nc;const rc=class _MachineCache extends u{constructor(){super(e=>e.Address)}};t(rc,"MachineCache");let ic=rc;const oc=new ic,cc=class _Machine extends a{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,n){const s=oc.get({Address:t},()=>new _Machine(e));return n&&s.set(n),s}constructor(e){super(),this.connection=e instanceof $t?e:new $t(e)}};t(cc,"Machine");let ac=cc;const uc=class _TargetClusterCache extends u{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}};t(uc,"TargetClusterCache");let hc=uc;const lc=new hc,dc=class _TargetCluster extends a{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=>ac.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){const s=lc.get({BaseUrl:e.baseUrl,Name:t},()=>new _TargetCluster(e,t));return n&&s.set(n),s}constructor(e,t){super(),e instanceof An?(this.connection=e,this.machineConnection=new $t(e.connectionOptions())):(this.connection=new An(e),this.machineConnection=new $t(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const n of e.TargetClusterInfoList.TargetClusterInfo)for(const e of n.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,n=0;for(const s of this.CMachineInfoEx)for(const r of s.Storage.StorageInfo){t+=r.Available,n+=r.Total;const s=1-r.Available/r.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};t(dc,"TargetCluster");let pc=dc;function gc(e){let t;return t=e instanceof An?e:new An(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>pc.attach(e,t.Name,t)))}t(gc,"targetClusters");const mc={};function Sc(e){if(!mc[e.baseUrl]){let t;t=e instanceof An?e:new An(e),mc[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let n,s,r;t.TargetClusters.TpClusterNameType.forEach(e=>{n||(n=e),s||!0!==e.IsDefault||(s=e),r||"hthor"!==e.Type||(r=e)});const i=s||r||n;return pc.attach(e,i.Name,i)})}return mc[e.baseUrl]}t(Sc,"defaultTargetCluster");const fc=class _TopologyCache extends u{constructor(){super(e=>e.BaseUrl)}};t(fc,"TopologyCache");let _c=fc;const Uc=new _c,yc=class _Topology extends a{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=>pc.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const n=Uc.get({BaseUrl:e.baseUrl},()=>new _Topology(e));return t&&n.set(t),n}constructor(e){super(),this.connection=e instanceof An?e:new An(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{const n=this.connection.protocol(),s=this.connection.ip();let r="https:"===n?"18002":"8002";if(i("ServiceList.TpEspServers.TpEspServer",t))for(const o of t.ServiceList.TpEspServers.TpEspServer)if(i("TpBindings.TpBinding",o))for(const t of o.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===n&&(r=t.Port);return`${n}//${s}:${r}/`})}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(e=>(this.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(e=>(this.set({Services:e.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,n){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}};t(yc,"Topology");let vc=yc;function Cc(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=n)}function Rc(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function Dc(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);const t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(e);if(!t)return 0;return 24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9}function bc(e,t){const n=e.indexOf(t);return-1!==n?parseFloat(e.substring(0,n)):-1}function Fc(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=bc(e,"Kb");return t>=0?1024*t:(t=bc(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=bc(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=bc(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=bc(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=bc(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=bc(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=bc(e,"b"),t>=0?t:0)))))))}function Wc(e){return e?parseFloat(e):0}t(Cc,"safeAssign"),t(Rc,"xmlEncode"),t(Dc,"espTime2Seconds"),t(bc,"unitTest"),t(Fc,"espSize2Bytes"),t(Wc,"espSkew2Number");const Tc=class _LocalisedXGMMLWriter{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,n,s){this.noSpills=s,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,n),this.calcOutVertexVisibility(e,n)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),n-1),this.calcOutVertexVisibility(e.getTarget(),n-1)):this.graph.isSubgraph(e)&&(this.m_visibleSubgraphs[e.__hpcc_id]=e,this.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(e=>{this.calcInVertexVisibility(e.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(e=>{this.calcOutVertexVisibility(e.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((e,n)=>{this.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach((e,t)=>{this.m_visibleVertices[e.__hpcc_id]=e});const n={};this.graph.edges.forEach((t,s)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let n="",s="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?s+='<att name="_kind" value="point"/>':"id"===i||"label"===i?n+=" "+i+'="'+Rc(r[i])+'"':s+='<att name="'+i+'" value="'+Rc(r[i])+'"/>';return"<node"+n+">"+s+"</node>"}buildEdgeString(e){let t="",n="";const s=e.getProperties();for(const r in s)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+Rc(s[r])+'"':n+='<att name="'+r+'" value="'+Rc(s[r])+'"/>';return"<edge"+t+">"+n+"</edge>"}getAncestors(e,t){let n=e.__hpcc_parent;for(;n;)t.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,t){const n=[],s=[];this.getAncestors(e,n),this.getAncestors(t,s);let r=n.length-1,i=s.length-1,o=null;for(;r>=0&&i>=0&&n[r]===s[i];)o=n[r],--r,--i;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){const t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(const e in this.m_visibleVertices){const t=this.m_visibleVertices[e];t.getInEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),t.getOutEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),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(const e in this.m_visibleEdges){const t=this.m_visibleEdges[e];let n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getSource(),this.addSemiVisibleVertex(n)}let s=t.getTarget();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getTarget(),this.addSemiVisibleVertex(s)}}}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 n="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const s=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),s===this.m_xgmml.length){const t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}const r=e.getProperties();for(const e in r)n+='<att name="'+e+'" value="'+Rc(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</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))}};t(Tc,"LocalisedXGMMLWriter");let Ac=Tc;const wc=class _GraphItem{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){const e={};for(const t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}};t(wc,"GraphItem");let Pc=wc;const xc=class _Subgraph extends Pc{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType="0"===t?"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,n)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,n)=>{e.vertexVisited(t)})}};t(xc,"Subgraph");let Lc=xc;const Ec=class _Vertex extends Pc{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){const e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(e=>{e.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)}};t(Ec,"Vertex");let Mc=Ec;const Nc=class _Edge extends Pc{_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]}};t(Nc,"Edge");let Ic=Nc;const jc=class _QueryGraph{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;const t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")}isSubgraph(e){return e instanceof Lc}isVertex(e){return e instanceof Mc}isEdge(e){return e instanceof Ic}getGlobalType(e){return e instanceof Mc?3:e instanceof Ic?4:e instanceof Lc?2:e instanceof _QueryGraph?1:0}getGlobalTypeString(e){return e instanceof Mc?"Vertex":e instanceof Ic?"Edge":e instanceof Lc?"Cluster":e instanceof _QueryGraph?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new Lc(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const n=new Mc(this,t);this.vertices.push(n),this.idx[t]=n;break;case"edge":const s=new Ic(this,t);this.edges.push(s),this.idx[t]=s;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const n=this.idx[t];return Array.from(e.attributes).forEach(e=>{Cc(n,e.name,e.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Lc?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof Mc?this.vertices=this.vertices.filter(t=>e!==t):e instanceof Ic&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return n=e,!0}),n}walkDocument(e,t){const n=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":let t=!1;const s=this.getChildByTagName(e,"att");if(s){const r=this.getChildByTagName(s,"graph");if(r){t=!0;const s=this.walkDocument(r,e.getAttribute("id"));n.addSubgraph(s)}}if(!t){const t=this.walkDocument(e,e.getAttribute("id"));n.addVertex(t)}break;case"att":const r=e.getAttribute("name"),i="_"+r,o=e.getAttribute("value");0===r.indexOf("Time")?(Cc(n,i,o),Cc(n,r,""+Dc(o))):0===r.indexOf("Size")?(Cc(n,i,o),Cc(n,r,""+Fc(o))):0===r.indexOf("Skew")?(Cc(n,i,o),Cc(n,r,""+Wc(o))):Cc(n,r,o);break;case"edge":const c=this.walkDocument(e,e.getAttribute("id"));if(void 0!==c.NumRowsProcessed?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.Count?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.count&&(c._eclwatchCount=c.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),c.inputProgress&&(c._eclwatchInputProgress="["+c.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),c.SkewMaxRowsProcessed&&c.SkewMinRowsProcessed&&(c._eclwatchSkew="+"+c.SkewMaxRowsProcessed+", "+c.SkewMinRowsProcessed),c._dependsOn);else if(c._childGraph);else if(c._sourceActivity||c._targetActivity){c._isSpill=!0;const e=c.getSource();e&&(e._isSpill=!0);const t=c.getTarget();t&&(t._isSpill=!0)}n.addEdge(c)}}),n}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof Lc&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,n,s){const r=new Ac(this);return r.calcVisibility(e,t,n,s),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}};t(jc,"QueryGraph");let kc=jc;const Gc=n("@hpcc-js/comms/ecl/query.ts"),Vc=Us("~s");function Qc(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}t(Qc,"isNumber");const Bc=class _QueryCache extends u{constructor(){super(e=>u.hash([e.QueryId,e.QuerySet]))}};t(Bc,"QueryCache");const Oc=new Bc,Xc=class _Query extends a{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,n,s){super(),this.wsWorkunitsService=e instanceof ts?e:new ts(e),this.topology=vc.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...s})}static attach(e,t,n,s){const r=Oc.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new _Query(e,t,n));return s&&r.set(s),r}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(const t of e?.TpEspServers?.TpEspServer??[])for(const e of t?.TpBindings?.TpBinding??[])if("ws_ecl"===e?.Service){const t=`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`;return new dt({baseUrl:t})}})),this._eclService}async fetchDetails(){const e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){const e=await this.wsEclService();try{this._requestSchema=await(e?.requestJson(this.QuerySet,this.QueryId))??[]}catch(t){Gc.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){const e=await this.wsEclService();try{this._responseSchema=await(e?.responseJson(this.QuerySet,this.QueryId))??{}}catch(t){Gc.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(e=>{const t=new kc;let n=!0;for(const s of e?.Graphs?.ECLGraphEx||[])n?(t.load(s.Graph),n=!1):t.merge(s.Graph);return t})}fetchDetailsNormalized(e={}){const t=Oo.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const n=e[0],s=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=n.idx[e.Id.substring(1)];if(!t)return Gc.debug(`Missing graph data for metric ID: ${e.Id}`),e;const s=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const n=e.charAt(0);if("_"!==n&&n===n.toUpperCase()&&!s.has(e)){const n=t[e],s=typeof n;if("string"===s||"number"===s||"boolean"===s){let t=Qc(n)?parseFloat(n):n,s=n;e.indexOf("Time")>=0&&(t/=1e9,s=Vc(t)+"s"),r.push({Name:e,RawValue:t,Formatted:s})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(s,r)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){const t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(e=>{for(const t in e)e[t]=e[t].Row;return e})??[]}catch(n){return Gc.debug(n.message??n),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){const e=[];for(const t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};t(Xc,"Query");let Hc=Xc;const $c=class _StoreCache extends u{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}};t($c,"StoreCache");let Jc=$c;const qc=new Jc,Yc=class _ValueChangedMessage extends y{constructor(e,t,n){super(),this.key=e,this.value=t,this.oldValue=n}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}};t(Yc,"ValueChangedMessage");let zc=Yc;const Zc=class _Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new v;static attach(e,t="HPCCApps",n,s=!0){return qc.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:s,Namespace:n},()=>new _Store(e,t,n,s))}constructor(e,t,n,s){this.connection=e instanceof vn?e:new vn(e),this.Name=t,this.UserSpecific=s,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,n=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(s=>{const r=this._knownValues[e];this._knownValues[e]=t,n&&this._dispatch.post(new zc(e,t,r))}).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(n=>{const s=this._knownValues[e];return this._knownValues[e]=n.Value,t&&this._dispatch.post(new zc(e,n.Value,s)),n.Value}).catch(t=>{console.error(`Store.get(${e}) failed:`,t)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{const n={},s=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete s[t.Key],n[t.Key]=t.Value,e&&this._dispatch.post(new zc(t.Key,t.Value,r))}),e)for(const e in s)this._dispatch.post(new zc(e,void 0,s[e]));return n}).catch(e=>(console.error("Store.getAll failed:",e),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{const s=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new zc(e,void 0,s))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}};t(Zc,"Store");let Kc=Zc;const ea=n("@hpcc-js/comms/dfuWorkunit.ts"),ta=class _DFUWorkunitCache extends u{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}};t(ta,"DFUWorkunitCache");let na=ta;const sa=new na,ra=class _DFUWorkunit extends a{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 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){const n=new _DFUWorkunit(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(sa.set(n),n.set(e.result),n))}static attach(e,t,n){const s=sa.get({BaseUrl:e.baseUrl,ID:t},()=>new _DFUWorkunit(e,t));return n&&s.set(n),s}static sprayFixed(e,t){const n=new ce(e);return n.SprayFixedEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>_DFUWorkunit.attach(e,s,t.result))})}static sprayVariable(e,t){const n=new ce(e);return n.SprayVariableEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>_DFUWorkunit.attach(e,s,t.result))})}static despray(e,t){const n=new ce(e);return n.DesprayEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>_DFUWorkunit.attach(e,s,t.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}return!1}isFailed(){return!(!this.isComplete()||6===this.State)}isDeleted(){return 999===this.State}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(ee.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(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const 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(e=>e).catch(e=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===ee.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,n){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}constructor(e,t){super(),this.connection=new ce(e),this.topologyConnection=new An(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>(20080===e.Code||20081===e.Code)&&(this.clearState(this.ID),this.set("State",999),!0)))throw ea.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};t(ra,"DFUWorkunit");let ia=ra;export{_e as AccessService,Ce as AccountService,zo as Activity,mo as Attribute,D as BUILD_VERSION,fo as BaseScope,we as CloudService,Ne as CodesignService,Q as Connection,Ze as DFUArrayActions,et as DFUChangeProtection,tt as DFUChangeRestriction,Ke as DFUDefFileFormat,st as DFUService,ia as DFUWorkunit,na as DFUWorkunitCache,ct as DFUXRefService,Ge as DaliService,vi as ECLGraph,z as ESPConnection,$ as ESPExceptions,dt as EclService,St as ElkService,ee as FileSpray,ce as FileSprayService,ie as FileSprayStates,co as GlobalResultCache,Ri as GraphCache,wt as LogType,Lt as LogaccessService,sc as LogicalFile,ec as LogicalFileCache,ac as Machine,ic as MachineCache,$t as MachineService,C as PKG_NAME,R as PKG_VERSION,zt as PackageProcessService,wo as PropertyType,Hc as Query,kc as QueryGraph,Po as RelatedProperty,Xi as Resource,tn as ResourcesService,ho as Result,po as ResultCache,fn as SMCService,un as SashaService,Uo as Scope,Qi as ScopeEdge,Ni as ScopeGraph,ji as ScopeSubgraph,Gi as ScopeVertex,K as Service,vo as SourceFile,Kc as Store,Jc as StoreCache,vn as StoreService,Pt as TargetAudience,pc as TargetCluster,hc as TargetClusterCache,Ro as Timer,vc as Topology,_c as TopologyCache,An as TopologyService,zc as ValueChangedMessage,Yn as WUStateID,$n as WUUpdate,Oo as Workunit,Vo as WorkunitCache,ts as WorkunitsService,ss as WorkunitsServiceEx,ae as WsAccess,Pe as WsCodesign,Ve as WsDfu,ft as WsLogaccess,hn as WsSMC,nn as WsSasha,Cn as WsTopology,wn as WsWorkunits,Li as XGMMLEdge,Wi as XGMMLGraph,Ai as XGMMLSubgraph,Pi as XGMMLVertex,$i as XSDNode,Ki as XSDSchema,zi as XSDSimpleType,qi as XSDXMLNode,B as createConnection,Bi as createGraph,Ei as createXGMMLGraph,Sc as defaultTargetCluster,P as deserializeResponse,I as get,G as hookSend,T as instanceOfIConnection,F as instanceOfIOptions,X as isArray,zn as isECLResult,J as isExceptions,Kn as isWUInfoWorkunit,Zn as isWUQueryECLWorkunit,x as jsonp,no as parseXSD,io as parseXSD2,N as post,j as send,w as serializeRequest,O as setTransportFactory,Mo as splitMetric,gc as targetClusters};
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>e(t,"name",{value:n,configurable:!0});import{scopedLogger as n,join as s,promiseTimeout as r,utf8ToBase64 as i,exists as o,deepMixin as c,xml2json as a,StateObject as u,Cache as h,Graph as l,Subgraph as d,Vertex as p,Edge as g,SAXStackParser as m,Stack as S,espTime2Seconds as f,deepMixinT as _,XMLNode as U,debounce as y,Message as v,Dispatch as C}from"@hpcc-js/util";const R="@hpcc-js/comms",D="3.12.1",b="3.16.1",F=n("comms/connection.ts");function W(e){return"baseUrl"in e}t(W,"instanceOfIOptions");const T={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function A(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone}function w(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function P(e,t=!0,n=""){if(n&&(n+="."),"object"!=typeof e)return w(e,t);const s=[];for(const r in e)if(e.hasOwnProperty(r))if(e[r]instanceof Array){let i=!1;e[r].forEach((e,o)=>{"object"==typeof e?(i=!0,s.push(P(e,t,n+w(`${r}.${o}`,t)))):s.push(n+w(`${r}_i${o}`,t)+"="+P(e,t))}),i&&s.push(n+w(`${r}.itemcount`,t)+"="+e[r].length)}else"object"==typeof e[r]?e[r]&&e[r].Item instanceof Array?(s.push(P(e[r].Item,t,n+w(r,t))),s.push(n+w(`${r}.itemcount`,t)+"="+e[r].Item.length)):s.push(P(e[r],t,n+w(r,t))):void 0!==e[r]?s.push(n+w(r,t)+"="+w(e[r],t)):s.push(n+w(r,t));return s.join("&")}function x(e){return JSON.parse(e)}function L(e,n,r={},i="json",o){return o&&console.warn("Header attributes ignored for JSONP connections"),new Promise((o,c)=>{let a=1e3*e.timeoutSecs;const u="jsonp_callback_"+Math.round(999999*Math.random());window[u]=function(e){a=0,p(),o("json"===i&&"string"==typeof e?x(e):e)};const h=document.createElement("script");let l=s(e.baseUrl,n);l+=l.indexOf("?")>=0?"&":"?",h.src=l+"jsonp="+u+"&"+P(r,e.encodeRequest),document.body.appendChild(h);const d=setInterval(function(){a<=0?clearInterval(d):(a-=5e3,a<=0?(clearInterval(d),F.error("Request timeout: "+h.src),p(),c(Error("Request timeout: "+h.src))):F.debug("Request pending ("+a/1e3+" sec): "+h.src))},5e3);function p(){delete window[u],document.body.removeChild(h)}t(p,"doCallback")})}function E(e){return e.userID?{Authorization:`Basic ${i(`${e.userID}:${e.password}`)}`}:{}}t(A,"instanceOfIConnection"),t(w,"encode"),t(P,"serializeRequest"),t(x,"deserializeResponse"),t(L,"jsonp"),t(E,"authHeader");const M={};function N(e,n,i,o,c){function a(e){if(e.ok)return"json"===c?e.json():e.text();throw new Error(e.statusText)}return o={...E(e),...o},i={credentials:M[e.baseUrl]?"omit":"include",...i,headers:o},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),0===e.baseUrl.indexOf("https:")&&(!1===e.rejectUnauthorized&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):i.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(i.agent=fetch.__trustwaveAgent)),t(a,"handleResponse"),r(1e3*e.timeoutSecs,fetch(s(e.baseUrl,n),i).then(a).catch(t=>(i.credentials=M[e.baseUrl]?"include":"omit",fetch(s(e.baseUrl,n),i).then(a).then(t=>(M[e.baseUrl]=!M[e.baseUrl],t)))))}function I(e,t,n,s="json",r){let i;return n.upload_&&(delete n.upload_,t+="?upload_"),n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),N(e,t,{method:"post",body:P(n,e.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...r},s)}function j(e,t,n,s="json",r){let i;return n.abortSignal_&&(i=n.abortSignal_,delete n.abortSignal_),N(e,`${t}?${P(n,e.encodeRequest)}`,{method:"get",signal:i},{...r},s)}function k(e,t,n,s="json",r){let i;switch(e.type){case"jsonp":i=L(e,t,n,s,r);break;case"get":i=j(e,t,n,s,r);break;default:i=I(e,t,n,s,r)}return i}t(N,"doFetch"),t(I,"post"),t(j,"get"),t(k,"send");let G=k;function V(e){const t=G;return e&&(G=e),t}t(V,"hookSend");const Q=class _Connection{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return 0===arguments.length?this._opts:(this._opts={...T,...e},this)}send(e,t,n="json",s){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,G,s):G(this._opts,e,t,n,s)}clone(){return new _Connection(this.opts())}};t(Q,"Connection");let B=Q,O=/* @__PURE__ */t(function(e){return new B(e)},"createConnection");function X(e){const t=O;return O=e,t}function H(e){return"[object Array]"===Object.prototype.toString.call(e)}t(X,"setTransportFactory"),t(H,"isArray");const $=class _ESPExceptions extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,n){super("ESPException: "+n.Source),this.action=e,this.request=t,this.Source=n.Source,this.Exception=n.Exception,n.Exception.length?this.message=`${n.Exception[0].Code}: ${n.Exception[0].Message}`:this.message=""}};t($,"ESPExceptions");let J=$;function q(e){return e instanceof J||e.isESPExceptions&&Array.isArray(e.Exception)}function Y(e){return void 0!==e.send}t(q,"isExceptions"),t(Y,"isConnection");const z=class _ESPConnection{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,n){this._connection=Y(e)?e:O(e),this._service=t,this._version=n}service(e){return void 0===e?this._service:(this._service=e,this)}version(e){return void 0===e?this._version:(this._version=e,this)}toESPStringArray(e,t){if(H(e[t])){for(let n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e}opts(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},n="json",r=!1,i,o){const c={...t,ver_:this._version};let a;r&&(c.upload_=!0),i&&(c.abortSignal_=i);let u="json";switch(n){case"text":a=s(this._service,e),u="text";break;case"xsd":a=s(this._service,e+".xsd"),u="text";break;case"json2":a=s(this._service,e+"/json"),n="json";const t=e.split("/");e=t.pop();break;default:a=s(this._service,e+".json")}return this._connection.send(a,c,u).then(t=>{if("json"===n){let n;if(t&&t.Exceptions)throw new J(e,c,t.Exceptions);if(t&&(n=t[o||e+"Response"]),!n)throw new J(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t})}clone(){return new _ESPConnection(this._connection.clone(),this._service,this._version)}};t(z,"ESPConnection");let Z=z;const K=class _Service{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,n){this._connection=new Z(e,t,n)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};t(K,"Service");let ee=K;var te,ne,se;ne=te||(te={}),(se=ne.DFUWUActions||(ne.DFUWUActions={})).Delete="Delete",se.Protect="Protect",se.Unprotect="Unprotect",se.Restore="Restore",se.SetToFailed="SetToFailed",se.Archive="Archive";const re=class _FileSprayServiceBase extends ee{constructor(e){super(e,"FileSpray","1.27")}AbortDFUWorkunit(e){return this._connection.send("AbortDFUWorkunit",e,"json",!1,void 0,"AbortDFUWorkunitResponse")}Copy(e){return this._connection.send("Copy",e,"json",!1,void 0,"CopyResponse")}CreateDFUPublisherWorkunit(e){return this._connection.send("CreateDFUPublisherWorkunit",e,"json",!1,void 0,"CreateDFUPublisherWorkunitResponse")}CreateDFUWorkunit(e){return this._connection.send("CreateDFUWorkunit",e,"json",!1,void 0,"CreateDFUWorkunitResponse")}DFUWUFile(e){return this._connection.send("DFUWUFile",e,"json",!1,void 0,"DFUWUFileResponse")}DFUWUSearch(e){return this._connection.send("DFUWUSearch",e,"json",!1,void 0,"DFUWUSearchResponse")}DFUWorkunitsAction(e){return this._connection.send("DFUWorkunitsAction",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}DeleteDFUWorkunit(e){return this._connection.send("DeleteDFUWorkunit",e,"json",!1,void 0,"DeleteDFUWorkunitResponse")}DeleteDFUWorkunits(e){return this._connection.send("DeleteDFUWorkunits",e,"json",!1,void 0,"DeleteDFUWorkunitsResponse")}DeleteDropZoneFiles(e){return this._connection.send("DeleteDropZoneFiles",e,"json",!1,void 0,"DFUWorkunitsActionResponse")}Despray(e){return this._connection.send("Despray",e,"json",!1,void 0,"DesprayResponse")}DfuMonitor(e){return this._connection.send("DfuMonitor",e,"json",!1,void 0,"DfuMonitorResponse")}DropZoneFileSearch(e){return this._connection.send("DropZoneFileSearch",e,"json",!1,void 0,"DropZoneFileSearchResponse")}DropZoneFiles(e){return this._connection.send("DropZoneFiles",e,"json",!1,void 0,"DropZoneFilesResponse")}EchoDateTime(e){return this._connection.send("EchoDateTime",e,"json",!1,void 0,"EchoDateTimeResponse")}FileList(e){return this._connection.send("FileList",e,"json",!1,void 0,"FileListResponse")}GetDFUExceptions(e){return this._connection.send("GetDFUExceptions",e,"json",!1,void 0,"GetDFUExceptionsResponse")}GetDFUProgress(e){return this._connection.send("GetDFUProgress",e,"json",!1,void 0,"ProgressResponse")}GetDFUServerQueues(e){return this._connection.send("GetDFUServerQueues",e,"json",!1,void 0,"GetDFUServerQueuesResponse")}GetDFUWorkunit(e){return this._connection.send("GetDFUWorkunit",e,"json",!1,void 0,"GetDFUWorkunitResponse")}GetDFUWorkunits(e){return this._connection.send("GetDFUWorkunits",e,"json",!1,void 0,"GetDFUWorkunitsResponse")}GetRemoteTargets(e){return this._connection.send("GetRemoteTargets",e,"json",!1,void 0,"GetRemoteTargetsResponse")}GetSprayTargets(e){return this._connection.send("GetSprayTargets",e,"json",!1,void 0,"GetSprayTargetsResponse")}OpenSave(e){return this._connection.send("OpenSave",e,"json",!1,void 0,"OpenSaveResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"FileSprayPingResponse")}Rename(e){return this._connection.send("Rename",e,"json",!1,void 0,"RenameResponse")}Replicate(e){return this._connection.send("Replicate",e,"json",!1,void 0,"ReplicateResponse")}ShowResult(e){return this._connection.send("ShowResult",e,"json",!1,void 0,"ShowResultResponse")}SprayFixed(e){return this._connection.send("SprayFixed",e,"json",!1,void 0,"SprayFixedResponse")}SprayVariable(e){return this._connection.send("SprayVariable",e,"json",!1,void 0,"SprayResponse")}SubmitDFUWorkunit(e){return this._connection.send("SubmitDFUWorkunit",e,"json",!1,void 0,"SubmitDFUWorkunitResponse")}UpdateDFUWorkunit(e){return this._connection.send("UpdateDFUWorkunit",e,"json",!1,void 0,"UpdateDFUWorkunitResponse")}};t(re,"FileSprayServiceBase");let ie=re;var oe=/* @__PURE__ */(e=>(e[e.unknown=0]="unknown",e[e.scheduled=1]="scheduled",e[e.queued=2]="queued",e[e.started=3]="started",e[e.aborted=4]="aborted",e[e.failed=5]="failed",e[e.finished=6]="finished",e[e.monitoring=7]="monitoring",e[e.aborting=8]="aborting",e[e.notfound=999]="notfound",e))(oe||{});const ce=class _FileSprayService extends ie{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")}};t(ce,"FileSprayService");let ae=ce;var ue,he,le,de,pe,ge,me;he=ue||(ue={}),(le=he.ViewMemberType||(he.ViewMemberType={})).User="User",le.Group="Group",(de=he.UserSortBy||(he.UserSortBy={})).username="username",de.fullname="fullname",de.passwordexpiration="passwordexpiration",de.employeeID="employeeID",de.employeeNumber="employeeNumber",(pe=he.GroupSortBy||(he.GroupSortBy={})).Name="Name",pe.ManagedBy="ManagedBy",(ge=he.AccountTypeReq||(he.AccountTypeReq={})).Any="Any",ge.User="User",ge.Group="Group",(me=he.ResourcePermissionSortBy||(he.ResourcePermissionSortBy={})).Name="Name",me.Type="Type",(he.ResourceSortBy||(he.ResourceSortBy={})).Name="Name";const Se=class _AccessServiceBase extends ee{constructor(e){super(e,"ws_access","1.17")}AccountPermissions(e){return this._connection.send("AccountPermissions",e,"json",!1,void 0,"AccountPermissionsResponse")}AccountPermissionsV2(e){return this._connection.send("AccountPermissionsV2",e,"json",!1,void 0,"AccountPermissionsV2Response")}AddUser(e){return this._connection.send("AddUser",e,"json",!1,void 0,"AddUserResponse")}AddView(e){return this._connection.send("AddView",e,"json",!1,void 0,"AddViewResponse")}AddViewColumn(e){return this._connection.send("AddViewColumn",e,"json",!1,void 0,"AddViewColumnResponse")}AddViewMember(e){return this._connection.send("AddViewMember",e,"json",!1,void 0,"AddViewMemberResponse")}ClearPermissionsCache(e){return this._connection.send("ClearPermissionsCache",e,"json",!1,void 0,"ClearPermissionsCacheResponse")}DeleteView(e){return this._connection.send("DeleteView",e,"json",!1,void 0,"DeleteViewResponse")}DeleteViewColumn(e){return this._connection.send("DeleteViewColumn",e,"json",!1,void 0,"DeleteViewColumnResponse")}DeleteViewMember(e){return this._connection.send("DeleteViewMember",e,"json",!1,void 0,"DeleteViewMemberResponse")}DisableScopeScans(e){return this._connection.send("DisableScopeScans",e,"json",!1,void 0,"DisableScopeScansResponse")}EnableScopeScans(e){return this._connection.send("EnableScopeScans",e,"json",!1,void 0,"EnableScopeScansResponse")}FilePermission(e){return this._connection.send("FilePermission",e,"json",!1,void 0,"FilePermissionResponse")}GroupAction(e){return this._connection.send("GroupAction",e,"json",!1,void 0,"GroupActionResponse")}GroupAdd(e){return this._connection.send("GroupAdd",e,"json",!1,void 0,"GroupAddResponse")}GroupEdit(e){return this._connection.send("GroupEdit",e,"json",!1,void 0,"GroupEditResponse")}GroupMemberEdit(e){return this._connection.send("GroupMemberEdit",e,"json",!1,void 0,"GroupMemberEditResponse")}GroupMemberEditInput(e){return this._connection.send("GroupMemberEditInput",e,"json",!1,void 0,"GroupMemberEditInputResponse")}GroupMemberQuery(e){return this._connection.send("GroupMemberQuery",e,"json",!1,void 0,"GroupMemberQueryResponse")}GroupQuery(e){return this._connection.send("GroupQuery",e,"json",!1,void 0,"GroupQueryResponse")}Groups(e){return this._connection.send("Groups",e,"json",!1,void 0,"GroupResponse")}PermissionAction(e){return this._connection.send("PermissionAction",e,"json",!1,void 0,"PermissionActionResponse")}Permissions(e){return this._connection.send("Permissions",e,"json",!1,void 0,"BasednsResponse")}PermissionsReset(e){return this._connection.send("PermissionsReset",e,"json",!1,void 0,"PermissionsResetResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accessPingResponse")}QueryScopeScansEnabled(e){return this._connection.send("QueryScopeScansEnabled",e,"json",!1,void 0,"QueryScopeScansEnabledResponse")}QueryUserViewColumns(e){return this._connection.send("QueryUserViewColumns",e,"json",!1,void 0,"QueryUserViewColumnsResponse")}QueryViewColumns(e){return this._connection.send("QueryViewColumns",e,"json",!1,void 0,"QueryViewColumnsResponse")}QueryViewMembers(e){return this._connection.send("QueryViewMembers",e,"json",!1,void 0,"QueryViewMembersResponse")}QueryViews(e){return this._connection.send("QueryViews",e,"json",!1,void 0,"QueryViewsResponse")}ResourceAdd(e){return this._connection.send("ResourceAdd",e,"json",!1,void 0,"ResourceAddResponse")}ResourceDelete(e){return this._connection.send("ResourceDelete",e,"json",!1,void 0,"ResourceDeleteResponse")}ResourcePermissionQuery(e){return this._connection.send("ResourcePermissionQuery",e,"json",!1,void 0,"ResourcePermissionQueryResponse")}ResourcePermissions(e){return this._connection.send("ResourcePermissions",e,"json",!1,void 0,"ResourcePermissionsResponse")}ResourceQuery(e){return this._connection.send("ResourceQuery",e,"json",!1,void 0,"ResourceQueryResponse")}Resources(e){return this._connection.send("Resources",e,"json",!1,void 0,"ResourcesResponse")}UserAccountExport(e){return this._connection.send("UserAccountExport",e,"json",!1,void 0,"UserAccountExportResponse")}UserAction(e){return this._connection.send("UserAction",e,"json",!1,void 0,"UserActionResponse")}UserEdit(e){return this._connection.send("UserEdit",e,"json",!1,void 0,"UserEditResponse")}UserGroupEdit(e){return this._connection.send("UserGroupEdit",e,"json",!1,void 0,"UserGroupEditResponse")}UserGroupEditInput(e){return this._connection.send("UserGroupEditInput",e,"json",!1,void 0,"UserGroupEditInputResponse")}UserInfoEdit(e){return this._connection.send("UserInfoEdit",e,"json",!1,void 0,"UserInfoEditResponse")}UserInfoEditInput(e){return this._connection.send("UserInfoEditInput",e,"json",!1,void 0,"UserInfoEditInputResponse")}UserPosix(e){return this._connection.send("UserPosix",e,"json",!1,void 0,"UserPosixResponse")}UserPosixInput(e){return this._connection.send("UserPosixInput",e,"json",!1,void 0,"UserPosixInputResponse")}UserQuery(e){return this._connection.send("UserQuery",e,"json",!1,void 0,"UserQueryResponse")}UserResetPass(e){return this._connection.send("UserResetPass",e,"json",!1,void 0,"UserResetPassResponse")}UserResetPassInput(e){return this._connection.send("UserResetPassInput",e,"json",!1,void 0,"UserResetPassInputResponse")}UserSudoers(e){return this._connection.send("UserSudoers",e,"json",!1,void 0,"UserSudoersResponse")}UserSudoersInput(e){return this._connection.send("UserSudoersInput",e,"json",!1,void 0,"UserSudoersInputResponse")}Users(e){return this._connection.send("Users",e,"json",!1,void 0,"UserResponse")}};t(Se,"AccessServiceBase");let fe=Se;const _e=class _AccessService extends fe{};t(_e,"AccessService");let Ue=_e;const ye=class _AccountServiceBase extends ee{constructor(e){super(e,"ws_account","1.07")}MyAccount(e){return this._connection.send("MyAccount",e,"json",!1,void 0,"MyAccountResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_accountPingResponse")}UpdateUser(e){return this._connection.send("UpdateUser",e,"json",!1,void 0,"UpdateUserResponse")}UpdateUserInput(e){return this._connection.send("UpdateUserInput",e,"json",!1,void 0,"UpdateUserInputResponse")}VerifyUser(e){return this._connection.send("VerifyUser",e,"json",!1,void 0,"VerifyUserResponse")}};t(ye,"AccountServiceBase");let ve=ye;const Ce=class _AccountService extends ve{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>20043===e.Code))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:e.Exception}};throw e})}};t(Ce,"AccountService");let Re=Ce;const De=class _CloudServiceBase extends ee{constructor(e){super(e,"WsCloud","1.02")}GetPODs(e){return this._connection.send("GetPODs",e,"json",!1,void 0,"GetPODsResponse")}GetServices(e){return this._connection.send("GetServices",e,"json",!1,void 0,"GetServicesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsCloudPingResponse")}};t(De,"CloudServiceBase");let be=De;const Fe=n("@hpcc-js/comms/services/wsCloud.ts");function We(e){return void 0!==e?.Pods}function Te(e){return e.spec?.containers?.reduce((e,t)=>(t.ports?.forEach(t=>{e.push({ContainerPort:t.containerPort,Name:t.name,Protocol:t.protocol})}),e),[])??[]}function Ae(e){return e.filter(e=>{const t=e?.metadata?.labels??{};return t.hasOwnProperty("app.kubernetes.io/part-of")&&"HPCC-Platform"===t["app.kubernetes.io/part-of"]}).map(e=>{const t=new Date(e.metadata?.creationTimestamp);return{Name:e.metadata.name,Status:e.status?.phase,CreationTimestamp:t.toISOString(),ContainerName:e.status?.containerStatuses?.reduce((e,t)=>(t.name&&e.push(t.name),e),[]).join(", ")??"",ContainerCount:e.spec?.containers?.length??0,ContainerReadyCount:e.status?.containerStatuses?.reduce((e,t)=>e+(t.ready?1:0),0),ContainerRestartCount:e.status?.containerStatuses?.reduce((e,t)=>e+t.restartCount,0),Ports:{Port:Te(e)}}})}t(We,"isGetPODsResponse_v1_02"),t(Te,"mapPorts"),t(Ae,"mapPods");const we=class _CloudService extends be{getPODs(){return super.GetPODs({}).then(e=>{if(We(e))return e.Pods?.Pod??[];try{const t="string"==typeof e.Result?JSON.parse(e.Result):e.Result;return Ae(t?.items??[])}catch(t){return Fe.error(`Error parsing V1Pods json '${t instanceof Error?t.message:String(t)}'`),[]}})}};t(we,"CloudService");let Pe=we;var xe,Le;((Le=xe||(xe={})).SigningMethodType||(Le.SigningMethodType={})).gpg="gpg";const Ee=class _CodesignServiceBase extends ee{constructor(e){super(e,"ws_codesign","1.1")}ListUserIDs(e){return this._connection.send("ListUserIDs",e,"json",!1,void 0,"ListUserIDsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_codesignPingResponse")}Sign(e){return this._connection.send("Sign",e,"json",!1,void 0,"SignResponse")}Verify(e){return this._connection.send("Verify",e,"json",!1,void 0,"VerifyResponse")}};t(Ee,"CodesignServiceBase");let Me=Ee;const Ne=class _CodesignService extends Me{ListUserIDsEx(e){return super.ListUserIDs(e).then(e=>e.UserIDs.Item).catch(e=>[])}Sign(e){return super.Sign({SigningMethod:xe.SigningMethodType.gpg,...e})}};t(Ne,"CodesignService");let Ie=Ne;const je=class _DaliServiceBase extends ee{constructor(e){super(e,"WSDali","1.07")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"ResultResponse")}ClearTraceTransactions(e){return this._connection.send("ClearTraceTransactions",e,"json",!1,void 0,"ResultResponse")}Count(e){return this._connection.send("Count",e,"json",!1,void 0,"CountResponse")}DFSCheck(e){return this._connection.send("DFSCheck",e,"json",!1,void 0,"ResultResponse")}DFSExists(e){return this._connection.send("DFSExists",e,"json",!1,void 0,"BooleanResponse")}DFSLS(e){return this._connection.send("DFSLS",e,"json",!1,void 0,"ResultResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"ResultResponse")}DisconnectClientConnection(e){return this._connection.send("DisconnectClientConnection",e,"json",!1,void 0,"ResultResponse")}GetClients(e){return this._connection.send("GetClients",e,"json",!1,void 0,"ResultResponse")}GetConnections(e){return this._connection.send("GetConnections",e,"json",!1,void 0,"ResultResponse")}GetDFSCSV(e){return this._connection.send("GetDFSCSV",e,"json",!1,void 0,"ResultResponse")}GetDFSMap(e){return this._connection.send("GetDFSMap",e,"json",!1,void 0,"ResultResponse")}GetDFSParents(e){return this._connection.send("GetDFSParents",e,"json",!1,void 0,"ResultResponse")}GetLogicalFile(e){return this._connection.send("GetLogicalFile",e,"json",!1,void 0,"ResultResponse")}GetLogicalFilePart(e){return this._connection.send("GetLogicalFilePart",e,"json",!1,void 0,"ResultResponse")}GetProtectedList(e){return this._connection.send("GetProtectedList",e,"json",!1,void 0,"ResultResponse")}GetSDSStats(e){return this._connection.send("GetSDSStats",e,"json",!1,void 0,"ResultResponse")}GetSDSSubscribers(e){return this._connection.send("GetSDSSubscribers",e,"json",!1,void 0,"ResultResponse")}GetValue(e){return this._connection.send("GetValue",e,"json",!1,void 0,"ResultResponse")}Import(e){return this._connection.send("Import",e,"json",!1,void 0,"ResultResponse")}ListSDSLocks(e){return this._connection.send("ListSDSLocks",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSDaliPingResponse")}SaveSDSStore(e){return this._connection.send("SaveSDSStore",e,"json",!1,void 0,"ResultResponse")}SetLogicalFilePartAttr(e){return this._connection.send("SetLogicalFilePartAttr",e,"json",!1,void 0,"ResultResponse")}SetProtected(e){return this._connection.send("SetProtected",e,"json",!1,void 0,"ResultResponse")}SetTraceSlowTransactions(e){return this._connection.send("SetTraceSlowTransactions",e,"json",!1,void 0,"ResultResponse")}SetTraceTransactions(e){return this._connection.send("SetTraceTransactions",e,"json",!1,void 0,"ResultResponse")}SetUnprotected(e){return this._connection.send("SetUnprotected",e,"json",!1,void 0,"ResultResponse")}SetValue(e){return this._connection.send("SetValue",e,"json",!1,void 0,"ResultResponse")}UnlockSDSLock(e){return this._connection.send("UnlockSDSLock",e,"json",!1,void 0,"ResultResponse")}};t(je,"DaliServiceBase");let ke=je;const Ge=class _DaliService extends ke{};t(Ge,"DaliService");let Ve=Ge;var Qe,Be,Oe,Xe,He,$e,Je,qe,Ye;Be=Qe||(Qe={}),(Oe=Be.DFUArrayActions||(Be.DFUArrayActions={})).Delete="Delete",Oe.AddToSuperfile="Add To Superfile",Oe.ChangeProtection="Change Protection",Oe.ChangeRestriction="Change Restriction",(Xe=Be.DFUChangeProtection||(Be.DFUChangeProtection={}))[Xe.NoChange=0]="NoChange",Xe[Xe.Protect=1]="Protect",Xe[Xe.Unprotect=2]="Unprotect",Xe[Xe.UnprotectAll=3]="UnprotectAll",(He=Be.DFUChangeRestriction||(Be.DFUChangeRestriction={}))[He.NoChange=0]="NoChange",He[He.Restrict=1]="Restrict",He[He.Unrestricted=2]="Unrestricted",($e=Be.DFUDefFileFormat||(Be.DFUDefFileFormat={})).xml="xml",$e.def="def",(Je=Be.FileAccessRole||(Be.FileAccessRole={})).Token="Token",Je.Engine="Engine",Je.External="External",(qe=Be.SecAccessType||(Be.SecAccessType={})).None="None",qe.Access="Access",qe.Read="Read",qe.Write="Write",qe.Full="Full",(Ye=Be.DFUFileType||(Be.DFUFileType={})).Flat="Flat",Ye.Index="Index",Ye.Xml="Xml",Ye.Csv="Csv",Ye.Json="Json",Ye.IndexLocal="IndexLocal",Ye.IndexPartitioned="IndexPartitioned",Ye.Unset="Unset";const ze=class _DfuServiceBase extends ee{constructor(e){super(e,"WsDfu","1.67")}Add(e){return this._connection.send("Add",e,"json",!1,void 0,"AddResponse")}AddRemote(e){return this._connection.send("AddRemote",e,"json",!1,void 0,"AddRemoteResponse")}AddtoSuperfile(e){return this._connection.send("AddtoSuperfile",e,"json",!1,void 0,"AddtoSuperfileResponse")}DFUArrayAction(e){return this._connection.send("DFUArrayAction",e,"json",!1,void 0,"DFUArrayActionResponse")}DFUBrowseData(e){return this._connection.send("DFUBrowseData",e,"json",!1,void 0,"DFUBrowseDataResponse")}DFUDefFile(e){return this._connection.send("DFUDefFile",e,"json",!1,void 0,"DFUDefFileResponse")}DFUFileAccess(e){return this._connection.send("DFUFileAccess",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileAccessV2(e){return this._connection.send("DFUFileAccessV2",e,"json",!1,void 0,"DFUFileAccessResponse")}DFUFileCreate(e){return this._connection.send("DFUFileCreate",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFileCreateV2(e){return this._connection.send("DFUFileCreateV2",e,"json",!1,void 0,"DFUFileCreateResponse")}DFUFilePublish(e){return this._connection.send("DFUFilePublish",e,"json",!1,void 0,"DFUFilePublishResponse")}DFUFileView(e){return this._connection.send("DFUFileView",e,"json",!1,void 0,"DFUFileViewResponse")}DFUGetDataColumns(e){return this._connection.send("DFUGetDataColumns",e,"json",!1,void 0,"DFUGetDataColumnsResponse")}DFUGetFileMetaData(e){return this._connection.send("DFUGetFileMetaData",e,"json",!1,void 0,"DFUGetFileMetaDataResponse")}DFUGetMetaInquiry(e){return this._connection.send("DFUGetMetaInquiry",e,"json",!1,void 0,"DFUMetaInquiryResponse")}DFUInfo(e){return this._connection.send("DFUInfo",e,"json",!1,void 0,"DFUInfoResponse")}DFUQuery(e){return this._connection.send("DFUQuery",e,"json",!1,void 0,"DFUQueryResponse")}DFURecordTypeInfo(e){return this._connection.send("DFURecordTypeInfo",e,"json",!1,void 0,"DFURecordTypeInfoResponse")}DFUSearch(e){return this._connection.send("DFUSearch",e,"json",!1,void 0,"DFUSearchResponse")}DFUSearchData(e){return this._connection.send("DFUSearchData",e,"json",!1,void 0,"DFUSearchDataResponse")}DFUSpace(e){return this._connection.send("DFUSpace",e,"json",!1,void 0,"DFUSpaceResponse")}EclRecordTypeInfo(e){return this._connection.send("EclRecordTypeInfo",e,"json",!1,void 0,"EclRecordTypeInfoResponse")}EraseHistory(e){return this._connection.send("EraseHistory",e,"json",!1,void 0,"EraseHistoryResponse")}ListHistory(e){return this._connection.send("ListHistory",e,"json",!1,void 0,"ListHistoryResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDfuPingResponse")}Savexml(e){return this._connection.send("Savexml",e,"json",!1,void 0,"SavexmlResponse")}SuperfileAction(e){return this._connection.send("SuperfileAction",e,"json",!1,void 0,"SuperfileActionResponse")}SuperfileList(e){return this._connection.send("SuperfileList",e,"json",!1,void 0,"SuperfileListResponse")}};t(ze,"DfuServiceBase");let Ze=ze;const Ke=Qe.DFUArrayActions,et=Qe.DFUDefFileFormat,tt=Qe.DFUChangeProtection,nt=Qe.DFUChangeRestriction,st=class _DFUService extends Ze{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}async recursiveFetchLogicalFiles(e){const t=[],n=[];return await Promise.all(e.map(e=>this.DFUInfo({Cluster:e.NodeGroup,Name:e.Name,IncludeJsonTypeInfo:!1,IncludeBinTypeInfo:!1,ForceIndexInfo:!1}).then(e=>{for(const n of e?.FileDetail?.Superfiles?.DFULogicalFile??[])t.push(n);for(const t of e?.FileDetail?.subfiles?.Item??[])n.push(t)}))),n.concat(t.length?await this.recursiveFetchLogicalFiles(t):[])}};t(st,"DFUService");let rt=st;const it=class _DFUXRefServiceBase extends ee{constructor(e){super(e,"WsDFUXRef","1.04")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e,"json",!1,void 0,"DFUXRefArrayActionResponse")}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e,"json",!1,void 0,"DFUXRefBuildResponse")}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e,"json",!1,void 0,"DFUXRefBuildCancelResponse")}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e,"json",!1,void 0,"DFUXRefCleanDirectoriesResponse")}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,"json",!1,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,"json",!1,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e){return this._connection.send("DFUXRefList",e,"json",!1,void 0,"DFUXRefListResponse")}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,"json",!1,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,"json",!1,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,"json",!1,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e,"json",!1,void 0,"DFUXRefUnusedFilesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsDFUXRefPingResponse")}};t(it,"DFUXRefServiceBase");let ot=it;const ct=class _DFUXRefService extends ot{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")}};t(ct,"DFUXRefService");let at=ct;function ut(e,t){const n=typeof t;switch(n){case"boolean":case"number":case"string":return{id:e,type:n};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:ht(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){const n=typeof t.Item[0];if("string"===n||"number"===n)return{id:e,type:"set",fieldType:n};throw new Error("Unknown field type")}return{id:e,type:"object",fields:lt(t)}}default:throw new Error("Unknown field type")}}function ht(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);const t=[];for(const n in e)t.push(ut(n,e[n]));return t}function lt(e){const t={};for(const n in e)t[n]=ut(n,e[n]);return t}t(ut,"jsonToIField"),t(ht,"jsonToIFieldArr"),t(lt,"jsonToIFieldObj");const dt=class _EclService extends ee{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(e=>{const t=JSON.parse(e);for(const n in t)return t[n];return{}}).then(ht)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(e=>{const t=JSON.parse(e);for(const n in t)return t[n].Results;return{}}).then(e=>{const t={};for(const n in e)t[n]=ht(e[n]);return t})}submit(e,t,n){const s=`submit/query/${e}/${t}`;return this._connection.send(s,n,"json2").then(e=>{if(e.Results&&e.Results.Exception)throw new J(s,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})}};t(dt,"EclService");let pt=dt;const gt=class _ElkServiceBase extends ee{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e,"json",!1,void 0,"GetConfigDetailsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_elkPingResponse")}};t(gt,"ElkServiceBase");let mt=gt;const St=class _ElkService extends mt{};t(St,"ElkService");let ft=St;var _t,Ut,yt,vt,Ct,Rt,Dt,bt,Ft,Wt;Ut=_t||(_t={}),(yt=Ut.LogColumnType||(Ut.LogColumnType={})).global="global",yt.workunits="workunits",yt.components="components",yt.audience="audience",yt.class="class",yt.instance="instance",yt.node="node",yt.message="message",yt.logid="logid",yt.processid="processid",yt.threadid="threadid",yt.timestamp="timestamp",yt.pod="pod",yt.traceid="traceid",yt.spanid="spanid",(vt=Ut.LogColumnValueType||(Ut.LogColumnValueType={})).string="string",vt.numeric="numeric",vt.datetime="datetime",vt.enum="enum",vt.epoch="epoch",(Ct=Ut.LogAccessType||(Ut.LogAccessType={}))[Ct.All=0]="All",Ct[Ct.ByJobID=1]="ByJobID",Ct[Ct.ByComponent=2]="ByComponent",Ct[Ct.ByLogType=3]="ByLogType",Ct[Ct.ByTargetAudience=4]="ByTargetAudience",Ct[Ct.BySourceInstance=5]="BySourceInstance",Ct[Ct.BySourceNode=6]="BySourceNode",Ct[Ct.ByFieldName=7]="ByFieldName",Ct[Ct.ByPod=8]="ByPod",Ct[Ct.ByTraceID=9]="ByTraceID",Ct[Ct.BySpanID=10]="BySpanID",(Rt=Ut.LogAccessStatusCode||(Ut.LogAccessStatusCode={}))[Rt.Success=0]="Success",Rt[Rt.Warning=1]="Warning",Rt[Rt.Fail=2]="Fail",(Dt=Ut.LogAccessFilterOperator||(Ut.LogAccessFilterOperator={}))[Dt.NONE=0]="NONE",Dt[Dt.AND=1]="AND",Dt[Dt.OR=2]="OR",(bt=Ut.LogSelectColumnMode||(Ut.LogSelectColumnMode={}))[bt.MIN=0]="MIN",bt[bt.DEFAULT=1]="DEFAULT",bt[bt.ALL=2]="ALL",bt[bt.CUSTOM=3]="CUSTOM",(Ft=Ut.SortColumType||(Ut.SortColumType={}))[Ft.ByDate=0]="ByDate",Ft[Ft.ByJobID=1]="ByJobID",Ft[Ft.ByComponent=2]="ByComponent",Ft[Ft.ByLogType=3]="ByLogType",Ft[Ft.ByTargetAudience=4]="ByTargetAudience",Ft[Ft.BySourceInstance=5]="BySourceInstance",Ft[Ft.BySourceNode=6]="BySourceNode",Ft[Ft.ByFieldName=7]="ByFieldName",Ft[Ft.ByPod=8]="ByPod",Ft[Ft.ByTraceID=9]="ByTraceID",Ft[Ft.BySpanID=10]="BySpanID",(Wt=Ut.SortDirection||(Ut.SortDirection={}))[Wt.ASC=0]="ASC",Wt[Wt.DSC=1]="DSC";const Tt=class _LogaccessServiceBase extends ee{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")}};t(Tt,"LogaccessServiceBase");let At=Tt;const wt=n("@hpcc-js/comms/services/wsLogaccess.ts");var Pt=/* @__PURE__ */(e=>(e.Disaster="DIS",e.Error="ERR",e.Warning="WRN",e.Information="INF",e.Progress="PRO",e.Metric="MET",e))(Pt||{}),xt=/* @__PURE__ */(e=>(e.Operator="OPR",e.User="USR",e.Programmer="PRO",e.Audit="ADT",e))(xt||{});const Lt=class _LogaccessService extends At{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){const n=await this.GetLogAccessInfo(),s={};n.Columns.Column.forEach(e=>s[e.LogType]=e.Name);const r=/* @__PURE__ */t(e=>{const t={};for(const n in s)t[n]=e?.fields?Object.assign({},...e.fields)[s[n]]??"":"";return t},"convertLogLine"),i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:_t.LogAccessType.All}}]}},Range:{StartDate:/* @__PURE__ */new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:_t.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:_t.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(const t in e){let n,r;if(t in s&&(n=Object.values(_t.LogColumnType).includes(t)?t:s[t]),n){switch(n){case _t.LogColumnType.workunits:case"hpcc.log.jobid":r=_t.LogAccessType.ByJobID;break;case _t.LogColumnType.audience:case"hpcc.log.audience":r=_t.LogAccessType.ByTargetAudience;break;case _t.LogColumnType.class:case"hpcc.log.class":r=_t.LogAccessType.ByLogType;break;case _t.LogColumnType.components:case"kubernetes.container.name":r=_t.LogAccessType.ByComponent;break;default:r=_t.LogAccessType.ByFieldName,n=s[t]}if(Array.isArray(e[t]))e[t].forEach(e=>{r===_t.LogAccessType.ByComponent&&(e+="*"),o.push({LogCategory:r,SearchField:n,SearchByValue:e})});else{let s=e[t];r===_t.LogAccessType.ByComponent&&(s+="*"),o.push({LogCategory:r,SearchField:n,SearchByValue:s})}}}if(o.length>2){let e=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((t,n)=>{let s=_t.LogAccessFilterOperator.AND;n>0?(o[n-1].SearchField===t.SearchField&&(s=_t.LogAccessFilterOperator.OR),n===o.length-1?(e.Operator=s,e.rightFilter=t):(e.Operator=s,e.rightBinaryFilter={BinaryLogFilter:[{leftFilter:t}]},e=e.rightBinaryFilter.BinaryLogFilter[0])):e.leftFilter=t})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:_t.LogAccessType.All},o[0]?.SearchField&&(i.Filter.leftFilter={LogCategory:o[0]?.LogCategory,SearchField:o[0]?.SearchField,SearchByValue:o[0]?.SearchByValue}),o[1]?.SearchField&&(i.Filter.Operator=_t.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=_t.LogAccessFilterOperator.OR),i.Filter.rightFilter={LogCategory:o[1]?.LogCategory,SearchField:o[1]?.SearchField,SearchByValue:o[1]?.SearchByValue});return e.StartDate&&(i.Range.StartDate=e.StartDate.toISOString()),e.EndDate&&(i.Range.EndDate=e.EndDate.toISOString()),this.GetLogs(i).then(e=>{try{const t=JSON.parse(e.LogLines);let s=[];switch(n.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":s=t.lines?.map(r)??[];break;default:wt.warning(`Unknown RemoteLogManagerType: ${n.RemoteLogManagerType}`),s=[]}return{lines:s,total:e.TotalLogLinesAvailable??1e4}}catch(t){wt.error(t.message??t)}return{lines:[],total:0}})}};t(Lt,"LogaccessService");let Et=Lt;function Mt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Nt(e){return 1===e.length&&(e=It(e)),{left:/* @__PURE__ */t(function(t,n,s,r){for(null==s&&(s=0),null==r&&(r=t.length);s<r;){var i=s+r>>>1;e(t[i],n)<0?s=i+1:r=i}return s},"left"),right:/* @__PURE__ */t(function(t,n,s,r){for(null==s&&(s=0),null==r&&(r=t.length);s<r;){var i=s+r>>>1;e(t[i],n)>0?r=i:s=i+1}return s},"right")}}function It(e){return function(t,n){return Mt(e(t),n)}}function jt(e){return null===e?NaN:+e}function kt(e,t){var n,s,r=e.length,i=-1;if(null==t){for(;++i<r;)if(null!=(n=e[i])&&n>=n)for(s=n;++i<r;)null!=(n=e[i])&&n>s&&(s=n)}else for(;++i<r;)if(null!=(n=t(e[i],i,e))&&n>=n)for(s=n;++i<r;)null!=(n=t(e[i],i,e))&&n>s&&(s=n);return s}function Gt(e,t){var n,s=e.length,r=s,i=-1,o=0;if(null==t)for(;++i<s;)isNaN(n=jt(e[i]))?--r:o+=n;else for(;++i<s;)isNaN(n=jt(t(e[i],i,e)))?--r:o+=n;if(r)return o/r}var Vt,Qt,Bt,Ot;t(Mt,"ascending"),t(Nt,"bisector"),t(It,"ascendingComparator"),Nt(Mt),t(jt,"number"),t(kt,"d3Max"),t(Gt,"d3Mean"),Qt=Vt||(Vt={}),(Bt=Qt.ThresholdType||(Qt.ThresholdType={}))[Bt.THRESHOLD_PERCENTAGE=0]="THRESHOLD_PERCENTAGE",Bt[Bt.THRESHOLD_MB=1]="THRESHOLD_MB",(Ot=Qt.TpMachineType||(Qt.TpMachineType={})).ALLNODES="ALLNODES",Ot.THORMACHINES="THORMACHINES",Ot.HOLEMACHINES="HOLEMACHINES",Ot.ROXIEMACHINES="ROXIEMACHINES",Ot.MACHINES="MACHINES",Ot.AVAILABLEMACHINES="AVAILABLEMACHINES",Ot.DROPZONE="DROPZONE",Ot.STANDBYNNODE="STANDBYNNODE",Ot.THORSPARENODES="THORSPARENODES",Ot.HOLESTANDBYNODES="HOLESTANDBYNODES";const Xt=class _MachineServiceBase extends ee{constructor(e){super(e,"ws_machine","1.19")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e,"json",!1,void 0,"GetComponentStatusResponse")}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e,"json",!1,void 0,"GetComponentUsageResponse")}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e,"json",!1,void 0,"GetMachineInfoResponse")}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e,"json",!1,void 0,"GetMachineInfoResponseEx")}GetMetrics(e){return this._connection.send("GetMetrics",e,"json",!1,void 0,"MetricsResponse")}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e,"json",!1,void 0,"GetNodeGroupUsageResponse")}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e,"json",!1,void 0,"GetTargetClusterInfoResponse")}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e,"json",!1,void 0,"GetTargetClusterUsageResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_machinePingResponse")}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e,"json",!1,void 0,"UpdateComponentStatusResponse")}};t(Xt,"MachineServiceBase");let Ht=Xt;const $t=class _MachineService extends Ht{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(e=>o("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]).then(e=>e.filter(e=>!!e.ComponentUsages).map(e=>{const t=e.ComponentUsages.ComponentUsage.map(e=>{const t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(e=>{const t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(e=>({...e,InUse:1024*e.InUse,Total:1024*(e.InUse+e.Available),PercentUsed:100-e.PercentAvailable})):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:Gt(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed),max:kt(t.filter(e=>!isNaN(e.PercentUsed)),e=>e.PercentUsed)}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce((e,t)=>e+(t.Description||""),""),mean:Gt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:kt(t.filter(e=>!isNaN(e.max)),e=>e.max)}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce((e,t)=>e+(t.MachineUsagesDescription||""),""),mean:Gt(t.filter(e=>!isNaN(e.mean)),e=>e.mean),max:kt(t.filter(e=>!isNaN(e.max)),e=>e.max)}}))}};t($t,"MachineService");let Jt=$t;const qt=class _PackageProcessServiceBase extends ee{constructor(e){super(e,"WsPackageProcess","1.07")}ActivatePackage(e){return this._connection.send("ActivatePackage",e,"json",!1,void 0,"ActivatePackageResponse")}AddPackage(e){return this._connection.send("AddPackage",e,"json",!1,void 0,"AddPackageResponse")}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e,"json",!1,void 0,"AddPartToPackageMapResponse")}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e,"json",!1,void 0,"CopyPackageMapResponse")}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e,"json",!1,void 0,"DeActivatePackageResponse")}DeletePackage(e){return this._connection.send("DeletePackage",e,"json",!1,void 0,"DeletePackageResponse")}Echo(e){return this._connection.send("Echo",e,"json",!1,void 0,"EchoResponse")}GetPackage(e){return this._connection.send("GetPackage",e,"json",!1,void 0,"GetPackageResponse")}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e,"json",!1,void 0,"GetPackageMapByIdResponse")}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e,"json",!1,void 0,"GetPackageMapSelectOptionsResponse")}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e,"json",!1,void 0,"GetPartFromPackageMapResponse")}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e,"json",!1,void 0,"GetQueryFileMappingResponse")}ListPackage(e){return this._connection.send("ListPackage",e,"json",!1,void 0,"ListPackageResponse")}ListPackages(e){return this._connection.send("ListPackages",e,"json",!1,void 0,"ListPackagesResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsPackageProcessPingResponse")}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e,"json",!1,void 0,"RemovePartFromPackageMapResponse")}ValidatePackage(e){return this._connection.send("ValidatePackage",e,"json",!1,void 0,"ValidatePackageResponse")}};t(qt,"PackageProcessServiceBase");let Yt=qt;const zt=class _PackageProcessService extends Yt{};t(zt,"PackageProcessService");let Zt=zt;const Kt=class _ResourcesServiceBase extends ee{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)}};t(Kt,"ResourcesServiceBase");let en=Kt;const tn=class _ResourcesService extends en{};t(tn,"ResourcesService");let nn=tn;var sn,rn,on;rn=sn||(sn={}),(on=rn.WUTypes||(rn.WUTypes={})).ECL="ECL",on.DFU="DFU";const cn=class _SashaServiceBase extends ee{constructor(e){super(e,"WSSasha","1.01")}ArchiveWU(e){return this._connection.send("ArchiveWU",e,"json",!1,void 0,"ResultResponse")}GetVersion(e){return this._connection.send("GetVersion",e,"json",!1,void 0,"ResultResponse")}ListWU(e){return this._connection.send("ListWU",e,"json",!1,void 0,"ResultResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WSSashaPingResponse")}RestoreWU(e){return this._connection.send("RestoreWU",e,"json",!1,void 0,"ResultResponse")}};t(cn,"SashaServiceBase");let an=cn;const un=class _SashaService extends an{};t(un,"SashaService");let hn=un;var ln,dn,pn,gn;dn=ln||(ln={}),(pn=dn.LockModes||(dn.LockModes={})).ALL="ALL",pn.READ="READ",pn.WRITE="WRITE",pn.HOLD="HOLD",pn.SUB="SUB",(gn=dn.RoxieControlCmdType||(dn.RoxieControlCmdType={})).Attach="Attach",gn.Detach="Detach",gn.State="State",gn.Reload="Reload",gn.ReloadRetry="ReloadRetry",gn.MemLock="MemLock",gn.MemUnlock="MemUnlock",gn.GetMemLocked="GetMemLocked";const mn=class _SMCServiceBase extends ee{constructor(e){super(e,"WsSMC","1.28")}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")}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")}};t(mn,"SMCServiceBase");let Sn=mn;const fn=class _SMCService extends Sn{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(e=>({Running:{ActiveWorkunit:[]},...e}))}};t(fn,"SMCService");let _n=fn;const Un=class _storeServiceBase extends ee{constructor(e){super(e,"wsstore","1.02")}CreateStore(e){return this._connection.send("CreateStore",e,"json",!1,void 0,"CreateStoreResponse")}Delete(e){return this._connection.send("Delete",e,"json",!1,void 0,"DeleteResponse")}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e,"json",!1,void 0,"DeleteNamespaceResponse")}Fetch(e){return this._connection.send("Fetch",e,"json",!1,void 0,"FetchResponse")}FetchAll(e){return this._connection.send("FetchAll",e,"json",!1,void 0,"FetchAllResponse")}FetchKeyMetadata(e){return this._connection.send("FetchKeyMetadata",e,"json",!1,void 0,"FetchKeyMDResponse")}ListKeys(e){return this._connection.send("ListKeys",e,"json",!1,void 0,"ListKeysResponse")}ListNamespaces(e){return this._connection.send("ListNamespaces",e,"json",!1,void 0,"ListNamespacesResponse")}ListStores(e){return this._connection.send("ListStores",e,"json",!1,void 0,"ListStoresResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"wsstorePingResponse")}Set(e){return this._connection.send("Set",e,"json",!1,void 0,"SetResponse")}};t(Un,"storeServiceBase");let yn=Un;const vn=class _StoreService extends yn{Delete(e){return super.Delete(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Success:!0};throw e})}Fetch(e){return super.Fetch(e).catch(e=>{if(e.isESPExceptions&&e.Exception.some(e=>-1===e.Code))return{Exceptions:void 0,Value:void 0};throw e})}};t(vn,"StoreService");let Cn=vn;var Rn,Dn,bn,Fn;Dn=Rn||(Rn={}),(bn=Dn.TpConfigResponseFormat||(Dn.TpConfigResponseFormat={})).XML="XML",bn.YAML="YAML",(Fn=Dn.RoxieQueueFilter||(Dn.RoxieQueueFilter={})).All="All",Fn.QueriesOnly="QueriesOnly",Fn.WorkunitsOnly="WorkunitsOnly",(e=>{e.ALLNODES="ALLNODES",e.THORMACHINES="THORMACHINES",e.HOLEMACHINES="HOLEMACHINES",e.ROXIEMACHINES="ROXIEMACHINES",e.MACHINES="MACHINES",e.AVAILABLEMACHINES="AVAILABLEMACHINES",e.DROPZONE="DROPZONE",e.STANDBYNNODE="STANDBYNNODE",e.THORSPARENODES="THORSPARENODES",e.HOLESTANDBYNODES="HOLESTANDBYNODES"})(Dn.TpMachineType||(Dn.TpMachineType={}));const Wn=class _TopologyServiceBase extends ee{constructor(e){super(e,"WsTopology","1.33")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsTopologyPingResponse")}SystemLog(e){return this._connection.send("SystemLog",e,"json",!1,void 0,"SystemLogResponse")}TpClusterInfo(e){return this._connection.send("TpClusterInfo",e,"json",!1,void 0,"TpClusterInfoResponse")}TpClusterQuery(e){return this._connection.send("TpClusterQuery",e,"json",!1,void 0,"TpClusterQueryResponse")}TpComponentConfiguration(e){return this._connection.send("TpComponentConfiguration",e,"json",!1,void 0,"TpComponentConfigurationResponse")}TpConfiguredComponents(e){return this._connection.send("TpConfiguredComponents",e,"json",!1,void 0,"TpConfiguredComponentsResponse")}TpDropZoneQuery(e){return this._connection.send("TpDropZoneQuery",e,"json",!1,void 0,"TpDropZoneQueryResponse")}TpGetComponentFile(e){return this._connection.send("TpGetComponentFile",e,"json",!1,void 0,"TpGetComponentFileResponse")}TpGetServicePlugins(e){return this._connection.send("TpGetServicePlugins",e,"json",!1,void 0,"TpGetServicePluginsResponse")}TpGroupQuery(e){return this._connection.send("TpGroupQuery",e,"json",!1,void 0,"TpGroupQueryResponse")}TpListLogFiles(e){return this._connection.send("TpListLogFiles",e,"json",!1,void 0,"TpListLogFilesResponse")}TpListTargetClusters(e){return this._connection.send("TpListTargetClusters",e,"json",!1,void 0,"TpListTargetClustersResponse")}TpLogFile(e){return this._connection.send("TpLogFile",e,"json",!1,void 0,"TpLogFileResponse")}TpLogFileDisplay(e){return this._connection.send("TpLogFileDisplay",e,"json",!1,void 0,"TpLogFileResponse")}TpLogicalClusterQuery(e){return this._connection.send("TpLogicalClusterQuery",e,"json",!1,void 0,"TpLogicalClusterQueryResponse")}TpMachineInfo(e){return this._connection.send("TpMachineInfo",e,"json",!1,void 0,"TpMachineInfoResponse")}TpMachineQuery(e){return this._connection.send("TpMachineQuery",e,"json",!1,void 0,"TpMachineQueryResponse")}TpServiceQuery(e){return this._connection.send("TpServiceQuery",e,"json",!1,void 0,"TpServiceQueryResponse")}TpSetMachineStatus(e){return this._connection.send("TpSetMachineStatus",e,"json",!1,void 0,"TpSetMachineStatusResponse")}TpSwapNode(e){return this._connection.send("TpSwapNode",e,"json",!1,void 0,"TpSwapNodeResponse")}TpTargetClusterQuery(e){return this._connection.send("TpTargetClusterQuery",e,"json",!1,void 0,"TpTargetClusterQueryResponse")}TpThorStatus(e){return this._connection.send("TpThorStatus",e,"json",!1,void 0,"TpThorStatusResponse")}TpXMLFile(e){return this._connection.send("TpXMLFile",e,"json",!1,void 0,"TpXMLFileResponse")}};t(Wn,"TopologyServiceBase");let Tn=Wn;const An=class _TopologyService extends Tn{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(e=>{if(e.default)return e.default;let t,n;return e.TpLogicalClusters.TpLogicalCluster.some((e,s)=>(0===s&&(n=e),"hthor"===e.Type&&(t=e,!0))),t||n})}};t(An,"TopologyService");let wn=An;var Pn,xn,Ln,En,Mn,Nn,In,jn,kn,Gn,Vn,Qn,Bn,On,Xn;xn=Pn||(Pn={}),(Ln=xn.ECLWUActions||(xn.ECLWUActions={})).Abort="Abort",Ln.Delete="Delete",Ln.Deschedule="Deschedule",Ln.Reschedule="Reschedule",Ln.Pause="Pause",Ln.PauseNow="PauseNow",Ln.Protect="Protect",Ln.Unprotect="Unprotect",Ln.Restore="Restore",Ln.Resume="Resume",Ln.SetToFailed="SetToFailed",Ln.Archive="Archive",(e=>{e[e.MIN=0]="MIN",e[e.DEFAULT=1]="DEFAULT",e[e.ALL=2]="ALL",e[e.CUSTOM=3]="CUSTOM"})(xn.LogSelectColumnMode||(xn.LogSelectColumnMode={})),(e=>{e[e.ASC=0]="ASC",e[e.DSC=1]="DSC"})(xn.SortDirection||(xn.SortDirection={})),(En=xn.LogEventClass||(xn.LogEventClass={})).ALL="ALL",En.DIS="DIS",En.ERR="ERR",En.WRN="WRN",En.INF="INF",En.PRO="PRO",En.MET="MET",En.EVT="EVT",(Mn=xn.WUDetailsAttrValueType||(xn.WUDetailsAttrValueType={})).Single="Single",Mn.List="List",Mn.Multi="Multi",(Nn=xn.EclDefinitionActions||(xn.EclDefinitionActions={})).SyntaxCheck="SyntaxCheck",Nn.Deploy="Deploy",Nn.Publish="Publish",(In=xn.ErrorMessageFormat||(xn.ErrorMessageFormat={})).xml="xml",In.json="json",In.text="text",(jn=xn.LogAccessLogFormat||(xn.LogAccessLogFormat={}))[jn.XML=0]="XML",jn[jn.JSON=1]="JSON",jn[jn.CSV=2]="CSV",(kn=xn.WUExceptionSeverity||(xn.WUExceptionSeverity={})).info="info",kn.warning="warning",kn.error="error",kn.alert="alert",(Gn=xn.WUQueryFilterSuspendedType||(xn.WUQueryFilterSuspendedType={})).Allqueries="All queries",Gn.Notsuspended="Not suspended",Gn.Suspended="Suspended",Gn.Suspendedbyuser="Suspended by user",Gn.Suspendedbyfirstnode="Suspended by first node",Gn.Suspendedbyanynode="Suspended by any node",(Vn=xn.WUQuerySetFilterType||(xn.WUQuerySetFilterType={})).All="All",Vn.Id="Id",Vn.Name="Name",Vn.Alias="Alias",Vn.Status="Status",(Qn=xn.WUProtectFilter||(xn.WUProtectFilter={})).All="All",Qn.Protected="Protected",Qn.NotProtected="NotProtected",(xn.QuerySetAliasActionTypes||(xn.QuerySetAliasActionTypes={})).Deactivate="Deactivate",(Bn=xn.QuerysetImportActivation||(xn.QuerysetImportActivation={})).None="None",Bn.ActivateImportedActive="ActivateImportedActive",(On=xn.QuerySetQueryActionTypes||(xn.QuerySetQueryActionTypes={})).Suspend="Suspend",On.Unsuspend="Unsuspend",On.ToggleSuspend="ToggleSuspend",On.Activate="Activate",On.Delete="Delete",On.DeleteQueriesAndWUs="DeleteQueriesAndWUs",On.RemoveAllAliases="RemoveAllAliases",On.ResetQueryStats="ResetQueryStats",(Xn=xn.WUQueryActivationMode||(xn.WUQueryActivationMode={}))[Xn.DoNotActivateQuery=0]="DoNotActivateQuery",Xn[Xn.ActivateQuery=1]="ActivateQuery",Xn[Xn.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",Xn[Xn.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious";const Hn=class _WorkunitsServiceBase extends ee{constructor(e){super(e,"WsWorkunits","2.02")}GVCAjaxGraph(e){return this._connection.send("GVCAjaxGraph",e,"json",!1,void 0,"GVCAjaxGraphResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"WsWorkunitsPingResponse")}WUAbort(e){return this._connection.send("WUAbort",e,"json",!1,void 0,"WUAbortResponse")}WUAction(e){return this._connection.send("WUAction",e,"json",!1,void 0,"WUActionResponse")}WUAddLocalFileToWorkunit(e){return this._connection.send("WUAddLocalFileToWorkunit",e,"json",!1,void 0,"WUAddLocalFileToWorkunitResponse")}WUAnalyseHotspot(e){return this._connection.send("WUAnalyseHotspot",e,"json",!1,void 0,"WUAnalyseHotspotResponse")}WUCDebug(e){return this._connection.send("WUCDebug",e,"json",!1,void 0,"WUDebugResponse")}WUCheckFeatures(e){return this._connection.send("WUCheckFeatures",e,"json",!1,void 0,"WUCheckFeaturesResponse")}WUClusterJobQueueLOG(e){return this._connection.send("WUClusterJobQueueLOG",e,"json",!1,void 0,"WUClusterJobQueueLOGResponse")}WUClusterJobQueueXLS(e){return this._connection.send("WUClusterJobQueueXLS",e,"json",!1,void 0,"WUClusterJobQueueXLSResponse")}WUClusterJobSummaryXLS(e){return this._connection.send("WUClusterJobSummaryXLS",e,"json",!1,void 0,"WUClusterJobSummaryXLSResponse")}WUClusterJobXLS(e){return this._connection.send("WUClusterJobXLS",e,"json",!1,void 0,"WUClusterJobXLSResponse")}WUCompileECL(e){return this._connection.send("WUCompileECL",e,"json",!1,void 0,"WUCompileECLResponse")}WUCopyLogicalFiles(e){return this._connection.send("WUCopyLogicalFiles",e,"json",!1,void 0,"WUCopyLogicalFilesResponse")}WUCopyQuerySet(e){return this._connection.send("WUCopyQuerySet",e,"json",!1,void 0,"WUCopyQuerySetResponse")}WUCreate(e){return this._connection.send("WUCreate",e,"json",!1,void 0,"WUCreateResponse")}WUCreateAndUpdate(e){return this._connection.send("WUCreateAndUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUCreateZAPInfo(e){return this._connection.send("WUCreateZAPInfo",e,"json",!1,void 0,"WUCreateZAPInfoResponse")}WUDelete(e){return this._connection.send("WUDelete",e,"json",!1,void 0,"WUDeleteResponse")}WUDeployWorkunit(e){return this._connection.send("WUDeployWorkunit",e,"json",!1,void 0,"WUDeployWorkunitResponse")}WUDetails(e){return this._connection.send("WUDetails",e,"json",!1,void 0,"WUDetailsResponse")}WUDetailsMeta(e){return this._connection.send("WUDetailsMeta",e,"json",!1,void 0,"WUDetailsMetaResponse")}WUEclDefinitionAction(e){return this._connection.send("WUEclDefinitionAction",e,"json",!1,void 0,"WUEclDefinitionActionResponse")}WUExport(e){return this._connection.send("WUExport",e,"json",!1,void 0,"WUExportResponse")}WUFile(e){return this._connection.send("WUFile",e,"json",!1,void 0,"WULogFileResponse")}WUFullResult(e){return this._connection.send("WUFullResult",e,"json",!1,void 0,"WUFullResultResponse")}WUGVCGraphInfo(e){return this._connection.send("WUGVCGraphInfo",e,"json",!1,void 0,"WUGVCGraphInfoResponse")}WUGetArchiveFile(e){return this._connection.send("WUGetArchiveFile",e,"json",!1,void 0,"WUGetArchiveFileResponse")}WUGetDependancyTrees(e){return this._connection.send("WUGetDependancyTrees",e,"json",!1,void 0,"WUGetDependancyTreesResponse")}WUGetGraph(e){return this._connection.send("WUGetGraph",e,"json",!1,void 0,"WUGetGraphResponse")}WUGetGraphNameAndTypes(e){return this._connection.send("WUGetGraphNameAndTypes",e,"json",!1,void 0,"WUGetGraphNameAndTypesResponse")}WUGetNumFileToCopy(e){return this._connection.send("WUGetNumFileToCopy",e,"json",!1,void 0,"WUGetNumFileToCopyResponse")}WUGetPlugins(e){return this._connection.send("WUGetPlugins",e,"json",!1,void 0,"WUGetPluginsResponse")}WUGetStats(e){return this._connection.send("WUGetStats",e,"json",!1,void 0,"WUGetStatsResponse")}WUGetThorJobList(e){return this._connection.send("WUGetThorJobList",e,"json",!1,void 0,"WUGetThorJobListResponse")}WUGetThorJobQueue(e){return this._connection.send("WUGetThorJobQueue",e,"json",!1,void 0,"WUGetThorJobQueueResponse")}WUGetZAPInfo(e){return this._connection.send("WUGetZAPInfo",e,"json",!1,void 0,"WUGetZAPInfoResponse")}WUGraphInfo(e){return this._connection.send("WUGraphInfo",e,"json",!1,void 0,"WUGraphInfoResponse")}WUGraphTiming(e){return this._connection.send("WUGraphTiming",e,"json",!1,void 0,"WUGraphTimingResponse")}WUInfo(e){return this._connection.send("WUInfo",e,"json",!1,void 0,"WUInfoResponse")}WUInfoDetails(e){return this._connection.send("WUInfoDetails",e,"json",!1,void 0,"WUInfoResponse")}WUJobList(e){return this._connection.send("WUJobList",e,"json",!1,void 0,"WUJobListResponse")}WULightWeightQuery(e){return this._connection.send("WULightWeightQuery",e,"json",!1,void 0,"WULightWeightQueryResponse")}WUListArchiveFiles(e){return this._connection.send("WUListArchiveFiles",e,"json",!1,void 0,"WUListArchiveFilesResponse")}WUListLocalFileRequired(e){return this._connection.send("WUListLocalFileRequired",e,"json",!1,void 0,"WUListLocalFileRequiredResponse")}WUListQueries(e){return this._connection.send("WUListQueries",e,"json",!1,void 0,"WUListQueriesResponse")}WUListQueriesUsingFile(e){return this._connection.send("WUListQueriesUsingFile",e,"json",!1,void 0,"WUListQueriesUsingFileResponse")}WUMultiQuerysetDetails(e){return this._connection.send("WUMultiQuerysetDetails",e,"json",!1,void 0,"WUMultiQuerySetDetailsResponse")}WUProcessGraph(e){return this._connection.send("WUProcessGraph",e,"json",!1,void 0,"WUProcessGraphResponse")}WUProtect(e){return this._connection.send("WUProtect",e,"json",!1,void 0,"WUProtectResponse")}WUPublishWorkunit(e){return this._connection.send("WUPublishWorkunit",e,"json",!1,void 0,"WUPublishWorkunitResponse")}WUPushEvent(e){return this._connection.send("WUPushEvent",e,"json",!1,void 0,"WUPushEventResponse")}WUQuery(e){return this._connection.send("WUQuery",e,"json",!1,void 0,"WUQueryResponse")}WUQueryConfig(e){return this._connection.send("WUQueryConfig",e,"json",!1,void 0,"WUQueryConfigResponse")}WUQueryDetails(e){return this._connection.send("WUQueryDetails",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryDetailsLightWeight(e){return this._connection.send("WUQueryDetailsLightWeight",e,"json",!1,void 0,"WUQueryDetailsResponse")}WUQueryFiles(e){return this._connection.send("WUQueryFiles",e,"json",!1,void 0,"WUQueryFilesResponse")}WUQueryGetGraph(e){return this._connection.send("WUQueryGetGraph",e,"json",!1,void 0,"WUQueryGetGraphResponse")}WUQueryGetSummaryStats(e){return this._connection.send("WUQueryGetSummaryStats",e,"json",!1,void 0,"WUQueryGetSummaryStatsResponse")}WUQuerysetAliasAction(e){return this._connection.send("WUQuerysetAliasAction",e,"json",!1,void 0,"WUQuerySetAliasActionResponse")}WUQuerysetCopyQuery(e){return this._connection.send("WUQuerysetCopyQuery",e,"json",!1,void 0,"WUQuerySetCopyQueryResponse")}WUQuerysetDetails(e){return this._connection.send("WUQuerysetDetails",e,"json",!1,void 0,"WUQuerySetDetailsResponse")}WUQuerysetExport(e){return this._connection.send("WUQuerysetExport",e,"json",!1,void 0,"WUQuerysetExportResponse")}WUQuerysetImport(e){return this._connection.send("WUQuerysetImport",e,"json",!1,void 0,"WUQuerysetImportResponse")}WUQuerysetQueryAction(e){return this._connection.send("WUQuerysetQueryAction",e,"json",!1,void 0,"WUQuerySetQueryActionResponse")}WUQuerysets(e){return this._connection.send("WUQuerysets",e,"json",!1,void 0,"WUQuerysetsResponse")}WURecreateQuery(e){return this._connection.send("WURecreateQuery",e,"json",!1,void 0,"WURecreateQueryResponse")}WUResubmit(e){return this._connection.send("WUResubmit",e,"json",!1,void 0,"WUResubmitResponse")}WUResult(e){return this._connection.send("WUResult",e,"json",!1,void 0,"WUResultResponse")}WUResultBin(e){return this._connection.send("WUResultBin",e,"json",!1,void 0,"WUResultBinResponse")}WUResultSummary(e){return this._connection.send("WUResultSummary",e,"json",!1,void 0,"WUResultSummaryResponse")}WUResultView(e){return this._connection.send("WUResultView",e,"json",!1,void 0,"WUResultViewResponse")}WURun(e){return this._connection.send("WURun",e,"json",!1,void 0,"WURunResponse")}WUSchedule(e){return this._connection.send("WUSchedule",e,"json",!1,void 0,"WUScheduleResponse")}WUShowScheduled(e){return this._connection.send("WUShowScheduled",e,"json",!1,void 0,"WUShowScheduledResponse")}WUSubmit(e){return this._connection.send("WUSubmit",e,"json",!1,void 0,"WUSubmitResponse")}WUSyntaxCheckECL(e){return this._connection.send("WUSyntaxCheckECL",e,"json",!1,void 0,"WUSyntaxCheckResponse")}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!1,void 0,"WUUpdateResponse")}WUUpdateQueryEntry(e){return this._connection.send("WUUpdateQueryEntry",e,"json",!1,void 0,"WUUpdateQueryEntryResponse")}WUWaitCompiled(e){return this._connection.send("WUWaitCompiled",e,"json",!1,void 0,"WUWaitResponse")}WUWaitComplete(e){return this._connection.send("WUWaitComplete",e,"json",!1,void 0,"WUWaitResponse")}};t(Hn,"WorkunitsServiceBase");let $n=Hn;var Jn,qn,Yn,zn=/* @__PURE__ */(e=>(e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound",e))(zn||{});function Zn(e){return"string"==typeof e.Name}function Kn(e){return void 0!==e.TotalClusterTime}function es(e){return void 0!==e.StateEx}qn=Jn||(Jn={}),(Yn=qn.Action||(qn.Action={}))[Yn.Unknown=0]="Unknown",Yn[Yn.Compile=1]="Compile",Yn[Yn.Check=2]="Check",Yn[Yn.Run=3]="Run",Yn[Yn.ExecuteExisting=4]="ExecuteExisting",Yn[Yn.Pause=5]="Pause",Yn[Yn.PauseNow=6]="PauseNow",Yn[Yn.Resume=7]="Resume",Yn[Yn.Debug=8]="Debug",Yn[Yn.__size=9]="__size",t(Zn,"isECLResult"),t(Kn,"isWUQueryECLWorkunit"),t(es,"isWUInfoWorkunit");const ts=class _WorkunitsService extends $n{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(e=>c({Workunits:{ECLWorkunit:[]}},e))}WUInfo(e){const 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}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(e=>{const t=a(e.Result).children();return t.length?t[0]:null})}};t(ts,"WorkunitsService");let ns=ts;const ss=class _WorkunitsServiceEx extends $n{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};t(ss,"WorkunitsServiceEx");let rs=ss;function is(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function os(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,s=e.slice(0,n);return[s.length>1?s[0]+s.slice(2):s,+e.slice(n+1)]}function cs(e){return(e=os(Math.abs(e)))?e[1]:NaN}function as(e,t){return function(n,s){for(var r=n.length,i=[],o=0,c=e[0],a=0;r>0&&c>0&&(a+c+1>s&&(c=Math.max(1,s-a)),i.push(n.substring(r-=c,r+c)),!((a+=c+1)>s));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function us(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}t(is,"formatDecimal"),t(os,"formatDecimalParts"),t(cs,"exponent"),t(as,"formatGroup"),t(us,"formatNumerals");var hs,ls=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ds(e){if(!(t=ls.exec(e)))throw new Error("invalid format: "+e);var t;return new ps({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function ps(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function gs(e){e:for(var t,n=e.length,s=1,r=-1;s<n;++s)switch(e[s]){case".":r=t=s;break;case"0":0===r&&(r=s),t=s;break;default:if(!+e[s])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}function ms(e,t){var n=os(e,t);if(!n)return e+"";var s=n[0],r=n[1],i=r-(hs=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=s.length;return i===o?s:i>o?s+new Array(i-o+1).join("0"):i>0?s.slice(0,i)+"."+s.slice(i):"0."+new Array(1-i).join("0")+os(e,Math.max(0,t+i-1))[0]}function Ss(e,t){var n=os(e,t);if(!n)return e+"";var s=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+s:s.length>r+1?s.slice(0,r+1)+"."+s.slice(r+1):s+new Array(r-s.length+2).join("0")}t(ds,"formatSpecifier"),ds.prototype=ps.prototype,t(ps,"FormatSpecifier"),ps.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type},t(gs,"formatTrim"),t(ms,"formatPrefixAuto"),t(Ss,"formatRounded");const fs={"%":/* @__PURE__ */t(function(e,t){return(100*e).toFixed(t)},"%"),b:/* @__PURE__ */t(function(e){return Math.round(e).toString(2)},"b"),c:/* @__PURE__ */t(function(e){return e+""},"c"),d:is,e:/* @__PURE__ */t(function(e,t){return e.toExponential(t)},"e"),f:/* @__PURE__ */t(function(e,t){return e.toFixed(t)},"f"),g:/* @__PURE__ */t(function(e,t){return e.toPrecision(t)},"g"),o:/* @__PURE__ */t(function(e){return Math.round(e).toString(8)},"o"),p:/* @__PURE__ */t(function(e,t){return Ss(100*e,t)},"p"),r:Ss,s:ms,X:/* @__PURE__ */t(function(e){return Math.round(e).toString(16).toUpperCase()},"X"),x:/* @__PURE__ */t(function(e){return Math.round(e).toString(16)},"x")};function _s(e){return e}t(_s,"identity");var Us,ys,vs=Array.prototype.map,Cs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rs(e){var n=void 0===e.grouping||void 0===e.thousands?_s:as(vs.call(e.grouping,Number),e.thousands+""),s=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?_s:us(vs.call(e.numerals,String)),c=void 0===e.percent?"%":e.percent+"",a=e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var h=(e=ds(e)).fill,l=e.align,d=e.sign,p=e.symbol,g=e.zero,m=e.width,S=e.comma,f=e.precision,_=e.trim,U=e.type;"n"===U?(S=!0,U="g"):fs[U]||(void 0===f&&(f=12),_=!0,U="g"),(g||"0"===h&&"="===l)&&(g=!0,h="0",l="=");var y="$"===p?s:"#"===p&&/[boxX]/.test(U)?"0"+U.toLowerCase():"",v="$"===p?r:/[%p]/.test(U)?c:"",C=fs[U],R=/[defgprs%]/.test(U);function D(e){var t,s,r,c=y,p=v;if("c"===U)p=C(e)+p,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:C(Math.abs(e),f),_&&(e=gs(e)),D&&0===+e&&"+"!==d&&(D=!1),c=(D?"("===d?d:a:"-"===d||"("===d?"":d)+c,p=("s"===U?Cs[8+hs/3]:"")+p+(D&&"("===d?")":""),R)for(t=-1,s=e.length;++t<s;)if(48>(r=e.charCodeAt(t))||r>57){p=(46===r?i+e.slice(t+1):e.slice(t))+p,e=e.slice(0,t);break}}S&&!g&&(e=n(e,1/0));var b=c.length+e.length+p.length,F=b<m?new Array(m-b+1).join(h):"";switch(S&&g&&(e=n(F+e,F.length?m-p.length:1/0),F=""),l){case"<":e=c+e+p+F;break;case"=":e=c+F+e+p;break;case"^":e=F.slice(0,b=F.length>>1)+c+e+p+F.slice(b);break;default:e=F+c+e+p}return o(e)}return f=void 0===f?6:/[gprs]/.test(U)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),t(D,"format"),D.toString=function(){return e+""},D}function l(e,t){var n=h(((e=ds(e)).type="f",e)),s=3*Math.max(-8,Math.min(8,Math.floor(cs(t)/3))),r=Math.pow(10,-s),i=Cs[8+s/3];return function(e){return n(r*e)+i}}return t(h,"newFormat"),t(l,"formatPrefix"),{format:h,formatPrefix:l}}function Ds(e){return Us=Rs(e),ys=Us.format,Us.formatPrefix,Us}t(Rs,"formatLocale$1"),Ds({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t(Ds,"defaultLocale$1");var bs=/* @__PURE__ */new Date,Fs=/* @__PURE__ */new Date;function Ws(e,n,s,r){function i(t){return e(t=0===arguments.length?/* @__PURE__ */new Date:/* @__PURE__ */new Date(+t)),t}return t(i,"interval"),i.floor=function(t){return e(t=/* @__PURE__ */new Date(+t)),t},i.ceil=function(t){return e(t=new Date(t-1)),n(t,1),e(t),t},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,t){return n(e=/* @__PURE__ */new Date(+e),null==t?1:Math.floor(t)),e},i.range=function(t,s,r){var o,c=[];if(t=i.ceil(t),r=null==r?1:Math.floor(r),!(t<s&&r>0))return c;do{c.push(o=/* @__PURE__ */new Date(+t)),n(t,r),e(t)}while(o<t&&t<s);return c},i.filter=function(t){return Ws(function(n){if(n>=n)for(;e(n),!t(n);)n.setTime(n-1)},function(e,s){if(e>=e)if(s<0)for(;++s<=0;)for(;n(e,-1),!t(e););else for(;--s>=0;)for(;n(e,1),!t(e););})},s&&(i.count=function(t,n){return bs.setTime(+t),Fs.setTime(+n),e(bs),e(Fs),Math.floor(s(bs,Fs))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}t(Ws,"newInterval");var Ts=864e5,As=6048e5,ws=Ws(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Ts},function(e){return e.getDate()-1});function Ps(e){return Ws(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/As})}ws.range,t(Ps,"weekday");var xs=Ps(0),Ls=Ps(1),Es=Ps(2),Ms=Ps(3),Ns=Ps(4),Is=Ps(5),js=Ps(6);xs.range,Ls.range,Es.range,Ms.range,Ns.range,Is.range,js.range;var ks=Ws(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});ks.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Ws(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},ks.range;var Gs=Ws(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Ts},function(e){return e.getUTCDate()-1});function Vs(e){return Ws(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/As})}Gs.range,t(Vs,"utcWeekday");var Qs=Vs(0),Bs=Vs(1),Os=Vs(2),Xs=Vs(3),Hs=Vs(4),$s=Vs(5),Js=Vs(6);Qs.range,Bs.range,Os.range,Xs.range,Hs.range,$s.range,Js.range;var qs=Ws(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function Ys(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function zs(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zs(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ks(e){var n=e.dateTime,s=e.date,r=e.time,i=e.periods,o=e.days,c=e.shortDays,a=e.months,u=e.shortMonths,h=ur(i),l=hr(i),d=ur(o),p=hr(o),g=ur(c),m=hr(c),S=ur(a),f=hr(a),_=ur(u),U=hr(u),y={a:E,A:M,b:N,B:I,c:null,d:Pr,e:Pr,f:Nr,g:$r,G:qr,H:xr,I:Lr,j:Er,L:Mr,m:Ir,M:jr,p:j,q:k,Q:_i,s:Ui,S:kr,u:Gr,U:Vr,V:Br,w:Or,W:Xr,x:null,X:null,y:Hr,Y:Jr,Z:Yr,"%":fi},v={a:G,A:V,b:Q,B:B,c:null,d:zr,e:zr,f:ni,g:pi,G:mi,H:Zr,I:Kr,j:ei,L:ti,m:si,M:ri,p:O,q:X,Q:_i,s:Ui,S:ii,u:oi,U:ci,V:ui,w:hi,W:li,x:null,X:null,y:di,Y:gi,Z:Si,"%":fi},C={a:W,A:T,b:A,B:w,c:P,d:vr,e:vr,f:Wr,g:fr,G:Sr,H:Rr,I:Rr,j:Cr,L:Fr,m:yr,M:Dr,p:F,q:Ur,Q:Ar,s:wr,S:br,u:dr,U:pr,V:gr,w:lr,W:mr,x:x,X:L,y:fr,Y:Sr,Z:_r,"%":Tr};function R(e,t){return function(n){var s,r,i,o=[],c=-1,a=0,u=e.length;for(n instanceof Date||(n=/* @__PURE__ */new Date(+n));++c<u;)37===e.charCodeAt(c)&&(o.push(e.slice(a,c)),null!=(r=sr[s=e.charAt(++c)])?s=e.charAt(++c):r="e"===s?" ":"0",(i=t[s])&&(s=i(n,r)),o.push(s),a=c+1);return o.push(e.slice(a,c)),o.join("")}}function D(e,t){return function(n){var s,r,i=Zs(1900,void 0,1);if(b(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(r=(s=zs(Zs(i.y,0,1))).getUTCDay(),s=r>4||0===r?Bs.ceil(s):Bs(s),s=Gs.offset(s,7*(i.V-1)),i.y=s.getUTCFullYear(),i.m=s.getUTCMonth(),i.d=s.getUTCDate()+(i.w+6)%7):(r=(s=Ys(Zs(i.y,0,1))).getDay(),s=r>4||0===r?Ls.ceil(s):Ls(s),s=ws.offset(s,7*(i.V-1)),i.y=s.getFullYear(),i.m=s.getMonth(),i.d=s.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),r="Z"in i?zs(Zs(i.y,0,1)).getUTCDay():Ys(Zs(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(r+5)%7:i.w+7*i.U-(r+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,zs(i)):Ys(i)}}function b(e,t,n,s){for(var r,i,o=0,c=t.length,a=n.length;o<c;){if(s>=a)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(i=C[r in sr?t.charAt(o++):r])||(s=i(e,n,s))<0)return-1}else if(r!=n.charCodeAt(s++))return-1}return s}function F(e,t,n){var s=h.exec(t.slice(n));return s?(e.p=l[s[0].toLowerCase()],n+s[0].length):-1}function W(e,t,n){var s=g.exec(t.slice(n));return s?(e.w=m[s[0].toLowerCase()],n+s[0].length):-1}function T(e,t,n){var s=d.exec(t.slice(n));return s?(e.w=p[s[0].toLowerCase()],n+s[0].length):-1}function A(e,t,n){var s=_.exec(t.slice(n));return s?(e.m=U[s[0].toLowerCase()],n+s[0].length):-1}function w(e,t,n){var s=S.exec(t.slice(n));return s?(e.m=f[s[0].toLowerCase()],n+s[0].length):-1}function P(e,t,s){return b(e,n,t,s)}function x(e,t,n){return b(e,s,t,n)}function L(e,t,n){return b(e,r,t,n)}function E(e){return c[e.getDay()]}function M(e){return o[e.getDay()]}function N(e){return u[e.getMonth()]}function I(e){return a[e.getMonth()]}function j(e){return i[+(e.getHours()>=12)]}function k(e){return 1+~~(e.getMonth()/3)}function G(e){return c[e.getUTCDay()]}function V(e){return o[e.getUTCDay()]}function Q(e){return u[e.getUTCMonth()]}function B(e){return a[e.getUTCMonth()]}function O(e){return i[+(e.getUTCHours()>=12)]}function X(e){return 1+~~(e.getUTCMonth()/3)}return y.x=R(s,y),y.X=R(r,y),y.c=R(n,y),v.x=R(s,v),v.X=R(r,v),v.c=R(n,v),t(R,"newFormat"),t(D,"newParse"),t(b,"parseSpecifier"),t(F,"parsePeriod"),t(W,"parseShortWeekday"),t(T,"parseWeekday"),t(A,"parseShortMonth"),t(w,"parseMonth"),t(P,"parseLocaleDateTime"),t(x,"parseLocaleDate"),t(L,"parseLocaleTime"),t(E,"formatShortWeekday"),t(M,"formatWeekday"),t(N,"formatShortMonth"),t(I,"formatMonth"),t(j,"formatPeriod"),t(k,"formatQuarter"),t(G,"formatUTCShortWeekday"),t(V,"formatUTCWeekday"),t(Q,"formatUTCShortMonth"),t(B,"formatUTCMonth"),t(O,"formatUTCPeriod"),t(X,"formatUTCQuarter"),{format:/* @__PURE__ */t(function(e){var t=R(e+="",y);return t.toString=function(){return e},t},"format"),parse:/* @__PURE__ */t(function(e){var t=D(e+="",!1);return t.toString=function(){return e},t},"parse"),utcFormat:/* @__PURE__ */t(function(e){var t=R(e+="",v);return t.toString=function(){return e},t},"utcFormat"),utcParse:/* @__PURE__ */t(function(e){var t=D(e+="",!0);return t.toString=function(){return e},t},"utcParse")}}qs.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Ws(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},qs.range,t(Ys,"localDate"),t(zs,"utcDate"),t(Zs,"newDate"),t(Ks,"formatLocale");var er,tr,nr,sr={"-":"",_:" ",0:"0"},rr=/^\s*\d+/,ir=/^%/,or=/[\\^$*+?|[\]().{}]/g;function cr(e,t,n){var s=e<0?"-":"",r=(s?-e:e)+"",i=r.length;return s+(i<n?new Array(n-i+1).join(t)+r:r)}function ar(e){return e.replace(or,"\\$&")}function ur(e){return new RegExp("^(?:"+e.map(ar).join("|")+")","i")}function hr(e){for(var t={},n=-1,s=e.length;++n<s;)t[e[n].toLowerCase()]=n;return t}function lr(e,t,n){var s=rr.exec(t.slice(n,n+1));return s?(e.w=+s[0],n+s[0].length):-1}function dr(e,t,n){var s=rr.exec(t.slice(n,n+1));return s?(e.u=+s[0],n+s[0].length):-1}function pr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.U=+s[0],n+s[0].length):-1}function gr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.V=+s[0],n+s[0].length):-1}function mr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.W=+s[0],n+s[0].length):-1}function Sr(e,t,n){var s=rr.exec(t.slice(n,n+4));return s?(e.y=+s[0],n+s[0].length):-1}function fr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.y=+s[0]+(+s[0]>68?1900:2e3),n+s[0].length):-1}function _r(e,t,n){var s=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return s?(e.Z=s[1]?0:-(s[2]+(s[3]||"00")),n+s[0].length):-1}function Ur(e,t,n){var s=rr.exec(t.slice(n,n+1));return s?(e.q=3*s[0]-3,n+s[0].length):-1}function yr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.m=s[0]-1,n+s[0].length):-1}function vr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.d=+s[0],n+s[0].length):-1}function Cr(e,t,n){var s=rr.exec(t.slice(n,n+3));return s?(e.m=0,e.d=+s[0],n+s[0].length):-1}function Rr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.H=+s[0],n+s[0].length):-1}function Dr(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.M=+s[0],n+s[0].length):-1}function br(e,t,n){var s=rr.exec(t.slice(n,n+2));return s?(e.S=+s[0],n+s[0].length):-1}function Fr(e,t,n){var s=rr.exec(t.slice(n,n+3));return s?(e.L=+s[0],n+s[0].length):-1}function Wr(e,t,n){var s=rr.exec(t.slice(n,n+6));return s?(e.L=Math.floor(s[0]/1e3),n+s[0].length):-1}function Tr(e,t,n){var s=ir.exec(t.slice(n,n+1));return s?n+s[0].length:-1}function Ar(e,t,n){var s=rr.exec(t.slice(n));return s?(e.Q=+s[0],n+s[0].length):-1}function wr(e,t,n){var s=rr.exec(t.slice(n));return s?(e.s=+s[0],n+s[0].length):-1}function Pr(e,t){return cr(e.getDate(),t,2)}function xr(e,t){return cr(e.getHours(),t,2)}function Lr(e,t){return cr(e.getHours()%12||12,t,2)}function Er(e,t){return cr(1+ws.count(ks(e),e),t,3)}function Mr(e,t){return cr(e.getMilliseconds(),t,3)}function Nr(e,t){return Mr(e,t)+"000"}function Ir(e,t){return cr(e.getMonth()+1,t,2)}function jr(e,t){return cr(e.getMinutes(),t,2)}function kr(e,t){return cr(e.getSeconds(),t,2)}function Gr(e){var t=e.getDay();return 0===t?7:t}function Vr(e,t){return cr(xs.count(ks(e)-1,e),t,2)}function Qr(e){var t=e.getDay();return t>=4||0===t?Ns(e):Ns.ceil(e)}function Br(e,t){return e=Qr(e),cr(Ns.count(ks(e),e)+(4===ks(e).getDay()),t,2)}function Or(e){return e.getDay()}function Xr(e,t){return cr(Ls.count(ks(e)-1,e),t,2)}function Hr(e,t){return cr(e.getFullYear()%100,t,2)}function $r(e,t){return cr((e=Qr(e)).getFullYear()%100,t,2)}function Jr(e,t){return cr(e.getFullYear()%1e4,t,4)}function qr(e,t){var n=e.getDay();return cr((e=n>=4||0===n?Ns(e):Ns.ceil(e)).getFullYear()%1e4,t,4)}function Yr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+cr(t/60|0,"0",2)+cr(t%60,"0",2)}function zr(e,t){return cr(e.getUTCDate(),t,2)}function Zr(e,t){return cr(e.getUTCHours(),t,2)}function Kr(e,t){return cr(e.getUTCHours()%12||12,t,2)}function ei(e,t){return cr(1+Gs.count(qs(e),e),t,3)}function ti(e,t){return cr(e.getUTCMilliseconds(),t,3)}function ni(e,t){return ti(e,t)+"000"}function si(e,t){return cr(e.getUTCMonth()+1,t,2)}function ri(e,t){return cr(e.getUTCMinutes(),t,2)}function ii(e,t){return cr(e.getUTCSeconds(),t,2)}function oi(e){var t=e.getUTCDay();return 0===t?7:t}function ci(e,t){return cr(Qs.count(qs(e)-1,e),t,2)}function ai(e){var t=e.getUTCDay();return t>=4||0===t?Hs(e):Hs.ceil(e)}function ui(e,t){return e=ai(e),cr(Hs.count(qs(e),e)+(4===qs(e).getUTCDay()),t,2)}function hi(e){return e.getUTCDay()}function li(e,t){return cr(Bs.count(qs(e)-1,e),t,2)}function di(e,t){return cr(e.getUTCFullYear()%100,t,2)}function pi(e,t){return cr((e=ai(e)).getUTCFullYear()%100,t,2)}function gi(e,t){return cr(e.getUTCFullYear()%1e4,t,4)}function mi(e,t){var n=e.getUTCDay();return cr((e=n>=4||0===n?Hs(e):Hs.ceil(e)).getUTCFullYear()%1e4,t,4)}function Si(){return"+0000"}function fi(){return"%"}function _i(e){return+e}function Ui(e){return Math.floor(+e/1e3)}function yi(e){return(er=Ks(e)).format,er.parse,tr=er.utcFormat,nr=er.utcParse,er}t(cr,"pad"),t(ar,"requote"),t(ur,"formatRe"),t(hr,"formatLookup"),t(lr,"parseWeekdayNumberSunday"),t(dr,"parseWeekdayNumberMonday"),t(pr,"parseWeekNumberSunday"),t(gr,"parseWeekNumberISO"),t(mr,"parseWeekNumberMonday"),t(Sr,"parseFullYear"),t(fr,"parseYear"),t(_r,"parseZone"),t(Ur,"parseQuarter"),t(yr,"parseMonthNumber"),t(vr,"parseDayOfMonth"),t(Cr,"parseDayOfYear"),t(Rr,"parseHour24"),t(Dr,"parseMinutes"),t(br,"parseSeconds"),t(Fr,"parseMilliseconds"),t(Wr,"parseMicroseconds"),t(Tr,"parseLiteralPercent"),t(Ar,"parseUnixTimestamp"),t(wr,"parseUnixTimestampSeconds"),t(Pr,"formatDayOfMonth"),t(xr,"formatHour24"),t(Lr,"formatHour12"),t(Er,"formatDayOfYear"),t(Mr,"formatMilliseconds"),t(Nr,"formatMicroseconds"),t(Ir,"formatMonthNumber"),t(jr,"formatMinutes"),t(kr,"formatSeconds"),t(Gr,"formatWeekdayNumberMonday"),t(Vr,"formatWeekNumberSunday"),t(Qr,"dISO"),t(Br,"formatWeekNumberISO"),t(Or,"formatWeekdayNumberSunday"),t(Xr,"formatWeekNumberMonday"),t(Hr,"formatYear"),t($r,"formatYearISO"),t(Jr,"formatFullYear"),t(qr,"formatFullYearISO"),t(Yr,"formatZone"),t(zr,"formatUTCDayOfMonth"),t(Zr,"formatUTCHour24"),t(Kr,"formatUTCHour12"),t(ei,"formatUTCDayOfYear"),t(ti,"formatUTCMilliseconds"),t(ni,"formatUTCMicroseconds"),t(si,"formatUTCMonthNumber"),t(ri,"formatUTCMinutes"),t(ii,"formatUTCSeconds"),t(oi,"formatUTCWeekdayNumberMonday"),t(ci,"formatUTCWeekNumberSunday"),t(ai,"UTCdISO"),t(ui,"formatUTCWeekNumberISO"),t(hi,"formatUTCWeekdayNumberSunday"),t(li,"formatUTCWeekNumberMonday"),t(di,"formatUTCYear"),t(pi,"formatUTCYearISO"),t(gi,"formatUTCFullYear"),t(mi,"formatUTCFullYearISO"),t(Si,"formatUTCZone"),t(fi,"formatLiteralPercent"),t(_i,"formatUnixTimestamp"),t(Ui,"formatUnixTimestampSeconds"),yi({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"]}),t(yi,"defaultLocale");const vi=class _ECLGraph extends u{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,n){super(),this.wu=e;let s=0;for(const r of n)if(r.GraphName===t.Name&&!r.HasSubGraphId){s=Math.round(1e3*r.Seconds)/1e3;break}this.set({Time:s,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(e=>Oi(e)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(e=>Oi(e))}};t(vi,"ECLGraph");let Ci=vi;const Ri=class _GraphCache extends h{constructor(){super(e=>h.hash([e.Name]))}};t(Ri,"GraphCache");let Di=Ri;function bi(e,t,n){(n=n||[]).push(e),t(e.name,e.$,e.children(),n),e.children().forEach(e=>{bi(e,t,n)}),n.pop()}function Fi(e){const t={};return e.forEach(e=>{"att"===e.name&&(t[e.$.name]=e.$.value)}),t}t(bi,"walkXmlJson"),t(Fi,"flattenAtt");const Wi=class _XGMMLGraph extends l{};t(Wi,"XGMMLGraph");let Ti=Wi;const Ai=class _XGMMLSubgraph extends d{};t(Ai,"XGMMLSubgraph");let wi=Ai;const Pi=class _XGMMLVertex extends p{};t(Pi,"XGMMLVertex");let xi=Pi;const Li=class _XGMMLEdge extends g{};t(Li,"XGMMLEdge");let Ei=Li;function Mi(e,t){const n={},s={},r={},i=new Ti(e=>e._.id),o=[i.root];return bi(t,(e,t,i,c)=>{const a=o[o.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){const e=a.createSubgraph(Fi(i));o.push(e),n[t.id]=e}const e=a.createVertex(Fi(i));s[t.id]=e;break;case"edge":const c=a.createEdge(s[t.source],s[t.target],Fi(i));r[t.id]=c}}),i}t(Mi,"createXGMMLGraph");const Ni=class _ScopeGraph extends l{};t(Ni,"ScopeGraph");let Ii=Ni;const ji=class _ScopeSubgraph extends d{};t(ji,"ScopeSubgraph");let ki=ji;const Gi=class _ScopeVertex extends p{};t(Gi,"ScopeVertex");let Vi=Gi;const Qi=class _ScopeEdge extends g{};t(Qi,"ScopeEdge");let Bi=Qi;function Oi(e){const t={},n={},s={};let r;for(const o of e)switch(o.ScopeType){case"graph":r=new Ii(e=>e._.Id,o),t[o.ScopeName]=r.root;break;case"subgraph":r||(r=new Ii(e=>e._.Id,o),t[o.ScopeName]=r.root);const e=o.parentScope().split(":");let i=t[o.parentScope()];for(;e.length&&!i;)i=t[e.join(":")],e.pop();if(i){const e=i;t[o.ScopeName]=e.createSubgraph(o)}else console.warn(`Missing SG:Parent (${o.Id}): ${o.parentScope()}`);break;case"activity":const c=t[o.parentScope()];c?s[o.ScopeName]=c.createVertex(o):console.warn(`Missing A:Parent (${o.Id}): ${o.parentScope()}`);break;case"edge":n[o.ScopeName]=o;break;case"function":const a=s[o.parentScope()];a?a._.children().push(o):console.warn(`Missing F:Parent (${o.Id}): ${o.parentScope()}`)}for(const o in n){const e=n[o],s=t[e.parentScope()];if(s){const t=s;try{const n=r.vertex(e.attr("IdSource").RawValue),s=r.vertex(e.attr("IdTarget").RawValue);t.createEdge(n,s,e)}catch(i){console.warn(`Invalid Edge: ${o}`)}}else console.warn(`Missing E:Parent (${e.Id}): ${e.parentScope()}`)}return r}t(Oi,"createGraph");const Xi=class _Resource extends u{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;const n=t.split("\\").join("/"),s=n.split("/"),r="res/"+this.wu.Wuid+"/";let i="",o="";0===n.indexOf(r)&&(i=n.substr(r.length),o=s[s.length-1]),this.set({URL:t,DisplayName:o,DisplayPath:i})}};t(Xi,"Resource");let Hi=Xi;const $i=class _XSDNode{e;constructor(e){this.e=e}fix(){delete this.e}};t($i,"XSDNode");let Ji=$i;const qi=class _XSDXMLNode extends Ji{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){const e=this._children[t];"Row"===e.name&&void 0===e.type&&(this._children.push(...e._children),this._children.splice(t,1))}const e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return"All"===e.name&&void 0===e.type}setOfType(){const e=this.children();if(void 0===this.type&&2===e.length){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":case"xs:nonNegativeInteger":case"xs:double":e=8;break;case"xs:string":e=32;break;default:const t="0123456789",n=this.type.lastIndexOf("_"),s=n>0?n:this.type.length;let r=s-1;for(;r>=0&&-1!==t.indexOf(this.type.charAt(r));--r);r+1<s&&(e=parseInt(this.type.substring(r+1,s),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e}};t(qi,"XSDXMLNode");let Yi=qi;const zi=class _XSDSimpleType extends Ji{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}}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(zi,"XSDSimpleType");let Zi=zi;const Ki=class _XSDSchema{root;simpleTypes={};fields(){return this.root.children()}};t(Ki,"XSDSchema");let eo=Ki;const to=class _XSDParser extends m{schema=new eo;simpleType;simpleTypes={};xsdStack=new S;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":const t=new Yi(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 Zi(e)}}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":const t=this.xsdStack.top();for(const n in e.$)t.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};t(to,"XSDParser");let no=to;function so(e){const t=new no;return t.parse(e),t.schema}t(so,"parseXSD");const ro=class _XSDParser2 extends no{_rootName;schema=new eo;simpleTypes={};xsdStack=new S;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":const t=new Yi(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 Zi(e)}}endXMLNode(e){if("xsd:element"===e.name){this.xsdStack.pop().fix()}super.endXMLNode(e)}};t(ro,"XSDParser2");let io=ro;function oo(e,t){const n=new io(t);return n.parse(e),n.schema}t(oo,"parseXSD2");const co=class _GlobalResultCache extends h{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}};t(co,"GlobalResultCache");let ao=co;const uo=new ao,ho=class _Result extends u{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,n,s){let r;return Array.isArray(s)?(r=uo.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n.Name},()=>new _Result(e,t,n,s)),r.set(n)):void 0===s&&("number"==typeof n?r=uo.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+n},()=>new _Result(e,t,n)):"string"==typeof n&&(r=uo.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new _Result(e,t,n)))),r}static attachLogicalFile(e,t,n){return uo.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:n},()=>new _Result(e,t,n,!0))}constructor(e,t,n,s){super(),this.connection=e instanceof ns?e:new ns(e),"boolean"==typeof s&&!0===s?this.set({NodeGroup:t,LogicalFileName:n}):Zn(n)&&Array.isArray(s)?this.set({...n,Wuid:t,ResultName:n.Name,ResultViews:s}):void 0===s?"number"==typeof n?this.set({Wuid:t,ResultSequence:n}):"string"==typeof n?this.set({Wuid:t,ResultName:n}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return-1!==this.Total}bypassCache(e){return void 0===e?this._bypassCache:(this._bypassCache=e,this)}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return this._fetchXMLSchemaPromise&&!e||(this._fetchXMLSchemaPromise=this.WUResult().then(e=>e.Result?.XmlSchema?.xml?(this.xsdSchema=so(e.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,n=!1,s={},r,i){const c=i??this._bypassCache;return this.WUResult(e,t,!n,s,r,c).then(e=>{const t=e.Result;return delete e.Result,this.set({...e}),o("XmlSchema.xml",t)&&(this.xsdSchema=so(t.XmlSchema.xml)),o("Row",t)?t.Row:this.ResultName&&o(this.ResultName,t)?t[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,n=!1,s={},r,i=!1){const o={NamedValue:{itemcount:0}};for(const a in s)o.NamedValue[o.NamedValue.itemcount++]={Name:a,Value:s[a]};const c={FilterBy:o};return this.Wuid&&void 0!==this.ResultName?(c.Wuid=this.Wuid,c.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(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=n,c.BypassCachedResult=i,this.connection.WUResult(c,r).then(e=>e)}};t(ho,"Result");let lo=ho;const po=class _ResultCache extends h{constructor(){super(e=>h.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};t(po,"ResultCache");let go=po;const mo=class _Attribute extends u{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)}};t(mo,"Attribute");let So=mo;const fo=class _BaseScope extends u{_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(){const e=[],t={start:null,end:null};return this.Properties.Property.forEach(n=>{"ts"===n.Measure&&n.Name.indexOf("Started")>=0?t.start=n:this.ScopeName&&"ts"===n.Measure&&n.Name.indexOf("Finished")>=0?t.end=n:e.push(new So(this,n))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new So(this,t.start))):t.start?e.push(new So(this,t.start)):t.end&&e.push(new So(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(e=>{this._attributeMap[e.Name]=e}),this.Properties.Property=[];for(const t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){const 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(const t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){const e={};for(const t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return void 0!==this._attributeMap[e]}attr(e){return this._attributeMap[e]||new So(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="";const n=[];t=this.Id,n.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&n.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),n.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);const s=this.formattedAttrs();for(const r in s)"Label"===r?t=s[r]:n.push(`<tr><td class="key">${r}</td><td class="value">${s[r]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">${t}</h4>\n <table>\n ${n.join("")}\n </table>\n </div>`}};t(fo,"BaseScope");let _o=fo;const Uo=class _Scope extends _o{wu;constructor(e,t){super(t),this.wu=e}};t(Uo,"Scope");let yo=Uo;const vo=class _SourceFile extends u{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,n){super(),this.connection=e instanceof ns?e:new ns(e),this.set({Wuid:t,...n})}};t(vo,"SourceFile");let Co=vo;const Ro=class _Timer extends u{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,n){super(),this.connection=e instanceof ns?e:new ns(e);const s=f(n.Value);this.set({Wuid:t,Seconds:Math.round(1e3*s)/1e3,HasSubGraphId:void 0!==n.SubGraphId,...n})}};t(Ro,"Timer");let Do=Ro;const bo=tr("%Y-%m-%dT%H:%M:%S.%LZ"),Fo=nr("%Y-%m-%dT%H:%M:%S.%LZ"),Wo=ys(",");function To(e){return e&&!isNaN(+e)?Wo(+e):e}t(To,"formatNum");const Ao="DefinitionList",wo=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Po=["Avg","Min","Max","Delta","StdDev"],xo=["SkewMin","SkewMax","NodeMin","NodeMax"],Lo=/[A-Z][a-z]*/g;function Eo(e){for(const n of xo){const t=e.indexOf(n);if(0===t){return{measure:"",ext:n,label:e.slice(t+n.length)}}}const t=e.match(Lo);if(t?.length){const e=t.shift();let n=t.join("");for(const t of Po){const s=n.indexOf(t);if(0===s)return n=n.slice(s+t.length),{measure:e,ext:t,label:n}}return{measure:e,ext:"",label:n}}return{measure:"",ext:"",label:e}}t(Eo,"_splitMetric");const Mo={};function No(e){let t=Mo[e];return t||(t=Eo(e),Mo[e]=t),t}function Io(e,t){return e.__formattedProps?.[t]??e[t]}function jo(e){if(void 0===e)return;const t=parseFloat(e);return isNaN(t)?void 0:t}function ko(e,t,n){const s=No(t);if(!n[s.measure]){n[s.label]=!0;const t=jo(e[`${s.measure}Avg${s.label}`]),r=jo(e[`${s.measure}Min${s.label}`]),i=jo(e[`${s.measure}Max${s.label}`]),o=jo(e[`${s.measure}StdDev${s.label}`]),c=Math.max((t-r)/o,(i-t)/o);return{Key:`${s.measure}${s.label}`,Value:Io(e,`${s.measure}${s.label}`),Avg:Io(e,`${s.measure}Avg${s.label}`),Min:Io(e,`${s.measure}Min${s.label}`),Max:Io(e,`${s.measure}Max${s.label}`),Delta:Io(e,`${s.measure}Delta${s.label}`),StdDev:Io(e,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(c)?void 0:c,SkewMin:Io(e,`SkewMin${s.label}`),SkewMax:Io(e,`SkewMax${s.label}`),NodeMin:Io(e,`NodeMin${s.label}`),NodeMax:Io(e,`NodeMax${s.label}`)}}return null}t(No,"splitMetric"),t(Io,"formatValue"),t(jo,"safeParseFloat"),t(ko,"formatValues");const Go=n("workunit.ts"),Vo=class _WorkunitCache extends h{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}};t(Vo,"WorkunitCache");let Qo=Vo;const Bo=new Qo,Oo=class _Workunit extends u{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",zn.Unknown)}get State(){return this.get("State")||zn[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 go;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,()=>lo.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){const 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 Do(this.connection,this.Wuid,e))}_graphCache=new Di;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 Ci(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 Hi(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 Co(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 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")}static create(e){const t=new _Workunit(e);return t.connection.WUCreate().then(e=>(Bo.set(t),t.set(e.Workunit),t))}static attach(e,t,n){const s=Bo.get({BaseUrl:e.baseUrl,Wuid:t},()=>new _Workunit(e,t));return n&&s.set(n),s}static existsLocal(e,t){return Bo.has({BaseUrl:e,Wuid:t})}static submit(e,t,n,s=!1){return _Workunit.create(e).then(e=>e.update({QueryText:n})).then(e=>s?e.submit(t,Jn.Action.Compile):e.submit(t))}static compile(e,t,n){return _Workunit.submit(e,t,n,!0)}static query(e,t){return new ns(e).WUQuery(t).then(t=>t.Workunits.ECLWorkunit.map(function(t){return _Workunit.attach(e,t.Wuid,t)}))}constructor(e,t){super(),this.connection=new ns(e),this.topologyConnection=new wn(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:zn.Unknown})}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(e=>(this.set(e.Workunit),this))}submit(e,t=Jn.Action.Run,n){let s;return s=void 0!==e?Promise.resolve(e):this.topologyConnection.DefaultTpLogicalClusterQuery().then(e=>e.Name),this._debugMode=!1,t===Jn.Action.Debug&&(t=Jn.Action.Run,this._debugMode=!0),s.then(e=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:n,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(n=>(this.set(n.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:e})))).then(()=>this)}isComplete(){switch(this.StateID){case zn.Compiled:return"compile"===this.ActionEx||this._submitAction===Jn.Action.Compile;case zn.Completed:case zn.Failed:case zn.Aborted:case zn.NotFound:return!0}return!1}isFailed(){switch(this.StateID){case zn.Aborted:case zn.Failed:return!0}return!1}isDeleted(){return this.StateID===zn.NotFound}isDebugging(){switch(this.StateID){case zn.DebugPaused:case zn.DebugRunning:return!0}return this._debugMode}isRunning(){switch(this.StateID){case zn.Compiled:case zn.Running:case zn.Aborting:case zn.Blocked:case zn.DebugPaused:case zn.DebugRunning:return!0}return!1}setToFailed(){return this.WUAction(Pn.ECLWUActions.SetToFailed)}pause(){return this.WUAction(Pn.ECLWUActions.Pause)}pauseNow(){return this.WUAction(Pn.ECLWUActions.PauseNow)}resume(){return this.WUAction(Pn.ECLWUActions.Resume)}abort(){return this.WUAction(Pn.ECLWUActions.Abort)}protect(){return this.WUAction(Pn.ECLWUActions.Protect)}unprotect(){return this.WUAction(Pn.ECLWUActions.Unprotect)}delete(){return this.WUAction(Pn.ECLWUActions.Delete)}restore(){return this.WUAction(Pn.ECLWUActions.Restore)}deschedule(){return this.WUAction(Pn.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(Pn.ECLWUActions.Reschedule)}resubmit(){return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(()=>(this.clearState(this.Wuid),this.refresh().then(()=>(this._monitor(),this))))}clone(){return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(e=>_Workunit.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID!==zn.Compiled||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={}){return this.WUDetails(e).then(e=>e.Scopes.Scope)}normalizeDetails(e,t){const n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},s=/* @__PURE__ */new Map;for(const o of e.Activities?.Activity??[])s.set(o.Kind,o.Name);const r=new Array(t.length);for(let o=0;o<t.length;o++){const e=t[o],c={},a={};if(e.Id&&e.Properties?.Property)for(const t of e.Properties.Property){const e=t.Measure,r=t.Name,i=t.RawValue;if("ns"===e&&(t.Measure="s"),"Kind"===r){const e=parseInt(i,10);t.Formatted=s.get(e)??i}switch(n[r]={Name:t.Name,Measure:t.Measure,Creator:t.Creator,CreatorType:t.CreatorType},t.Measure){case"bool":c[r]=!!+i;break;case"sz":case"ns":case"cnt":case"node":case"skw":c[r]=+i;break;case"s":c[r]=+i/1e9;break;case"ts":c[r]=new Date(+i/1e3).toISOString();break;case"cost":c[r]=+i/1e6;break;default:c[r]=i}a[r]=To(t.Formatted??c[r])}const u={id:e.Id,name:e.ScopeName,type:e.ScopeType,Kind:e.Kind,Label:e.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...c},h=u[Ao];if(h)try{const e=JSON.parse(h.split("\\").join("\\\\")),t=[];for(let n=0;n<e.length;n++){const s=e[n].match(wo);s&&t.push({filePath:(s[1]??"")+s[2]+s[3],line:parseInt(s[5],10),col:parseInt(s[6],10)})}u[Ao]=t}catch(i){Go.error(`Unexpected "DefinitionList": ${h}`)}const l={};let d=0,p="";for(const t in u)if(!t.startsWith("__")){const e=ko(u,t,l);e&&(u.__groupedProps[e.Key]=e,!isNaN(e.StdDevs)&&e.StdDevs>d&&(d=e.StdDevs,p=e.Key))}u.__StdDevs=d,u.__StdDevsSource=p,r[o]=u}return{meta:e,columns:n,data:r}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(e=>this.normalizeDetails(e[0],e[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(e=>e.Scopes.Scope.map(e=>new yo(this,e)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(e=>{const t=[],n={};e.Scopes.Scope.forEach(e=>{if(n[e.ScopeName])return n[e.ScopeName].update(e),null;{const t=new yo(this,e);return n[t.ScopeName]=t,t}});for(const s in n)if(n.hasOwnProperty(s)){const e=n[s],r=e.parentScope();r&&n[r]?n[r].children().push(e):t.push(e)}return t})}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(e=>Oi(e))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{const t={};e.forEach(e=>{t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(n=>{"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});const n=[];for(const s in t){const e=t[s];if(e.start&&e.elapsed){const t=Fo(e.start);t.setMilliseconds(t.getMilliseconds()+e.elapsed/1e6),e.finish=bo(t),n.push(e)}}return n.sort((e,t)=>e.start<t.start?-1:e.start>t.start?1:0),n})}_monitor(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,n){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(e=>(0===e.Workunits.ECLWorkunit.length?(this.clearState(this.Wuid),this.set("StateID",zn.NotFound)):this.set(e.Workunits.ECLWorkunit[0]),e)).catch(e=>{if(!e.Exception.some(e=>20081===e.Code&&(this.clearState(this.Wuid),this.set("StateID",zn.NotFound),!0)))throw Go.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),Bo.set(this),e))}WUInfo(e={}){const t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(e=>(this.set(e.Workunit),t&&this.set({ResultViews:e.ResultViews}),e)).catch(e=>{if(!e.Exception.some(e=>20080===e.Code&&(this.clearState(this.Wuid),this.set("StateID",zn.NotFound),!0)))throw Go.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}WUResubmit(e){return this.connection.WUResubmit(_({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(_({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})).then(e=>_({Scopes:{Scope:[]}},e))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(e=>this.refresh().then(()=>(this._monitor(),e)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:Pn.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){const t=new rs({baseUrl:""}),n={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(n)}WUCDebug(e,t={}){let n="";for(const s in t)t.hasOwnProperty(s)&&(n+=` ${s}='${t[s]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${n}/>`}).then(e=>e)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(t=>{const n=t.children(e);return n.length?n[0]:new U(e)}).catch(t=>(Go.error(t),Promise.resolve(new U(e)))):Promise.resolve(new U(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{const 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(e=>{if("break"===e.name)return e.$})}debugBreakpointAdd(e,t,n){return this.debug("breakpoint",{id:e,mode:t,action:n}).then(e=>this.debugBreakpointResponseParser(e))}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=Mi(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>qo(t,e))}debugPrint(e,t=0,n=10){return this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(e=>e.children().map(e=>{const t={};return e.children().forEach(e=>{t[e.name]=e.content}),t}))}};t(Oo,"Workunit");let Xo=Oo;const Ho="definition";function $o(e){return void 0!==e._[Ho]}function Jo(e){const t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[Ho]);if(t){const[,n,s,r]=t;return n.replace(/\/\.\//g,"/"),{id:e._.id,file:n,line:+s,column:+r}}throw new Error(`Bad definition: ${e._[Ho]}`)}function qo(e,t){const n=[];for(const s of e.vertices)if($o(s)){const e=Jo(s);(e&&!t||t===e.file)&&n.push(e)}return n.sort((e,t)=>e.line-t.line)}let Yo;t($o,"hasECLDefinition"),t(Jo,"getECLDefinition"),t(qo,"breakpointLocations");const zo=class _Activity extends u{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 Yo||(Yo=new _Activity(e)),t&&Yo.set(t),Yo}constructor(e){super(),this.connection=e instanceof _n?e:new _n(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>""===e||t.ClusterName===e).map(e=>Xo.attach(this.connection.connectionOptions(),e.Wuid,e))}setBanner(e){return this.connection.SetBanner({...e}).then(e=>(this.set(e),this))}lazyRefresh=y(async()=>{const e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};t(zo,"Activity");let Zo=zo;const Ko=n("logicalFile.ts"),ec=class _LogicalFileCache extends h{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}};t(ec,"LogicalFileCache");let tc=ec;const nc=new tc,sc=class _LogicalFile extends u{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,n,s){const r=nc.get({BaseUrl:e.baseUrl,Cluster:t,Name:n},()=>new _LogicalFile(e,t,n));return s&&r.set(s),r}constructor(e,t,n){super(),this.connection=e instanceof rt?e:new rt(e),this.clear({Cluster:t,Name:n})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){const e=[];for(const t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(const n of t?.DFUFileParts?.DFUPart||[]){const s={...t,...n};delete s.DFUFileParts,e.push(s)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e))}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(e=>20038===e.Code&&(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0)))throw Ko.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||[])}};t(sc,"LogicalFile");let rc=sc;const ic=class _MachineCache extends h{constructor(){super(e=>e.Address)}};t(ic,"MachineCache");let oc=ic;const cc=new oc,ac=class _Machine extends u{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,n){const s=cc.get({Address:t},()=>new _Machine(e));return n&&s.set(n),s}constructor(e){super(),this.connection=e instanceof Jt?e:new Jt(e)}};t(ac,"Machine");let uc=ac;const hc=class _TargetClusterCache extends h{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}};t(hc,"TargetClusterCache");let lc=hc;const dc=new lc,pc=class _TargetCluster extends u{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=>uc.attach(this.machineConnection,e.Address,e))}static attach(e,t,n){const s=dc.get({BaseUrl:e.baseUrl,Name:t},()=>new _TargetCluster(e,t));return n&&s.set(n),s}constructor(e,t){super(),e instanceof wn?(this.connection=e,this.machineConnection=new Jt(e.connectionOptions())):(this.connection=new wn(e),this.machineConnection=new Jt(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(e=>{const t=[];for(const n of e.TargetClusterInfoList.TargetClusterInfo)for(const e of n.Processes.MachineInfoEx)t.push(e);return this.set("MachineInfoEx",t),this.CMachineInfoEx})}machineStats(){let e=0,t=0,n=0;for(const s of this.CMachineInfoEx)for(const r of s.Storage.StorageInfo){t+=r.Available,n+=r.Total;const s=1-r.Available/r.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};t(pc,"TargetCluster");let gc=pc;function mc(e){let t;return t=e instanceof wn?e:new wn(e),t.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(t=>gc.attach(e,t.Name,t)))}t(mc,"targetClusters");const Sc={};function fc(e){if(!Sc[e.baseUrl]){let t;t=e instanceof wn?e:new wn(e),Sc[e.baseUrl]=t.TpListTargetClusters({}).then(t=>{let n,s,r;t.TargetClusters.TpClusterNameType.forEach(e=>{n||(n=e),s||!0!==e.IsDefault||(s=e),r||"hthor"!==e.Type||(r=e)});const i=s||r||n;return gc.attach(e,i.Name,i)})}return Sc[e.baseUrl]}t(fc,"defaultTargetCluster");const _c=class _TopologyCache extends h{constructor(){super(e=>e.BaseUrl)}};t(_c,"TopologyCache");let Uc=_c;const yc=new Uc,vc=class _Topology extends u{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=>gc.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){const n=yc.get({BaseUrl:e.baseUrl},()=>new _Topology(e));return t&&n.set(t),n}constructor(e){super(),this.connection=e instanceof wn?e:new wn(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{const n=this.connection.protocol(),s=this.connection.ip();let r="https:"===n?"18002":"8002";if(o("ServiceList.TpEspServers.TpEspServer",t))for(const i of t.ServiceList.TpEspServers.TpEspServer)if(o("TpBindings.TpBinding",i))for(const t of i.TpBindings.TpBinding)t.Service===e&&t.Protocol+":"===n&&(r=t.Port);return`${n}//${s}:${r}/`})}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(e=>(this.set({LogicalClusters:e.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(e=>(this.set({Services:e.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,n){if(this.isCallback(t)){if("changed"===e)super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}};t(vc,"Topology");let Cc=vc;function Rc(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(e[t]=n)}function Dc(e){return(e=""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function bc(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);const t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(e);if(!t)return 0;return 24*(+t[1]||0)*60*60+60*(+t[2]||0)*60+60*(+t[3]||0)+(+t[4]||0)+(+t[5]||0)/1e3+(+t[6]||0)/1e6+(+t[7]||0)/1e9}function Fc(e,t){const n=e.indexOf(t);return-1!==n?parseFloat(e.substring(0,n)):-1}function Wc(e){if(!e)return 0;if(!isNaN(+e))return parseFloat(e);let t=Fc(e,"Kb");return t>=0?1024*t:(t=Fc(e,"Mb"),t>=0?t*Math.pow(1024,2):(t=Fc(e,"Gb"),t>=0?t*Math.pow(1024,3):(t=Fc(e,"Tb"),t>=0?t*Math.pow(1024,4):(t=Fc(e,"Pb"),t>=0?t*Math.pow(1024,5):(t=Fc(e,"Eb"),t>=0?t*Math.pow(1024,6):(t=Fc(e,"Zb"),t>=0?t*Math.pow(1024,7):(t=Fc(e,"b"),t>=0?t:0)))))))}function Tc(e){return e?parseFloat(e):0}t(Rc,"safeAssign"),t(Dc,"xmlEncode"),t(bc,"espTime2Seconds"),t(Fc,"unitTest"),t(Wc,"espSize2Bytes"),t(Tc,"espSkew2Number");const Ac=class _LocalisedXGMMLWriter{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,n,s){this.noSpills=s,e.forEach(e=>{this.graph.isVertex(e)?(this.calcInVertexVisibility(e,n),this.calcOutVertexVisibility(e,n)):this.graph.isEdge(e)?(this.calcInVertexVisibility(e.getSource(),n-1),this.calcOutVertexVisibility(e.getTarget(),n-1)):this.graph.isSubgraph(e)&&(this.m_visibleSubgraphs[e.__hpcc_id]=e,this.calcSubgraphVisibility(e,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(e=>{this.calcInVertexVisibility(e.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(e=>{this.calcOutVertexVisibility(e.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((e,n)=>{this.calcSubgraphVisibility(e,t-1)}),e.__hpcc_subgraphs.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e}),e.__hpcc_vertices.forEach((e,t)=>{this.m_visibleVertices[e.__hpcc_id]=e});const n={};this.graph.edges.forEach((t,s)=>{t.getSource().__hpcc_parent!==t.getTarget().__hpcc_parent&&e===this.getCommonAncestor(t)&&(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]||(n[t.getSource().__hpcc_parent.__hpcc_id+"::"+t.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[t.__hpcc_id]=t))})}buildVertexString(e,t){let n="",s="";const r=e.getProperties();for(const i in r)t&&i.indexOf("_kind")>=0?s+='<att name="_kind" value="point"/>':"id"===i||"label"===i?n+=" "+i+'="'+Dc(r[i])+'"':s+='<att name="'+i+'" value="'+Dc(r[i])+'"/>';return"<node"+n+">"+s+"</node>"}buildEdgeString(e){let t="",n="";const s=e.getProperties();for(const r in s)"id"===r.toLowerCase()||"label"===r.toLowerCase()||"source"===r.toLowerCase()||"target"===r.toLowerCase()?t+=" "+r+'="'+Dc(s[r])+'"':n+='<att name="'+r+'" value="'+Dc(s[r])+'"/>';return"<edge"+t+">"+n+"</edge>"}getAncestors(e,t){let n=e.__hpcc_parent;for(;n;)t.push(n),n=n.__hpcc_parent}getCommonAncestorV(e,t){const n=[],s=[];this.getAncestors(e,n),this.getAncestors(t,s);let r=n.length-1,i=s.length-1,o=null;for(;r>=0&&i>=0&&n[r]===s[i];)o=n[r],--r,--i;return o}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){const t=[];this.getAncestors(e,t),t.forEach((e,t)=>{this.m_visibleSubgraphs[e.__hpcc_id]=e})}calcVisibility2(){for(const e in this.m_visibleVertices){const t=this.m_visibleVertices[e];t.getInEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),t.getOutEdges().forEach((e,t)=>{this.m_visibleEdges[e.__hpcc_id]=e}),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(const e in this.m_visibleEdges){const t=this.m_visibleEdges[e];let n=t.getSource();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){const e=n.getInEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),n=e[0].getSource(),this.addSemiVisibleVertex(n)}let s=t.getTarget();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){const e=s.getOutEdges();if(!e.length)break;this.addSemiVisibleEdge(e[0]),s=e[0].getTarget(),this.addSemiVisibleVertex(s)}}}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 n="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';const s=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),s===this.m_xgmml.length){const t=e.__hpcc_vertices[0];t&&(this.m_xgmml+=this.buildVertexString(t,!0))}const r=e.getProperties();for(const e in r)n+='<att name="'+e+'" value="'+Dc(r[e])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+n+"</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))}};t(Ac,"LocalisedXGMMLWriter");let wc=Ac;const Pc=class _GraphItem{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){const e={};for(const t in this)0!==t.indexOf("__")&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}};t(Pc,"GraphItem");let xc=Pc;const Lc=class _Subgraph extends xc{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType="0"===t?"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,n)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,n)=>{e.vertexVisited(t)})}};t(Lc,"Subgraph");let Ec=Lc;const Mc=class _Vertex extends xc{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){const e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(e=>{e.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)}};t(Mc,"Vertex");let Nc=Mc;const Ic=class _Edge extends xc{_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]}};t(Ic,"Edge");let jc=Ic;const kc=class _QueryGraph{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;const t=(new DOMParser).parseFromString(e,"text/xml");this.walkDocument(t.documentElement,"0")}isSubgraph(e){return e instanceof Ec}isVertex(e){return e instanceof Nc}isEdge(e){return e instanceof jc}getGlobalType(e){return e instanceof Nc?3:e instanceof jc?4:e instanceof Ec?2:e instanceof _QueryGraph?1:0}getGlobalTypeString(e){return e instanceof Nc?"Vertex":e instanceof jc?"Edge":e instanceof Ec?"Cluster":e instanceof _QueryGraph?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":const e=new Ec(this,t);this.subgraphs.push(e),this.idx[t]=e;break;case"node":const n=new Nc(this,t);this.vertices.push(n),this.idx[t]=n;break;case"edge":const s=new jc(this,t);this.edges.push(s),this.idx[t]=s;break;default:console.warn("Graph.getItem - Unknown Node Type!")}const n=this.idx[t];return Array.from(e.attributes).forEach(e=>{Rc(n,e.name,e.value)}),n}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof Ec?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof Nc?this.vertices=this.vertices.filter(t=>e!==t):e instanceof jc&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let n=null;return Array.from(e.childNodes).some(e=>{if(e.tagName===t)return n=e,!0}),n}walkDocument(e,t){const n=this.getItem(e,t);return e.childNodes.forEach(e=>{if(1===e.nodeType)switch(e.tagName){case"graph":break;case"node":let t=!1;const s=this.getChildByTagName(e,"att");if(s){const r=this.getChildByTagName(s,"graph");if(r){t=!0;const s=this.walkDocument(r,e.getAttribute("id"));n.addSubgraph(s)}}if(!t){const t=this.walkDocument(e,e.getAttribute("id"));n.addVertex(t)}break;case"att":const r=e.getAttribute("name"),i="_"+r,o=e.getAttribute("value");0===r.indexOf("Time")?(Rc(n,i,o),Rc(n,r,""+bc(o))):0===r.indexOf("Size")?(Rc(n,i,o),Rc(n,r,""+Wc(o))):0===r.indexOf("Skew")?(Rc(n,i,o),Rc(n,r,""+Tc(o))):Rc(n,r,o);break;case"edge":const c=this.walkDocument(e,e.getAttribute("id"));if(void 0!==c.NumRowsProcessed?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.Count?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):void 0!==c.count&&(c._eclwatchCount=c.count.replace(/\B(?=(\d{3})+(?!\d))/g,",")),c.inputProgress&&(c._eclwatchInputProgress="["+c.inputProgress.replace(/\B(?=(\d{3})+(?!\d))/g,",")+"]"),c.SkewMaxRowsProcessed&&c.SkewMinRowsProcessed&&(c._eclwatchSkew="+"+c.SkewMaxRowsProcessed+", "+c.SkewMinRowsProcessed),c._dependsOn);else if(c._childGraph);else if(c._sourceActivity||c._targetActivity){c._isSpill=!0;const e=c.getSource();e&&(e._isSpill=!0);const t=c.getTarget();t&&(t._isSpill=!0)}n.addEdge(c)}}),n}removeSubgraphs(){[...this.subgraphs].forEach(e=>{e.__hpcc_parent instanceof Ec&&e.remove()})}removeSpillVertices(){[...this.vertices].forEach(e=>{e.isSpill()&&e.remove()})}getLocalisedXGMML(e,t,n,s){const r=new wc(this);return r.calcVisibility(e,t,n,s),r.writeXgmml(),"<graph>"+r.m_xgmml+"</graph>"}};t(kc,"QueryGraph");let Gc=kc;const Vc=n("@hpcc-js/comms/ecl/query.ts"),Qc=ys("~s");function Bc(e){return!isNaN(parseFloat(e))&&!isNaN(e-0)}t(Bc,"isNumber");const Oc=class _QueryCache extends h{constructor(){super(e=>h.hash([e.QueryId,e.QuerySet]))}};t(Oc,"QueryCache");const Xc=new Oc,Hc=class _Query extends u{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,n,s){super(),this.wsWorkunitsService=e instanceof ns?e:new ns(e),this.topology=Cc.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:n,...s})}static attach(e,t,n,s){const r=Xc.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:n},()=>new _Query(e,t,n));return s&&r.set(s),r}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(const t of e?.TpEspServers?.TpEspServer??[])for(const e of t?.TpBindings?.TpBinding??[])if("ws_ecl"===e?.Service){const t=`${e.Protocol}://${globalThis.location.hostname}:${e.Port}`;return new pt({baseUrl:t})}})),this._eclService}async fetchDetails(){const e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){const e=await this.wsEclService();try{this._requestSchema=await(e?.requestJson(this.QuerySet,this.QueryId))??[]}catch(t){Vc.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){const e=await this.wsEclService();try{this._responseSchema=await(e?.responseJson(this.QuerySet,this.QueryId))??{}}catch(t){Vc.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(e=>{const t=new Gc;let n=!0;for(const s of e?.Graphs?.ECLGraphEx||[])n?(t.load(s.Graph),n=!1):t.merge(s.Graph);return t})}fetchDetailsNormalized(e={}){const t=Xo.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(e=>{const n=e[0],s=e[1],r=e[2].map(e=>{const t=e.Id[0];if("a"===t||"e"===t){const t=n.idx[e.Id.substring(1)];if(!t)return Vc.debug(`Missing graph data for metric ID: ${e.Id}`),e;const s=new Set(e.Properties.Property.map(e=>e.Name)),r=[];for(const e in t){const n=e.charAt(0);if("_"!==n&&n===n.toUpperCase()&&!s.has(e)){const n=t[e],s=typeof n;if("string"===s||"number"===s||"boolean"===s){let t=Bc(n)?parseFloat(n):n,s=n;e.indexOf("Time")>=0&&(t/=1e9,s=Qc(t)+"s"),r.push({Name:e,RawValue:t,Formatted:s})}}}r.length>0&&e.Properties.Property.push(...r)}return e});return t.normalizeDetails(s,r)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){const t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(e=>{for(const t in e)e[t]=e[t].Row;return e})??[]}catch(n){return Vc.debug(n.message??n),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){const e=[];for(const t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};t(Hc,"Query");let $c=Hc;const Jc=class _StoreCache extends h{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}};t(Jc,"StoreCache");let qc=Jc;const Yc=new qc,zc=class _ValueChangedMessage extends v{constructor(e,t,n){super(),this.key=e,this.value=t,this.oldValue=n}get canConflate(){return!0}conflate(e){return this.key===e.key&&(this.value=e.value,!0)}void(){return this.value===this.oldValue}};t(zc,"ValueChangedMessage");let Zc=zc;const Kc=class _Store{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new C;static attach(e,t="HPCCApps",n,s=!0){return Yc.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:s,Namespace:n},()=>new _Store(e,t,n,s))}constructor(e,t,n,s){this.connection=e instanceof Cn?e:new Cn(e),this.Name=t,this.UserSpecific=s,this.Namespace=n}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,Type:"",Description:""})}set(e,t,n=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(s=>{const r=this._knownValues[e];this._knownValues[e]=t,n&&this._dispatch.post(new Zc(e,t,r))}).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(n=>{const s=this._knownValues[e];return this._knownValues[e]=n.Value,t&&this._dispatch.post(new Zc(e,n.Value,s)),n.Value}).catch(t=>{console.error(`Store.get(${e}) failed:`,t)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{const n={},s=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(t=>{const r=this._knownValues[t.Key];this._knownValues[t.Key]=t.Value,delete s[t.Key],n[t.Key]=t.Value,e&&this._dispatch.post(new Zc(t.Key,t.Value,r))}),e)for(const e in s)this._dispatch.post(new Zc(e,void 0,s[e]));return n}).catch(e=>(console.error("Store.getAll failed:",e),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(n=>{const s=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new Zc(e,void 0,s))}).catch(t=>{console.error(`Store.delete(${e}) failed:`,t)})}monitor(e){return this._dispatch.attach(e)}};t(Kc,"Store");let ea=Kc;const ta=n("@hpcc-js/comms/dfuWorkunit.ts"),na=class _DFUWorkunitCache extends h{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}};t(na,"DFUWorkunitCache");let sa=na;const ra=new sa,ia=class _DFUWorkunit extends u{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 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){const n=new _DFUWorkunit(e);return n.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(e=>(ra.set(n),n.set(e.result),n))}static attach(e,t,n){const s=ra.get({BaseUrl:e.baseUrl,ID:t},()=>new _DFUWorkunit(e,t));return n&&s.set(n),s}static sprayFixed(e,t){const n=new ae(e);return n.SprayFixedEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>_DFUWorkunit.attach(e,s,t.result))})}static sprayVariable(e,t){const n=new ae(e);return n.SprayVariableEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>_DFUWorkunit.attach(e,s,t.result))})}static despray(e,t){const n=new ae(e);return n.DesprayEx({...t}).then(t=>{const s=t.wuid;return n.GetDFUWorkunit({wuid:s}).then(t=>_DFUWorkunit.attach(e,s,t.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}return!1}isFailed(){return!(!this.isComplete()||6===this.State)}isDeleted(){return 999===this.State}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(te.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(){this.isComplete()?this._monitorTickCount=0:super._monitor()}_monitorTimeoutDuration(){const 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(e=>e).catch(e=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===te.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,n){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",e=>{this.isComplete()&&t([e])});break;case"changed":super.on(e,t)}else if("changed"===e)super.on(e,t,n);return this._monitor(),this}watchUntilComplete(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),this.isComplete()&&(s.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,n)=>{const s=this.watch(n=>{e&&e(n),(this.isComplete()||this.isRunning())&&(s.release(),t(this))})})}constructor(e,t){super(),this.connection=new ae(e),this.topologyConnection=new wn(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(e=>(this.set(e.result),e)).catch(e=>{if(!e.Exception.some(e=>(20080===e.Code||20081===e.Code)&&(this.clearState(this.ID),this.set("State",999),!0)))throw ta.warning(`Unexpected ESP exception: ${e.message}`),e;return{}})}};t(ia,"DFUWorkunit");let oa=ia;export{Ue as AccessService,Re as AccountService,Zo as Activity,So as Attribute,b as BUILD_VERSION,_o as BaseScope,Pe as CloudService,Ie as CodesignService,B as Connection,Ke as DFUArrayActions,tt as DFUChangeProtection,nt as DFUChangeRestriction,et as DFUDefFileFormat,rt as DFUService,oa as DFUWorkunit,sa as DFUWorkunitCache,at as DFUXRefService,Ve as DaliService,Ci as ECLGraph,Z as ESPConnection,J as ESPExceptions,pt as EclService,ft as ElkService,te as FileSpray,ae as FileSprayService,oe as FileSprayStates,ao as GlobalResultCache,Di as GraphCache,Pt as LogType,Et as LogaccessService,rc as LogicalFile,tc as LogicalFileCache,uc as Machine,oc as MachineCache,Jt as MachineService,R as PKG_NAME,D as PKG_VERSION,Zt as PackageProcessService,Po as PropertyType,$c as Query,Gc as QueryGraph,xo as RelatedProperty,Hi as Resource,nn as ResourcesService,lo as Result,go as ResultCache,_n as SMCService,hn as SashaService,yo as Scope,Bi as ScopeEdge,Ii as ScopeGraph,ki as ScopeSubgraph,Vi as ScopeVertex,ee as Service,Co as SourceFile,ea as Store,qc as StoreCache,Cn as StoreService,xt as TargetAudience,gc as TargetCluster,lc as TargetClusterCache,Do as Timer,Cc as Topology,Uc as TopologyCache,wn as TopologyService,Zc as ValueChangedMessage,zn as WUStateID,Jn as WUUpdate,Xo as Workunit,Qo as WorkunitCache,ns as WorkunitsService,rs as WorkunitsServiceEx,ue as WsAccess,xe as WsCodesign,Qe as WsDfu,_t as WsLogaccess,ln as WsSMC,sn as WsSasha,Rn as WsTopology,Pn as WsWorkunits,Ei as XGMMLEdge,Ti as XGMMLGraph,wi as XGMMLSubgraph,xi as XGMMLVertex,Ji as XSDNode,eo as XSDSchema,Zi as XSDSimpleType,Yi as XSDXMLNode,O as createConnection,Oi as createGraph,Mi as createXGMMLGraph,fc as defaultTargetCluster,x as deserializeResponse,j as get,V as hookSend,A as instanceOfIConnection,W as instanceOfIOptions,H as isArray,Zn as isECLResult,q as isExceptions,es as isWUInfoWorkunit,Kn as isWUQueryECLWorkunit,L as jsonp,so as parseXSD,oo as parseXSD2,I as post,k as send,P as serializeRequest,X as setTransportFactory,No as splitMetric,mc as targetClusters};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|