@hpcc-js/comms 3.2.0 → 3.4.0
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/index.browser.js +6313 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.browser.umd.cjs +7 -0
- package/dist/index.browser.umd.cjs.map +1 -0
- package/dist/index.node.js +3 -3
- package/dist/index.node.js.map +3 -3
- package/package.json +19 -14
- package/src/__package__.ts +2 -2
- package/src/espConnection.ts +0 -8
- package/src/index.browser.ts +1 -0
- package/src/index.node.ts +1 -1
- package/src/services/wsAccount.ts +1 -1
- package/src/services/wsCloud.ts +1 -1
- package/src/services/wsDali.ts +1 -1
- package/src/services/wsElk.ts +1 -1
- package/src/services/wsMachine.ts +1 -1
- package/src/services/wsPackageProcess.ts +1 -1
- package/src/services/wsResources.ts +1 -1
- package/src/services/wsWorkunits.ts +1 -3
- package/types/__package__.d.ts +2 -2
- package/types/index.browser.d.ts +1 -0
- package/types/index.node.d.ts +1 -1
- package/types/services/wsAccount.d.ts +1 -1
- package/types/services/wsCloud.d.ts +1 -1
- package/types/services/wsDali.d.ts +1 -1
- package/types/services/wsElk.d.ts +1 -1
- package/types/services/wsMachine.d.ts +1 -1
- package/types/services/wsPackageProcess.d.ts +1 -1
- package/types/services/wsResources.d.ts +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -7
- package/src/index.ts +0 -1
- /package/src/{index-common.ts → index.common.ts} +0 -0
- /package/types/{index-common.d.ts → index.common.d.ts} +0 -0
package/dist/index.node.js
CHANGED
|
@@ -907,12 +907,12 @@ AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsC
|
|
|
907
907
|
MGclCrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVu
|
|
908
908
|
Sw==
|
|
909
909
|
-----END CERTIFICATE-----
|
|
910
|
-
`;import{Buffer as Kt}from"safe-buffer";var Zr="@hpcc-js/comms",$r="3.2.0",ei="3.2.0";import{join as Se}from"@hpcc-js/util";import{join as lt,promiseTimeout as on,scopedLogger as an}from"@hpcc-js/util";var $t=an("comms/connection.ts");function ni(r){return"baseUrl"in r}var cn={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function ri(r){return typeof r.opts=="function"&&typeof r.send=="function"&&typeof r.clone=="function"}function M(r,e){return e===void 0||e===!0?encodeURIComponent(r):""+r}function k(r,e=!0,t=""){if(t&&(t+="."),typeof r!="object")return M(r,e);let s=[];for(let n in r)if(r.hasOwnProperty(n))if(r[n]instanceof Array){let i=!1;r[n].forEach((o,a)=>{typeof o=="object"?(i=!0,s.push(k(o,e,t+M(`${n}.${a}`,e)))):s.push(t+M(`${n}_i${a}`,e)+"="+k(o,e))}),i&&s.push(t+M(`${n}.itemcount`,e)+"="+r[n].length)}else typeof r[n]=="object"?r[n]&&r[n].Item instanceof Array?(s.push(k(r[n].Item,e,t+M(n,e))),s.push(t+M(`${n}.itemcount`,e)+"="+r[n].Item.length)):s.push(k(r[n],e,t+M(n,e))):r[n]!==void 0?s.push(t+M(n,e)+"="+M(r[n],e)):s.push(t+M(n,e));return s.join("&")}function un(r){return JSON.parse(r)}function ln(r,e,t={},s="json",n){return n&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let a=r.timeoutSecs*1e3,u=5e3,p="jsonp_callback_"+Math.round(Math.random()*999999);window[p]=function(T){a=0,C(),i(s==="json"&&typeof T=="string"?un(T):T)};let c=document.createElement("script"),l=lt(r.baseUrl,e);l+=l.indexOf("?")>=0?"&":"?",c.src=l+"jsonp="+p+"&"+k(t,r.encodeRequest),document.body.appendChild(c);let g=setInterval(function(){a<=0?clearInterval(g):(a-=u,a<=0?(clearInterval(g),$t.error("Request timeout: "+c.src),C(),o(Error("Request timeout: "+c.src))):$t.debug("Request pending ("+a/1e3+" sec): "+c.src))},u);function C(){delete window[p],document.body.removeChild(c)}})}function pn(r){return r.userID?{Authorization:`Basic ${btoa(`${r.userID}:${r.password}`)}`}:{}}var fe={};function es(r,e,t,s,n){s={...pn(r),...s},t={credentials:fe[r.baseUrl]?"omit":"include",...t,headers:s},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),r.baseUrl.indexOf("https:")===0&&(r.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):t.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(t.agent=fetch.__trustwaveAgent));function i(o){if(o.ok)return n==="json"?o.json():o.text();throw new Error(o.statusText)}return on(r.timeoutSecs*1e3,fetch(lt(r.baseUrl,e),t).then(i).catch(o=>(t.credentials=fe[r.baseUrl]?"include":"omit",fetch(lt(r.baseUrl,e),t).then(i).then(a=>(fe[r.baseUrl]=!fe[r.baseUrl],a)))))}function gn(r,e,t,s="json",n){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),es(r,e,{method:"post",body:k(t,r.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...n},s)}function dn(r,e,t,s="json",n){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),es(r,`${e}?${k(t,r.encodeRequest)}`,{method:"get",signal:i},{...n},s)}function mn(r,e,t,s="json",n){let i;switch(r.type){case"jsonp":i=ln(r,e,t,s,n);break;case"get":i=dn(r,e,t,s,n);break;case"post":default:i=gn(r,e,t,s,n);break}return i}var De=mn;function ii(r){let e=De;return r&&(De=r),e}var pt=class r{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...cn,...e},this)}send(e,t,s="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,De,n):De(this._opts,e,t,s,n)}clone(){return new r(this.opts())}},Ce=function(r){return new pt(r)};function oi(r){let e=Ce;return Ce=r,e}function hn(r){return Object.prototype.toString.call(r)==="[object Array]"}var w=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};function di(r){return r instanceof w||r.isESPExceptions&&Array.isArray(r.Exception)}function fn(r){return r.send!==void 0}var ne=class r{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=fn(e)?e:Ce(e),this._service=t,this._version=s}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,t){if(hn(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},s="json",n=!1,i,o){let a={...t,ver_:this._version};n&&(a.upload_=!0),i&&(a.abortSignal_=i);let u,p="json";switch(s){case"text":u=Se(this._service,e),p="text";break;case"xsd":u=Se(this._service,e+".xsd"),p="text";break;case"json2":u=Se(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:u=Se(this._service,e+".json")}return this._connection.send(u,a,p).then(c=>{if(s==="json"){let l;if(c&&c.Exceptions)throw new w(e,a,c.Exceptions);if(c&&(l=c[o||e+"Response"]),!l)throw new w(e,a,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return l}return c}).catch(c=>{throw c.isESPExceptions?c:new w(e,a,{Source:"ESPConnection.send",Exception:[{Code:0,Message:c.message}]})})}clone(){return new r(this._connection.clone(),this._service,this._version)}},m=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new ne(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var re;(e=>{let r;(u=>(u.Delete="Delete",u.Protect="Protect",u.Unprotect="Unprotect",u.Restore="Restore",u.SetToFailed="SetToFailed",u.Archive="Archive"))(r=e.DFUWUActions||={})})(re||={});var Re=class extends m{constructor(e){super(e,"FileSpray","1.26")}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")}};var Dn=(c=>(c[c.unknown=0]="unknown",c[c.scheduled=1]="scheduled",c[c.queued=2]="queued",c[c.started=3]="started",c[c.aborted=4]="aborted",c[c.failed=5]="failed",c[c.finished=6]="finished",c[c.monitoring=7]="monitoring",c[c.aborting=8]="aborting",c[c.notfound=999]="notfound",c))(Dn||{}),v=class 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")}};var ts;(o=>{let r;(p=>(p.User="User",p.Group="Group"))(r=o.ViewMemberType||={});let e;(g=>(g.username="username",g.fullname="fullname",g.passwordexpiration="passwordexpiration",g.employeeID="employeeID",g.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(p=>(p.Name="Name",p.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(c=>(c.Any="Any",c.User="User",c.Group="Group"))(s=o.AccountTypeReq||={});let n;(p=>(p.Name="Name",p.Type="Type"))(n=o.ResourcePermissionSortBy||={});let i;(u=>u.Name="Name")(i=o.ResourceSortBy||={})})(ts||={});var xe=class extends m{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")}};var ss=class extends xe{};var Ae=class extends m{constructor(e){super(e,"ws_account","1.06")}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")}};var ns=class extends Ae{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};var We=class extends m{constructor(e){super(e,"WsCloud","1")}GetPODs(e){return this._connection.send("GetPODs",e)}Ping(e){return this._connection.send("Ping",e)}};var rs=class extends We{getPODs(){return super.GetPODs({}).then(e=>{try{return(typeof e.Result=="string"?JSON.parse(e.Result):e.Result)?.items??[]}catch{return[]}})}};var is=class{_connection;constructor(e){this._connection=new ne(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};var ye=class extends m{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")}};var os=class extends ye{};var z;(a=>{let r;(g=>(g.Delete="Delete",g.AddToSuperfile="Add To Superfile",g.ChangeProtection="Change Protection",g.ChangeRestriction="Change Restriction"))(r=a.DFUArrayActions||={});let e;(g=>(g[g.NoChange=0]="NoChange",g[g.Protect=1]="Protect",g[g.Unprotect=2]="Unprotect",g[g.UnprotectAll=3]="UnprotectAll"))(e=a.DFUChangeProtection||={});let t;(l=>(l[l.NoChange=0]="NoChange",l[l.Restrict=1]="Restrict",l[l.Unrestricted=2]="Unrestricted"))(t=a.DFUChangeRestriction||={});let s;(c=>(c.xml="xml",c.def="def"))(s=a.DFUDefFileFormat||={});let n;(l=>(l.Token="Token",l.Engine="Engine",l.External="External"))(n=a.FileAccessRole||={});let i;(C=>(C.None="None",C.Access="Access",C.Read="Read",C.Write="Write",C.Full="Full"))(i=a.SecAccessType||={});let o;(D=>(D.Flat="Flat",D.Index="Index",D.Xml="Xml",D.Csv="Csv",D.Json="Json",D.IndexLocal="IndexLocal",D.IndexPartitioned="IndexPartitioned",D.Unset="Unset"))(o=a.DFUFileType||={})})(z||={});var Ue=class extends m{constructor(e){super(e,"WsDfu","1.65")}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")}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")}};var Hi=z.DFUArrayActions,ji=z.DFUDefFileFormat,Oi=z.DFUChangeProtection,Yi=z.DFUChangeRestriction,ie=class extends Ue{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}};var as=class extends m{constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};function cs(r,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:r,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:r,type:"dataset",children:gt(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:r,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:r,type:"object",fields:Cn(e)}}default:throw new Error("Unknown field type")}}function gt(r){r.Row&&r.Row instanceof Array&&(r=r.Row[0]);let e=[];for(let t in r)e.push(cs(t,r[t]));return e}function Cn(r){let e={};for(let t in r)e[t]=cs(t,r[t]);return e}var Ee=class extends m{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(s=>{let n=JSON.parse(s);for(let i in n)return n[i];return{}}).then(gt)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(s=>{let n=JSON.parse(s);for(let i in n)return n[i].Results;return{}}).then(s=>{let n={};for(let i in s)n[i]=gt(s[i]);return n})}submit(e,t,s){let n=`submit/query/${e}/${t}`;return this._connection.send(n,s,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new w(n,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var Fe=class extends m{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var us=class extends Fe{};import{scopedLogger as Sn}from"@hpcc-js/util";var x;(a=>{let r;(f=>(f.global="global",f.workunits="workunits",f.components="components",f.audience="audience",f.class="class",f.instance="instance",f.node="node",f.message="message",f.logid="logid",f.processid="processid",f.threadid="threadid",f.timestamp="timestamp",f.pod="pod"))(r=a.LogColumnType||={});let e;(g=>(g.string="string",g.numeric="numeric",g.datetime="datetime",g.enum="enum"))(e=a.LogColumnValueType||={});let t;(h=>(h[h.All=0]="All",h[h.ByJobID=1]="ByJobID",h[h.ByComponent=2]="ByComponent",h[h.ByLogType=3]="ByLogType",h[h.ByTargetAudience=4]="ByTargetAudience",h[h.BySourceInstance=5]="BySourceInstance",h[h.BySourceNode=6]="BySourceNode",h[h.ByFieldName=7]="ByFieldName",h[h.ByPod=8]="ByPod"))(t=a.LogAccessType||={});let s;(l=>(l[l.NONE=0]="NONE",l[l.AND=1]="AND",l[l.OR=2]="OR"))(s=a.LogAccessFilterOperator||={});let n;(g=>(g[g.MIN=0]="MIN",g[g.DEFAULT=1]="DEFAULT",g[g.ALL=2]="ALL",g[g.CUSTOM=3]="CUSTOM"))(n=a.LogSelectColumnMode||={});let i;(h=>(h[h.ByDate=0]="ByDate",h[h.ByJobID=1]="ByJobID",h[h.ByComponent=2]="ByComponent",h[h.ByLogType=3]="ByLogType",h[h.ByTargetAudience=4]="ByTargetAudience",h[h.BySourceInstance=5]="BySourceInstance",h[h.BySourceNode=6]="BySourceNode",h[h.ByFieldName=7]="ByFieldName",h[h.ByPod=8]="ByPod"))(i=a.SortColumType||={});let o;(c=>(c[c.ASC=0]="ASC",c[c.DSC=1]="DSC"))(o=a.SortDirection||={})})(x||={});var be=class extends m{constructor(e){super(e,"ws_logaccess","1.05")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}};var ls=Sn("@hpcc-js/comms/services/wsLogaccess.ts");var Rn=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(Rn||{}),xn=(n=>(n.Operator="OPR",n.User="USR",n.Programmer="PRO",n.Audit="ADT",n))(xn||{}),ps=class extends be{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(a=>s[a.LogType]=a.Name);let n=a=>{let u={};for(let p in s)a?.fields?u[p]=Object.assign({},...a.fields)[s[p]]??"":u[p]="";return u},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:x.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:x.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:x.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(let a in e){let u;a in s&&(Object.values(x.LogColumnType).includes(a)?u=a:u=s[a]);let p;if(u){switch(u){case x.LogColumnType.workunits:case"hpcc.log.jobid":p=x.LogAccessType.ByJobID;break;case x.LogColumnType.audience:case"hpcc.log.audience":p=x.LogAccessType.ByTargetAudience;break;case x.LogColumnType.class:case"hpcc.log.class":p=x.LogAccessType.ByLogType;break;case x.LogColumnType.components:case"kubernetes.container.name":p=x.LogAccessType.ByComponent;break;default:p=x.LogAccessType.ByFieldName,u=s[a]}if(Array.isArray(e[a]))e[a].forEach(c=>{p===x.LogAccessType.ByComponent&&(c+="*"),o.push({LogCategory:p,SearchField:u,SearchByValue:c})});else{let c=e[a];p===x.LogAccessType.ByComponent&&(c+="*"),o.push({LogCategory:p,SearchField:u,SearchByValue:c})}}}if(o.length>2){let a=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((u,p)=>{let c=x.LogAccessFilterOperator.AND;p>0?(o[p-1].SearchField===u.SearchField&&(c=x.LogAccessFilterOperator.OR),p===o.length-1?(a.Operator=c,a.rightFilter=u):(a.Operator=c,a.rightBinaryFilter={BinaryLogFilter:[{leftFilter:u}]},a=a.rightBinaryFilter.BinaryLogFilter[0])):a.leftFilter=u})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:x.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=x.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=x.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(a=>{try{let u=JSON.parse(a.LogLines),p=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":p=u.lines?.map(n)??[];break;default:ls.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),p=[]}return{lines:p,total:a.TotalLogLinesAvailable??1e4}}catch(u){ls.error(u.message??u)}return{lines:[],total:0}})}};import{exists as An}from"@hpcc-js/util";import{max as dt,mean as mt}from"d3-array";var Pe=class extends m{constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};var N=class extends Pe{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>An("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(n=>!!n.ComponentUsages).map(n=>{let i=n.ComponentUsages.ComponentUsage.map(o=>{let a=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(u=>{let p=u.DiskUsages&&u.DiskUsages.DiskUsage?u.DiskUsages.DiskUsage.map(c=>({...c,InUse:c.InUse*1024,Total:(c.InUse+c.Available)*1024,PercentUsed:100-c.PercentAvailable})):[];return{Name:u.Name,NetAddress:u.NetAddress,Description:u.Description,DiskUsages:p,mean:mt(p.filter(c=>!isNaN(c.PercentUsed)),c=>c.PercentUsed),max:dt(p.filter(c=>!isNaN(c.PercentUsed)),c=>c.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:a,MachineUsagesDescription:a.reduce((u,p)=>u+(p.Description||""),""),mean:mt(a.filter(u=>!isNaN(u.mean)),u=>u.mean),max:dt(a.filter(u=>!isNaN(u.max)),u=>u.max)}});return{Name:n.Name,Description:n.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,a)=>o+(a.MachineUsagesDescription||""),""),mean:mt(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:dt(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Ie=class extends m{constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};var gs=class extends Ie{};var Te=class extends m{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};var ds=class extends Te{};var ms;(e=>{let r;(n=>(n.ECL="ECL",n.DFU="DFU"))(r=e.WUTypes||={})})(ms||={});var Me=class extends m{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")}};var hs=class extends Me{};var fs;(t=>{let r;(u=>(u.ALL="ALL",u.READ="READ",u.WRITE="WRITE",u.HOLD="HOLD",u.SUB="SUB"))(r=t.LockModes||={});let e;(l=>(l.Attach="Attach",l.Detach="Detach",l.State="State",l.Reload="Reload",l.ReloadRetry="ReloadRetry",l.MemLock="MemLock",l.MemUnlock="MemUnlock",l.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(fs||={});var Be=class extends m{constructor(e){super(e,"WsSMC","1.27")}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")}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")}};var oe=class extends Be{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}};var ae=class extends m{constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};var Ds;(e=>{let r;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(r=e.RoxieQueueFilter||={})})(Ds||={});var we=class extends m{constructor(e){super(e,"WsTopology","1.32")}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")}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")}};var y=class extends we{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(t=>{if(t.default)return t.default;let s,n;return t.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(n=i),i.Type==="hthor"?(s=i,!0):!1)),s||n})}};import{deepMixin as Wn,xml2json as yn}from"@hpcc-js/util";var E;(D=>{let r;(I=>(I.Abort="Abort",I.Delete="Delete",I.Deschedule="Deschedule",I.Reschedule="Reschedule",I.Pause="Pause",I.PauseNow="PauseNow",I.Protect="Protect",I.Unprotect="Unprotect",I.Restore="Restore",I.Resume="Resume",I.SetToFailed="SetToFailed",I.Archive="Archive"))(r=D.ECLWUActions||={});let e;(f=>(f[f.MIN=0]="MIN",f[f.DEFAULT=1]="DEFAULT",f[f.ALL=2]="ALL",f[f.CUSTOM=3]="CUSTOM"))(e=D.LogSelectColumnMode||={});let t;(d=>(d[d.ASC=0]="ASC",d[d.DSC=1]="DSC"))(t=D.SortDirection||={});let s;(A=>(A.ALL="ALL",A.DIS="DIS",A.ERR="ERR",A.WRN="WRN",A.INF="INF",A.PRO="PRO",A.MET="MET",A.EVT="EVT"))(s=D.LogEventClass||={});let n;(R=>(R.Single="Single",R.List="List",R.Multi="Multi"))(n=D.WUDetailsAttrValueType||={});let i;(R=>(R.SyntaxCheck="SyntaxCheck",R.Deploy="Deploy",R.Publish="Publish"))(i=D.EclDefinitionActions||={});let o;(R=>(R.xml="xml",R.json="json",R.text="text"))(o=D.ErrorMessageFormat||={});let a;(R=>(R[R.XML=0]="XML",R[R.JSON=1]="JSON",R[R.CSV=2]="CSV"))(a=D.LogAccessLogFormat||={});let u;(f=>(f.info="info",f.warning="warning",f.error="error",f.alert="alert"))(u=D.WUExceptionSeverity||={});let p;(J=>(J.Allqueries="All queries",J.Notsuspended="Not suspended",J.Suspended="Suspended",J.Suspendedbyuser="Suspended by user",J.Suspendedbyfirstnode="Suspended by first node",J.Suspendedbyanynode="Suspended by any node"))(p=D.WUQueryFilterSuspendedType||={});let c;(se=>(se.All="All",se.Id="Id",se.Name="Name",se.Alias="Alias",se.Status="Status"))(c=D.WUQuerySetFilterType||={});let l;(R=>(R.All="All",R.Protected="Protected",R.NotProtected="NotProtected"))(l=D.WUProtectFilter||={});let g;(rn=>rn.Deactivate="Deactivate")(g=D.QuerySetAliasActionTypes||={});let C;(d=>(d.None="None",d.ActivateImportedActive="ActivateImportedActive"))(C=D.QuerysetImportActivation||={});let T;(A=>(A.Suspend="Suspend",A.Unsuspend="Unsuspend",A.ToggleSuspend="ToggleSuspend",A.Activate="Activate",A.Delete="Delete",A.DeleteQueriesAndWUs="DeleteQueriesAndWUs",A.RemoveAllAliases="RemoveAllAliases",A.ResetQueryStats="ResetQueryStats"))(T=D.QuerySetQueryActionTypes||={});let ut;(f=>(f[f.DoNotActivateQuery=0]="DoNotActivateQuery",f[f.ActivateQuery=1]="ActivateQuery",f[f.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",f[f.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(ut=D.WUQueryActivationMode||={})})(E||={});var ce=class extends m{constructor(e){super(e,"WsWorkunits","2")}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")}};var ht=(d=>(d[d.Unknown=0]="Unknown",d[d.Compiled=1]="Compiled",d[d.Running=2]="Running",d[d.Completed=3]="Completed",d[d.Failed=4]="Failed",d[d.Archived=5]="Archived",d[d.Aborting=6]="Aborting",d[d.Aborted=7]="Aborted",d[d.Blocked=8]="Blocked",d[d.Submitted=9]="Submitted",d[d.Scheduled=10]="Scheduled",d[d.Compiling=11]="Compiling",d[d.Wait=12]="Wait",d[d.UploadingFiled=13]="UploadingFiled",d[d.DebugPaused=14]="DebugPaused",d[d.DebugRunning=15]="DebugRunning",d[d.Paused=16]="Paused",d[d.LAST=17]="LAST",d[d.NotFound=999]="NotFound",d))(ht||{}),V;(e=>{let r;(g=>(g[g.Unknown=0]="Unknown",g[g.Compile=1]="Compile",g[g.Check=2]="Check",g[g.Run=3]="Run",g[g.ExecuteExisting=4]="ExecuteExisting",g[g.Pause=5]="Pause",g[g.PauseNow=6]="PauseNow",g[g.Resume=7]="Resume",g[g.Debug=8]="Debug",g[g.__size=9]="__size"))(r=e.Action||={})})(V||={});function Ss(r){return typeof r.Name=="string"}function jo(r){return r.TotalClusterTime!==void 0}function Oo(r){return r.StateEx!==void 0}var W=class extends ce{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(e=>({result:!0})).catch(e=>({result:!1,error:e}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(s=>Wn({Workunits:{ECLWorkunit:[]}},s))}WUInfo(e){let t={Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(t=>{let n=yn(t.Result).children();return n.length?n[0]:null})}},Ne=class extends ce{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as Zn,StateObject as $n}from"@hpcc-js/util";import{Cache as Mn,deepMixinT as yt,scopedLogger as Bn,StateObject as wn,XMLNode as Ut}from"@hpcc-js/util";import{format as Nn}from"d3-format";import{utcFormat as Qn,utcParse as Ln}from"d3-time-format";import{Cache as Rs,Edge as Fs,Graph as bs,StateObject as Un,Subgraph as Ps,Vertex as Is}from"@hpcc-js/util";var Qe=class extends Un{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,s){super(),this.wu=e;let n=0;for(let i of s)if(i.GraphName===t.Name&&!i.HasSubGraphId){n=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:n,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(t=>ke(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>ke(t))}},Le=class extends Rs{constructor(){super(e=>Rs.hash([e.Name]))}};function Ts(r,e,t){t=t||[],t.push(r),e(r.name,r.$,r.children(),t),r.children().forEach(s=>{Ts(s,e,t)}),t.pop()}function ft(r){let e={};return r.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var Dt=class extends bs{},xs=class extends Ps{},As=class extends Is{},Ws=class extends Fs{};function Ms(r,e){let t={},s={},n={},i=new Dt(a=>a._.id),o=[i.root];return Ts(e,(a,u,p,c)=>{let l=o[o.length-1];switch(a){case"graph":break;case"node":if(p.length&&p[0].children().length&&p[0].children()[0].name==="graph"){let T=l.createSubgraph(ft(p));o.push(T),t[u.id]=T}let g=l.createVertex(ft(p));s[u.id]=g;break;case"edge":let C=l.createEdge(s[u.source],s[u.target],ft(p));n[u.id]=C;break;default:}}),i}var Ge=class extends bs{},ys=class extends Ps{},Us=class extends Is{},Es=class extends Fs{};function ke(r){let e={},t={},s={},n;for(let i of r)switch(i.ScopeType){case"graph":n=new Ge(c=>c._.Id,i),e[i.ScopeName]=n.root;break;case"subgraph":n||(n=new Ge(c=>c._.Id,i),e[i.ScopeName]=n.root);let o=i.parentScope().split(":"),a=e[i.parentScope()];for(;o.length&&!a;)a=e[o.join(":")],o.pop();if(!a)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let c=a;e[i.ScopeName]=c.createSubgraph(i)}break;case"activity":let u=e[i.parentScope()];u?s[i.ScopeName]=u.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let p=s[i.parentScope()];p?p._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],a=e[o.parentScope()];if(!a)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let u=a;try{let p=n.vertex(o.attr("IdSource").RawValue),c=n.vertex(o.attr("IdTarget").RawValue);u.createEdge(p,c,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return n}import{StateObject as En}from"@hpcc-js/util";var ve=class extends En{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let s=t.split("\\").join("/"),n=s.split("/"),i="res/"+this.wu.Wuid+"/",o="",a="";s.indexOf(i)===0&&(o=s.substr(i.length),a=n[n.length-1]),this.set({URL:t,DisplayName:a,DisplayPath:o})}};import{Cache as xt,exists as Rt,StateObject as bn}from"@hpcc-js/util";import{SAXStackParser as Fn,Stack as Bs}from"@hpcc-js/util";var Ve=class{e;constructor(e){this.e=e}fix(){delete this.e}},_e=class extends Ve{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){let s=this._children[t];s.name==="Row"&&s.type===void 0&&(this._children.push(...s._children),this._children.splice(t,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}}charWidth(){let e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let t="0123456789",s=this.type.lastIndexOf("_"),n=s>0?s:this.type.length,i=n-1;for(;i>=0&&t.indexOf(this.type.charAt(i))!==-1;--i);i+1<n&&(e=parseInt(this.type.substring(i+1,n),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},He=class extends Ve{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},je=class{root;simpleTypes={};fields(){return this.root.children()}},Oe=class extends Fn{schema=new je;simpleType;simpleTypes={};xsdStack=new Bs;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new _e(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 He(e);break;default:break}}endXMLNode(e){switch(e.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":let s=this.xsdStack.top();for(let n in e.$)s.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function St(r){let e=new Oe;return e.parse(r),e.schema}var Ct=class extends Oe{_rootName;schema=new je;simpleTypes={};xsdStack=new Bs;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new _e(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 He(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function ta(r,e){let t=new Ct(e);return t.parse(r),t.schema}var At=class extends xt{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Ye=new At,Xe=class r extends bn{connection;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,s,n){let i;return Array.isArray(n)?(i=Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new r(e,t,s,n)),i.set(s)):typeof n>"u"&&(typeof s=="number"?i=Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new r(e,t,s)):typeof s=="string"&&(i=Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new r(e,t,s)))),i}static attachLogicalFile(e,t,s){return Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new r(e,t,s,!0))}constructor(e,t,s,n){super(),e instanceof W?this.connection=e:this.connection=new W(e),typeof n=="boolean"&&n===!0?this.set({NodeGroup:t,LogicalFileName:s}):Ss(s)&&Array.isArray(n)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:n}):typeof n>"u"?typeof s=="number"?this.set({Wuid:t,ResultSequence:s}):typeof s=="string"?this.set({Wuid:t,ResultName:s}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=St(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,s=!1,n={},i){return this.WUResult(e,t,!s,n,i).then(o=>{let a=o.Result;return delete o.Result,this.set({...o}),Rt("XmlSchema.xml",a)&&(this.xsdSchema=St(a.XmlSchema.xml)),Rt("Row",a)?a.Row:this.ResultName&&Rt(this.ResultName,a)?a[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,n={},i){let o={NamedValue:{itemcount:0}};for(let u in n)o.NamedValue[o.NamedValue.itemcount++]={Name:u,Value:n[u]};let a={FilterBy:o};return this.Wuid&&this.ResultName!==void 0?(a.Wuid=this.Wuid,a.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(a.Wuid=this.Wuid,a.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(a.LogicalName=this.LogicalFileName,a.Cluster=this.NodeGroup):this.LogicalFileName&&(a.LogicalName=this.LogicalFileName),a.Start=e,a.Count=t,a.SuppressXmlSchema=s,this.connection.WUResult(a,i).then(u=>u)}},qe=class extends xt{constructor(){super(e=>xt.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as ws}from"@hpcc-js/util";var _=class extends ws{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)}},Wt=class extends ws{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(s=>{s.Measure==="ts"&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&s.Measure==="ts"&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new _(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new _(this,t.start))):t.start?e.push(new _(this,t.start)):t.end&&e.push(new _(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(t=>{this._attributeMap[t.Name]=t}),this.Properties.Property=[];for(let t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){let e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(let t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new _(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="",s=[];t=this.Id,s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let n=this.formattedAttrs();for(let i in n)i==="Label"?t=n[i]:s.push(`<tr><td class="key">${i}</td><td class="value">${n[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
910
|
+
`;import{Buffer as Kt}from"safe-buffer";var Zr="@hpcc-js/comms",$r="3.4.0",ei="3.4.0";import{join as Se}from"@hpcc-js/util";import{join as lt,promiseTimeout as on,scopedLogger as an}from"@hpcc-js/util";var $t=an("comms/connection.ts");function ni(r){return"baseUrl"in r}var cn={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function ri(r){return typeof r.opts=="function"&&typeof r.send=="function"&&typeof r.clone=="function"}function M(r,e){return e===void 0||e===!0?encodeURIComponent(r):""+r}function G(r,e=!0,t=""){if(t&&(t+="."),typeof r!="object")return M(r,e);let s=[];for(let n in r)if(r.hasOwnProperty(n))if(r[n]instanceof Array){let i=!1;r[n].forEach((o,a)=>{typeof o=="object"?(i=!0,s.push(G(o,e,t+M(`${n}.${a}`,e)))):s.push(t+M(`${n}_i${a}`,e)+"="+G(o,e))}),i&&s.push(t+M(`${n}.itemcount`,e)+"="+r[n].length)}else typeof r[n]=="object"?r[n]&&r[n].Item instanceof Array?(s.push(G(r[n].Item,e,t+M(n,e))),s.push(t+M(`${n}.itemcount`,e)+"="+r[n].Item.length)):s.push(G(r[n],e,t+M(n,e))):r[n]!==void 0?s.push(t+M(n,e)+"="+M(r[n],e)):s.push(t+M(n,e));return s.join("&")}function un(r){return JSON.parse(r)}function ln(r,e,t={},s="json",n){return n&&console.warn("Header attributes ignored for JSONP connections"),new Promise((i,o)=>{let a=r.timeoutSecs*1e3,u=5e3,p="jsonp_callback_"+Math.round(Math.random()*999999);window[p]=function(T){a=0,C(),i(s==="json"&&typeof T=="string"?un(T):T)};let c=document.createElement("script"),l=lt(r.baseUrl,e);l+=l.indexOf("?")>=0?"&":"?",c.src=l+"jsonp="+p+"&"+G(t,r.encodeRequest),document.body.appendChild(c);let g=setInterval(function(){a<=0?clearInterval(g):(a-=u,a<=0?(clearInterval(g),$t.error("Request timeout: "+c.src),C(),o(Error("Request timeout: "+c.src))):$t.debug("Request pending ("+a/1e3+" sec): "+c.src))},u);function C(){delete window[p],document.body.removeChild(c)}})}function pn(r){return r.userID?{Authorization:`Basic ${btoa(`${r.userID}:${r.password}`)}`}:{}}var fe={};function es(r,e,t,s,n){s={...pn(r),...s},t={credentials:fe[r.baseUrl]?"omit":"include",...t,headers:s},fetch.__setGlobalDispatcher&&fetch.__setGlobalDispatcher(fetch.__defaultAgent),r.baseUrl.indexOf("https:")===0&&(r.rejectUnauthorized===!1&&fetch.__rejectUnauthorizedAgent?fetch.__setGlobalDispatcher?fetch.__setGlobalDispatcher(fetch.__rejectUnauthorizedAgent):t.agent=fetch.__rejectUnauthorizedAgent:fetch.__trustwaveAgent&&(t.agent=fetch.__trustwaveAgent));function i(o){if(o.ok)return n==="json"?o.json():o.text();throw new Error(o.statusText)}return on(r.timeoutSecs*1e3,fetch(lt(r.baseUrl,e),t).then(i).catch(o=>(t.credentials=fe[r.baseUrl]?"include":"omit",fetch(lt(r.baseUrl,e),t).then(i).then(a=>(fe[r.baseUrl]=!fe[r.baseUrl],a)))))}function gn(r,e,t,s="json",n){t.upload_&&(delete t.upload_,e+="?upload_");let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),es(r,e,{method:"post",body:G(t,r.encodeRequest),signal:i},{"Content-Type":"application/x-www-form-urlencoded",...n},s)}function dn(r,e,t,s="json",n){let i;return t.abortSignal_&&(i=t.abortSignal_,delete t.abortSignal_),es(r,`${e}?${G(t,r.encodeRequest)}`,{method:"get",signal:i},{...n},s)}function mn(r,e,t,s="json",n){let i;switch(r.type){case"jsonp":i=ln(r,e,t,s,n);break;case"get":i=dn(r,e,t,s,n);break;case"post":default:i=gn(r,e,t,s,n);break}return i}var De=mn;function ii(r){let e=De;return r&&(De=r),e}var pt=class r{_opts;get baseUrl(){return this._opts.baseUrl}constructor(e){this.opts(e)}opts(e){return arguments.length===0?this._opts:(this._opts={...cn,...e},this)}send(e,t,s="json",n){return this._opts.hookSend?this._opts.hookSend(this._opts,e,t,s,De,n):De(this._opts,e,t,s,n)}clone(){return new r(this.opts())}},Ce=function(r){return new pt(r)};function oi(r){let e=Ce;return Ce=r,e}function hn(r){return Object.prototype.toString.call(r)==="[object Array]"}var k=class extends Error{isESPExceptions=!0;action;request;Source;Exception;constructor(e,t,s){super("ESPException: "+s.Source),this.action=e,this.request=t,this.Source=s.Source,this.Exception=s.Exception,s.Exception.length?this.message=`${s.Exception[0].Code}: ${s.Exception[0].Message}`:this.message=""}};function di(r){return r instanceof k||r.isESPExceptions&&Array.isArray(r.Exception)}function fn(r){return r.send!==void 0}var ne=class r{_connection;get baseUrl(){return this._connection.opts().baseUrl}_service;_version;constructor(e,t,s){this._connection=fn(e)?e:Ce(e),this._service=t,this._version=s}service(e){return e===void 0?this._service:(this._service=e,this)}version(e){return e===void 0?this._version:(this._version=e,this)}toESPStringArray(e,t){if(hn(e[t])){for(let s=0;s<e[t].length;++s)e[t+"_i"+s]=e[t][s];delete e[t]}return e}opts(e){return e===void 0?this._connection.opts():(this._connection.opts(e),this)}send(e,t={},s="json",n=!1,i,o){let a={...t,ver_:this._version};n&&(a.upload_=!0),i&&(a.abortSignal_=i);let u,p="json";switch(s){case"text":u=Se(this._service,e),p="text";break;case"xsd":u=Se(this._service,e+".xsd"),p="text";break;case"json2":u=Se(this._service,e+"/json"),s="json",e=e.split("/").pop();break;default:u=Se(this._service,e+".json")}return this._connection.send(u,a,p).then(c=>{if(s==="json"){let l;if(c&&c.Exceptions)throw new k(e,a,c.Exceptions);if(c&&(l=c[o||e+"Response"]),!l)throw new k(e,a,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return l}return c})}clone(){return new r(this._connection.clone(),this._service,this._version)}},m=class{_connection;get baseUrl(){return this._connection.opts().baseUrl}constructor(e,t,s){this._connection=new ne(e,t,s)}opts(){return this._connection.opts()}connection(){return this._connection.clone()}};var re;(e=>{let r;(u=>(u.Delete="Delete",u.Protect="Protect",u.Unprotect="Unprotect",u.Restore="Restore",u.SetToFailed="SetToFailed",u.Archive="Archive"))(r=e.DFUWUActions||={})})(re||={});var Re=class extends m{constructor(e){super(e,"FileSpray","1.26")}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")}};var Dn=(c=>(c[c.unknown=0]="unknown",c[c.scheduled=1]="scheduled",c[c.queued=2]="queued",c[c.started=3]="started",c[c.aborted=4]="aborted",c[c.failed=5]="failed",c[c.finished=6]="finished",c[c.monitoring=7]="monitoring",c[c.aborting=8]="aborting",c[c.notfound=999]="notfound",c))(Dn||{}),v=class 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")}};var ts;(o=>{let r;(p=>(p.User="User",p.Group="Group"))(r=o.ViewMemberType||={});let e;(g=>(g.username="username",g.fullname="fullname",g.passwordexpiration="passwordexpiration",g.employeeID="employeeID",g.employeeNumber="employeeNumber"))(e=o.UserSortBy||={});let t;(p=>(p.Name="Name",p.ManagedBy="ManagedBy"))(t=o.GroupSortBy||={});let s;(c=>(c.Any="Any",c.User="User",c.Group="Group"))(s=o.AccountTypeReq||={});let n;(p=>(p.Name="Name",p.Type="Type"))(n=o.ResourcePermissionSortBy||={});let i;(u=>u.Name="Name")(i=o.ResourceSortBy||={})})(ts||={});var xe=class extends m{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")}};var ss=class extends xe{};var Ae=class extends m{constructor(e){super(e,"ws_account","1.06")}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")}};var ns=class extends Ae{VerifyUser(e){return this._connection.send("VerifyUser",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===20043))return{retcode:20043,Exceptions:{Source:"wsAccount",Exception:t.Exception}};throw t})}};var We=class extends m{constructor(e){super(e,"WsCloud","1")}GetPODs(e){return this._connection.send("GetPODs",e)}Ping(e){return this._connection.send("Ping",e)}};var rs=class extends We{getPODs(){return super.GetPODs({}).then(e=>{try{return(typeof e.Result=="string"?JSON.parse(e.Result):e.Result)?.items??[]}catch{return[]}})}};var is=class{_connection;constructor(e){this._connection=new ne(e,"ws_codesign","1.1")}connectionOptions(){return this._connection.opts()}ListUserIDs(e){return this._connection.send("ListUserIDs",e).then(t=>t.UserIDs.Item).catch(t=>[])}Sign(e){return this._connection.send("Sign",{SigningMethod:"gpg",...e})}Verify(e){return this._connection.send("Verify",e)}};var ye=class extends m{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")}};var os=class extends ye{};var z;(a=>{let r;(g=>(g.Delete="Delete",g.AddToSuperfile="Add To Superfile",g.ChangeProtection="Change Protection",g.ChangeRestriction="Change Restriction"))(r=a.DFUArrayActions||={});let e;(g=>(g[g.NoChange=0]="NoChange",g[g.Protect=1]="Protect",g[g.Unprotect=2]="Unprotect",g[g.UnprotectAll=3]="UnprotectAll"))(e=a.DFUChangeProtection||={});let t;(l=>(l[l.NoChange=0]="NoChange",l[l.Restrict=1]="Restrict",l[l.Unrestricted=2]="Unrestricted"))(t=a.DFUChangeRestriction||={});let s;(c=>(c.xml="xml",c.def="def"))(s=a.DFUDefFileFormat||={});let n;(l=>(l.Token="Token",l.Engine="Engine",l.External="External"))(n=a.FileAccessRole||={});let i;(C=>(C.None="None",C.Access="Access",C.Read="Read",C.Write="Write",C.Full="Full"))(i=a.SecAccessType||={});let o;(D=>(D.Flat="Flat",D.Index="Index",D.Xml="Xml",D.Csv="Csv",D.Json="Json",D.IndexLocal="IndexLocal",D.IndexPartitioned="IndexPartitioned",D.Unset="Unset"))(o=a.DFUFileType||={})})(z||={});var Ue=class extends m{constructor(e){super(e,"WsDfu","1.65")}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")}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")}};var Hi=z.DFUArrayActions,ji=z.DFUDefFileFormat,Oi=z.DFUChangeProtection,Yi=z.DFUChangeRestriction,ie=class extends Ue{DFUFile(e){return this._connection.send("DFUDefFile",e,"text")}};var as=class extends m{constructor(e){super(e,"WsDFUXRef","1.01")}DFUXRefArrayAction(e){return this._connection.send("DFUXRefArrayAction",e)}DFUXRefBuild(e){return this._connection.send("DFUXRefBuild",e)}DFUXRefBuildCancel(e){return this._connection.send("DFUXRefBuildCancel",e)}DFUXRefCleanDirectories(e){return this._connection.send("DFUXRefCleanDirectories",e)}DFUXRefDirectories(e){return this._connection.send("DFUXRefDirectories",e,void 0,void 0,void 0,"DFUXRefDirectoriesQueryResponse")}DFUXRefFoundFiles(e){return this._connection.send("DFUXRefFoundFiles",e,void 0,void 0,void 0,"DFUXRefFoundFilesQueryResponse")}DFUXRefList(e={}){return this._connection.send("DFUXRefList",e)}DFUXRefLostFiles(e){return this._connection.send("DFUXRefLostFiles",e,void 0,void 0,void 0,"DFUXRefLostFilesQueryResponse")}DFUXRefMessages(e){return this._connection.send("DFUXRefMessages",e,void 0,void 0,void 0,"DFUXRefMessagesQueryResponse")}DFUXRefOrphanFiles(e){return this._connection.send("DFUXRefOrphanFiles",e,void 0,void 0,void 0,"DFUXRefOrphanFilesQueryResponse")}DFUXRefUnusedFiles(e){return this._connection.send("DFUXRefUnusedFiles",e)}};function cs(r,e){let t=typeof e;switch(t){case"boolean":case"number":case"string":return{id:r,type:t};case"object":if(e.Row instanceof Array&&(e=e.Row),e instanceof Array)return{id:r,type:"dataset",children:gt(e[0])};if(e instanceof Object){if(e.Item&&e.Item instanceof Array&&e.Item.length===1){let s=typeof e.Item[0];if(s==="string"||s==="number")return{id:r,type:"set",fieldType:s};throw new Error("Unknown field type")}return{id:r,type:"object",fields:Cn(e)}}default:throw new Error("Unknown field type")}}function gt(r){r.Row&&r.Row instanceof Array&&(r=r.Row[0]);let e=[];for(let t in r)e.push(cs(t,r[t]));return e}function Cn(r){let e={};for(let t in r)e[t]=cs(t,r[t]);return e}var Ee=class extends m{constructor(e){super(e,"WsEcl","0")}opts(){return this._connection.opts()}requestJson(e,t){return this._connection.send(`example/request/query/${e}/${t}/json`,{},"text").then(s=>{let n=JSON.parse(s);for(let i in n)return n[i];return{}}).then(gt)}responseJson(e,t){return this._connection.send(`example/response/query/${e}/${t}/json`,{},"text").then(s=>{let n=JSON.parse(s);for(let i in n)return n[i].Results;return{}}).then(s=>{let n={};for(let i in s)n[i]=gt(s[i]);return n})}submit(e,t,s){let n=`submit/query/${e}/${t}`;return this._connection.send(n,s,"json2").then(i=>{if(i.Results&&i.Results.Exception)throw new k(n,s,{Source:"wsEcl.submit",Exception:i.Results.Exception});return i.Results})}};var Fe=class extends m{constructor(e){super(e,"ws_elk","1")}GetConfigDetails(e){return this._connection.send("GetConfigDetails",e)}Ping(e){return this._connection.send("Ping",e)}};var us=class extends Fe{};import{scopedLogger as Sn}from"@hpcc-js/util";var x;(a=>{let r;(f=>(f.global="global",f.workunits="workunits",f.components="components",f.audience="audience",f.class="class",f.instance="instance",f.node="node",f.message="message",f.logid="logid",f.processid="processid",f.threadid="threadid",f.timestamp="timestamp",f.pod="pod"))(r=a.LogColumnType||={});let e;(g=>(g.string="string",g.numeric="numeric",g.datetime="datetime",g.enum="enum"))(e=a.LogColumnValueType||={});let t;(h=>(h[h.All=0]="All",h[h.ByJobID=1]="ByJobID",h[h.ByComponent=2]="ByComponent",h[h.ByLogType=3]="ByLogType",h[h.ByTargetAudience=4]="ByTargetAudience",h[h.BySourceInstance=5]="BySourceInstance",h[h.BySourceNode=6]="BySourceNode",h[h.ByFieldName=7]="ByFieldName",h[h.ByPod=8]="ByPod"))(t=a.LogAccessType||={});let s;(l=>(l[l.NONE=0]="NONE",l[l.AND=1]="AND",l[l.OR=2]="OR"))(s=a.LogAccessFilterOperator||={});let n;(g=>(g[g.MIN=0]="MIN",g[g.DEFAULT=1]="DEFAULT",g[g.ALL=2]="ALL",g[g.CUSTOM=3]="CUSTOM"))(n=a.LogSelectColumnMode||={});let i;(h=>(h[h.ByDate=0]="ByDate",h[h.ByJobID=1]="ByJobID",h[h.ByComponent=2]="ByComponent",h[h.ByLogType=3]="ByLogType",h[h.ByTargetAudience=4]="ByTargetAudience",h[h.BySourceInstance=5]="BySourceInstance",h[h.BySourceNode=6]="BySourceNode",h[h.ByFieldName=7]="ByFieldName",h[h.ByPod=8]="ByPod"))(i=a.SortColumType||={});let o;(c=>(c[c.ASC=0]="ASC",c[c.DSC=1]="DSC"))(o=a.SortDirection||={})})(x||={});var be=class extends m{constructor(e){super(e,"ws_logaccess","1.05")}GetLogAccessInfo(e){return this._connection.send("GetLogAccessInfo",e,"json",!1,void 0,"GetLogAccessInfoResponse")}GetLogs(e){return this._connection.send("GetLogs",e,"json",!1,void 0,"GetLogsResponse")}Ping(e){return this._connection.send("Ping",e,"json",!1,void 0,"ws_logaccessPingResponse")}};var ls=Sn("@hpcc-js/comms/services/wsLogaccess.ts");var Rn=(o=>(o.Disaster="DIS",o.Error="ERR",o.Warning="WRN",o.Information="INF",o.Progress="PRO",o.Metric="MET",o))(Rn||{}),xn=(n=>(n.Operator="OPR",n.User="USR",n.Programmer="PRO",n.Audit="ADT",n))(xn||{}),ps=class extends be{_logAccessInfo;GetLogAccessInfo(e={}){return this._logAccessInfo||(this._logAccessInfo=super.GetLogAccessInfo(e)),this._logAccessInfo}GetLogs(e){return super.GetLogs(e)}async GetLogsEx(e){let t=await this.GetLogAccessInfo(),s={};t.Columns.Column.forEach(a=>s[a.LogType]=a.Name);let n=a=>{let u={};for(let p in s)a?.fields?u[p]=Object.assign({},...a.fields)[s[p]]??"":u[p]="";return u},i={Filter:{leftBinaryFilter:{BinaryLogFilter:[{leftFilter:{LogCategory:x.LogAccessType.All}}]}},Range:{StartDate:new Date(0).toISOString()},LogLineStartFrom:e.LogLineStartFrom??0,LogLineLimit:e.LogLineLimit??100,SelectColumnMode:x.LogSelectColumnMode.DEFAULT,Format:"JSON",SortBy:{SortCondition:[{BySortType:x.SortColumType.ByDate,ColumnName:"",Direction:0}]}},o=[];for(let a in e){let u;a in s&&(Object.values(x.LogColumnType).includes(a)?u=a:u=s[a]);let p;if(u){switch(u){case x.LogColumnType.workunits:case"hpcc.log.jobid":p=x.LogAccessType.ByJobID;break;case x.LogColumnType.audience:case"hpcc.log.audience":p=x.LogAccessType.ByTargetAudience;break;case x.LogColumnType.class:case"hpcc.log.class":p=x.LogAccessType.ByLogType;break;case x.LogColumnType.components:case"kubernetes.container.name":p=x.LogAccessType.ByComponent;break;default:p=x.LogAccessType.ByFieldName,u=s[a]}if(Array.isArray(e[a]))e[a].forEach(c=>{p===x.LogAccessType.ByComponent&&(c+="*"),o.push({LogCategory:p,SearchField:u,SearchByValue:c})});else{let c=e[a];p===x.LogAccessType.ByComponent&&(c+="*"),o.push({LogCategory:p,SearchField:u,SearchByValue:c})}}}if(o.length>2){let a=i.Filter.leftBinaryFilter.BinaryLogFilter[0];o.forEach((u,p)=>{let c=x.LogAccessFilterOperator.AND;p>0?(o[p-1].SearchField===u.SearchField&&(c=x.LogAccessFilterOperator.OR),p===o.length-1?(a.Operator=c,a.rightFilter=u):(a.Operator=c,a.rightBinaryFilter={BinaryLogFilter:[{leftFilter:u}]},a=a.rightBinaryFilter.BinaryLogFilter[0])):a.leftFilter=u})}else delete i.Filter.leftBinaryFilter,i.Filter.leftFilter={LogCategory:x.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=x.LogAccessFilterOperator.AND,o[0].SearchField===o[1].SearchField&&(i.Filter.Operator=x.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(a=>{try{let u=JSON.parse(a.LogLines),p=[];switch(t.RemoteLogManagerType){case"azureloganalyticscurl":case"elasticstack":case"grafanacurl":p=u.lines?.map(n)??[];break;default:ls.warning(`Unknown RemoteLogManagerType: ${t.RemoteLogManagerType}`),p=[]}return{lines:p,total:a.TotalLogLinesAvailable??1e4}}catch(u){ls.error(u.message??u)}return{lines:[],total:0}})}};import{exists as An}from"@hpcc-js/util";import{max as dt,mean as mt}from"d3-array";var Pe=class extends m{constructor(e){super(e,"ws_machine","1.17")}GetComponentStatus(e){return this._connection.send("GetComponentStatus",e)}GetComponentUsage(e){return this._connection.send("GetComponentUsage",e)}GetMachineInfo(e){return this._connection.send("GetMachineInfo",e)}GetMachineInfoEx(e){return this._connection.send("GetMachineInfoEx",e)}GetMetrics(e){return this._connection.send("GetMetrics",e)}GetNodeGroupUsage(e){return this._connection.send("GetNodeGroupUsage",e)}GetTargetClusterInfo(e){return this._connection.send("GetTargetClusterInfo",e)}GetTargetClusterUsage(e){return this._connection.send("GetTargetClusterUsage",e)}Ping(e){return this._connection.send("Ping",e)}UpdateComponentStatus(e){return this._connection.send("UpdateComponentStatus",e)}};var w=class extends Pe{GetTargetClusterUsageEx(e,t=!1){return this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:t}).then(s=>An("TargetClusterUsages.TargetClusterUsage",s)?s.TargetClusterUsages.TargetClusterUsage:[]).then(s=>s.filter(n=>!!n.ComponentUsages).map(n=>{let i=n.ComponentUsages.ComponentUsage.map(o=>{let a=(o.MachineUsages&&o.MachineUsages.MachineUsage?o.MachineUsages.MachineUsage:[]).map(u=>{let p=u.DiskUsages&&u.DiskUsages.DiskUsage?u.DiskUsages.DiskUsage.map(c=>({...c,InUse:c.InUse*1024,Total:(c.InUse+c.Available)*1024,PercentUsed:100-c.PercentAvailable})):[];return{Name:u.Name,NetAddress:u.NetAddress,Description:u.Description,DiskUsages:p,mean:mt(p.filter(c=>!isNaN(c.PercentUsed)),c=>c.PercentUsed),max:dt(p.filter(c=>!isNaN(c.PercentUsed)),c=>c.PercentUsed)}});return{Type:o.Type,Name:o.Name,Description:o.Description,MachineUsages:a,MachineUsagesDescription:a.reduce((u,p)=>u+(p.Description||""),""),mean:mt(a.filter(u=>!isNaN(u.mean)),u=>u.mean),max:dt(a.filter(u=>!isNaN(u.max)),u=>u.max)}});return{Name:n.Name,Description:n.Description,ComponentUsages:i,ComponentUsagesDescription:i.reduce((o,a)=>o+(a.MachineUsagesDescription||""),""),mean:mt(i.filter(o=>!isNaN(o.mean)),o=>o.mean),max:dt(i.filter(o=>!isNaN(o.max)),o=>o.max)}}))}};var Ie=class extends m{constructor(e){super(e,"WsPackageProcess","1.04")}ActivatePackage(e){return this._connection.send("ActivatePackage",e)}AddPackage(e){return this._connection.send("AddPackage",e)}AddPartToPackageMap(e){return this._connection.send("AddPartToPackageMap",e)}CopyPackageMap(e){return this._connection.send("CopyPackageMap",e)}DeActivatePackage(e){return this._connection.send("DeActivatePackage",e)}DeletePackage(e){return this._connection.send("DeletePackage",e)}Echo(e){return this._connection.send("Echo",e)}GetPackage(e){return this._connection.send("GetPackage",e)}GetPackageMapById(e){return this._connection.send("GetPackageMapById",e)}GetPackageMapSelectOptions(e){return this._connection.send("GetPackageMapSelectOptions",e)}GetPartFromPackageMap(e){return this._connection.send("GetPartFromPackageMap",e)}GetQueryFileMapping(e){return this._connection.send("GetQueryFileMapping",e)}ListPackage(e){return this._connection.send("ListPackage",e)}ListPackages(e){return this._connection.send("ListPackages",e)}Ping(e){return this._connection.send("Ping",e)}RemovePartFromPackageMap(e){return this._connection.send("RemovePartFromPackageMap",e)}ValidatePackage(e){return this._connection.send("ValidatePackage",e)}};var gs=class extends Ie{};var Te=class extends m{constructor(e){super(e,"WsResources","1.01")}Ping(e){return this._connection.send("Ping",e)}ServiceQuery(e){return this._connection.send("ServiceQuery",e)}WebLinksQuery(e){return this._connection.send("WebLinksQuery",e)}};var ds=class extends Te{};var ms;(e=>{let r;(n=>(n.ECL="ECL",n.DFU="DFU"))(r=e.WUTypes||={})})(ms||={});var Me=class extends m{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")}};var hs=class extends Me{};var fs;(t=>{let r;(u=>(u.ALL="ALL",u.READ="READ",u.WRITE="WRITE",u.HOLD="HOLD",u.SUB="SUB"))(r=t.LockModes||={});let e;(l=>(l.Attach="Attach",l.Detach="Detach",l.State="State",l.Reload="Reload",l.ReloadRetry="ReloadRetry",l.MemLock="MemLock",l.MemUnlock="MemUnlock",l.GetMemLocked="GetMemLocked"))(e=t.RoxieControlCmdType||={})})(fs||={});var Be=class extends m{constructor(e){super(e,"WsSMC","1.27")}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")}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")}};var oe=class extends Be{connectionOptions(){return this._connection.opts()}Activity(e){return super.Activity(e).then(t=>({Running:{ActiveWorkunit:[]},...t}))}};var ae=class extends m{constructor(e){super(e,"WsStore","1")}CreateStore(e){return this._connection.send("Fetch",e)}Delete(e){return this._connection.send("Delete",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Success:!0};throw t})}DeleteNamespace(e){return this._connection.send("DeleteNamespace",e)}Fetch(e){return this._connection.send("Fetch",e).catch(t=>{if(t.isESPExceptions&&t.Exception.some(s=>s.Code===-1))return{Exceptions:void 0,Value:void 0};throw t})}FetchAll(e){return this._connection.send("FetchAll",e)}FetchKeyMD(e){return this._connection.send("FetchKeyMD",e)}ListKeys(e){return this._connection.send("ListKeys",e)}ListNamespaces(e){return this._connection.send("ListNamespaces",e)}Set(e){return this._connection.send("Set",e)}};var Ds;(e=>{let r;(i=>(i.All="All",i.QueriesOnly="QueriesOnly",i.WorkunitsOnly="WorkunitsOnly"))(r=e.RoxieQueueFilter||={})})(Ds||={});var we=class extends m{constructor(e){super(e,"WsTopology","1.32")}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")}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")}};var y=class extends we{connectionOptions(){return this._connection.opts()}protocol(){return this._connection.opts().baseUrl.split("//")[0]}ip(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]}DefaultTpLogicalClusterQuery(e={}){return this.TpLogicalClusterQuery(e).then(t=>{if(t.default)return t.default;let s,n;return t.TpLogicalClusters.TpLogicalCluster.some((i,o)=>(o===0&&(n=i),i.Type==="hthor"?(s=i,!0):!1)),s||n})}};import{deepMixin as Wn,xml2json as yn}from"@hpcc-js/util";var E;(D=>{let r;(I=>(I.Abort="Abort",I.Delete="Delete",I.Deschedule="Deschedule",I.Reschedule="Reschedule",I.Pause="Pause",I.PauseNow="PauseNow",I.Protect="Protect",I.Unprotect="Unprotect",I.Restore="Restore",I.Resume="Resume",I.SetToFailed="SetToFailed",I.Archive="Archive"))(r=D.ECLWUActions||={});let e;(f=>(f[f.MIN=0]="MIN",f[f.DEFAULT=1]="DEFAULT",f[f.ALL=2]="ALL",f[f.CUSTOM=3]="CUSTOM"))(e=D.LogSelectColumnMode||={});let t;(d=>(d[d.ASC=0]="ASC",d[d.DSC=1]="DSC"))(t=D.SortDirection||={});let s;(A=>(A.ALL="ALL",A.DIS="DIS",A.ERR="ERR",A.WRN="WRN",A.INF="INF",A.PRO="PRO",A.MET="MET",A.EVT="EVT"))(s=D.LogEventClass||={});let n;(R=>(R.Single="Single",R.List="List",R.Multi="Multi"))(n=D.WUDetailsAttrValueType||={});let i;(R=>(R.SyntaxCheck="SyntaxCheck",R.Deploy="Deploy",R.Publish="Publish"))(i=D.EclDefinitionActions||={});let o;(R=>(R.xml="xml",R.json="json",R.text="text"))(o=D.ErrorMessageFormat||={});let a;(R=>(R[R.XML=0]="XML",R[R.JSON=1]="JSON",R[R.CSV=2]="CSV"))(a=D.LogAccessLogFormat||={});let u;(f=>(f.info="info",f.warning="warning",f.error="error",f.alert="alert"))(u=D.WUExceptionSeverity||={});let p;(J=>(J.Allqueries="All queries",J.Notsuspended="Not suspended",J.Suspended="Suspended",J.Suspendedbyuser="Suspended by user",J.Suspendedbyfirstnode="Suspended by first node",J.Suspendedbyanynode="Suspended by any node"))(p=D.WUQueryFilterSuspendedType||={});let c;(se=>(se.All="All",se.Id="Id",se.Name="Name",se.Alias="Alias",se.Status="Status"))(c=D.WUQuerySetFilterType||={});let l;(R=>(R.All="All",R.Protected="Protected",R.NotProtected="NotProtected"))(l=D.WUProtectFilter||={});let g;(rn=>rn.Deactivate="Deactivate")(g=D.QuerySetAliasActionTypes||={});let C;(d=>(d.None="None",d.ActivateImportedActive="ActivateImportedActive"))(C=D.QuerysetImportActivation||={});let T;(A=>(A.Suspend="Suspend",A.Unsuspend="Unsuspend",A.ToggleSuspend="ToggleSuspend",A.Activate="Activate",A.Delete="Delete",A.DeleteQueriesAndWUs="DeleteQueriesAndWUs",A.RemoveAllAliases="RemoveAllAliases",A.ResetQueryStats="ResetQueryStats"))(T=D.QuerySetQueryActionTypes||={});let ut;(f=>(f[f.DoNotActivateQuery=0]="DoNotActivateQuery",f[f.ActivateQuery=1]="ActivateQuery",f[f.ActivateQuerySuspendPrevious=2]="ActivateQuerySuspendPrevious",f[f.ActivateQueryDeletePrevious=3]="ActivateQueryDeletePrevious"))(ut=D.WUQueryActivationMode||={})})(E||={});var ce=class extends m{constructor(e){super(e,"WsWorkunits","2")}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")}};var ht=(d=>(d[d.Unknown=0]="Unknown",d[d.Compiled=1]="Compiled",d[d.Running=2]="Running",d[d.Completed=3]="Completed",d[d.Failed=4]="Failed",d[d.Archived=5]="Archived",d[d.Aborting=6]="Aborting",d[d.Aborted=7]="Aborted",d[d.Blocked=8]="Blocked",d[d.Submitted=9]="Submitted",d[d.Scheduled=10]="Scheduled",d[d.Compiling=11]="Compiling",d[d.Wait=12]="Wait",d[d.UploadingFiled=13]="UploadingFiled",d[d.DebugPaused=14]="DebugPaused",d[d.DebugRunning=15]="DebugRunning",d[d.Paused=16]="Paused",d[d.LAST=17]="LAST",d[d.NotFound=999]="NotFound",d))(ht||{}),V;(e=>{let r;(g=>(g[g.Unknown=0]="Unknown",g[g.Compile=1]="Compile",g[g.Check=2]="Check",g[g.Run=3]="Run",g[g.ExecuteExisting=4]="ExecuteExisting",g[g.Pause=5]="Pause",g[g.PauseNow=6]="PauseNow",g[g.Resume=7]="Resume",g[g.Debug=8]="Debug",g[g.__size=9]="__size"))(r=e.Action||={})})(V||={});function Ss(r){return typeof r.Name=="string"}function jo(r){return r.TotalClusterTime!==void 0}function Oo(r){return r.StateEx!==void 0}var W=class extends ce{constructor(e){super(e)}Ping(){return this._connection.send("Ping",{},"json",!1,void 0,"WsWorkunitsPingResponse").then(()=>({result:!0}))}WUQuery(e={},t){return this._connection.send("WUQuery",e,"json",!1,t).then(s=>Wn({Workunits:{ECLWorkunit:[]}},s))}WUInfo(e){let t={Wuid:"",TruncateEclTo64k:!0,IncludeExceptions:!1,IncludeGraphs:!1,IncludeSourceFiles:!1,IncludeResults:!1,IncludeResultsViewNames:!1,IncludeVariables:!1,IncludeTimers:!1,IncludeDebugValues:!1,IncludeApplicationValues:!1,IncludeWorkflows:!1,IncludeXmlSchemas:!1,IncludeResourceURLs:!1,IncludeECL:!1,IncludeHelpers:!1,IncludeAllowedClusters:!1,IncludeTotalClusterTime:!1,IncludeServiceNames:!1,SuppressResultSchemas:!0,...e};return super.WUInfo(t)}WUCreate(){return super.WUCreate({})}WUUpdate(e){return this._connection.send("WUUpdate",e,"json",!0)}WUResubmit(e){return this._connection.toESPStringArray(e,"Wuids"),super.WUResubmit(e)}WUAction(e){return e.ActionType=e.WUActionType,super.WUAction(e)}WUResult(e,t){return this._connection.send("WUResult",e,"json",!1,t)}WUFileEx(e){return this._connection.send("WUFile",e,"text")}_WUDetailsMetaPromise;WUDetailsMeta(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=super.WUDetailsMeta(e)),this._WUDetailsMetaPromise}WUCDebugEx(e){return this._connection.send("WUCDebug",e,void 0,void 0,void 0,"WUDebug").then(t=>{let n=yn(t.Result).children();return n.length?n[0]:null})}},Ne=class extends ce{WUPublishWorkunitEx(e){return this._connection.send("WUPublishWorkunit",e)}};import{debounce as Zn,StateObject as $n}from"@hpcc-js/util";import{Cache as Mn,deepMixinT as yt,scopedLogger as Bn,StateObject as wn,XMLNode as Ut}from"@hpcc-js/util";import{format as Nn}from"d3-format";import{utcFormat as Qn,utcParse as Ln}from"d3-time-format";import{Cache as Rs,Edge as Fs,Graph as bs,StateObject as Un,Subgraph as Ps,Vertex as Is}from"@hpcc-js/util";var Qe=class extends Un{wu;get properties(){return this.get()}get Name(){return this.get("Name")}get Label(){return this.get("Label")}get Type(){return this.get("Type")}get Complete(){return this.get("Complete")}get WhenStarted(){return this.get("WhenStarted")}get WhenFinished(){return this.get("WhenFinished")}get Time(){return this.get("Time")}get Running(){return this.get("Running")}get RunningId(){return this.get("RunningId")}get Failed(){return this.get("Failed")}constructor(e,t,s){super(),this.wu=e;let n=0;for(let i of s)if(i.GraphName===t.Name&&!i.HasSubGraphId){n=Math.round(i.Seconds*1e3)/1e3;break}this.set({Time:n,...t})}fetchScopeGraph(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(t=>ke(t)):this.wu.fetchGraphDetails([this.Name],["graph"]).then(t=>ke(t))}},Le=class extends Rs{constructor(){super(e=>Rs.hash([e.Name]))}};function Ts(r,e,t){t=t||[],t.push(r),e(r.name,r.$,r.children(),t),r.children().forEach(s=>{Ts(s,e,t)}),t.pop()}function ft(r){let e={};return r.forEach(t=>{t.name==="att"&&(e[t.$.name]=t.$.value)}),e}var Dt=class extends bs{},xs=class extends Ps{},As=class extends Is{},Ws=class extends Fs{};function Ms(r,e){let t={},s={},n={},i=new Dt(a=>a._.id),o=[i.root];return Ts(e,(a,u,p,c)=>{let l=o[o.length-1];switch(a){case"graph":break;case"node":if(p.length&&p[0].children().length&&p[0].children()[0].name==="graph"){let T=l.createSubgraph(ft(p));o.push(T),t[u.id]=T}let g=l.createVertex(ft(p));s[u.id]=g;break;case"edge":let C=l.createEdge(s[u.source],s[u.target],ft(p));n[u.id]=C;break;default:}}),i}var Ge=class extends bs{},ys=class extends Ps{},Us=class extends Is{},Es=class extends Fs{};function ke(r){let e={},t={},s={},n;for(let i of r)switch(i.ScopeType){case"graph":n=new Ge(c=>c._.Id,i),e[i.ScopeName]=n.root;break;case"subgraph":n||(n=new Ge(c=>c._.Id,i),e[i.ScopeName]=n.root);let o=i.parentScope().split(":"),a=e[i.parentScope()];for(;o.length&&!a;)a=e[o.join(":")],o.pop();if(!a)console.warn(`Missing SG:Parent (${i.Id}): ${i.parentScope()}`);else{let c=a;e[i.ScopeName]=c.createSubgraph(i)}break;case"activity":let u=e[i.parentScope()];u?s[i.ScopeName]=u.createVertex(i):console.warn(`Missing A:Parent (${i.Id}): ${i.parentScope()}`);break;case"edge":t[i.ScopeName]=i;break;case"function":let p=s[i.parentScope()];p?p._.children().push(i):console.warn(`Missing F:Parent (${i.Id}): ${i.parentScope()}`);break}for(let i in t){let o=t[i],a=e[o.parentScope()];if(!a)console.warn(`Missing E:Parent (${o.Id}): ${o.parentScope()}`);else{let u=a;try{let p=n.vertex(o.attr("IdSource").RawValue),c=n.vertex(o.attr("IdTarget").RawValue);u.createEdge(p,c,o)}catch{console.warn(`Invalid Edge: ${i}`)}}}return n}import{StateObject as En}from"@hpcc-js/util";var ve=class extends En{wu;get properties(){return this.get()}get URL(){return this.get("URL")}get DisplayName(){return this.get("DisplayName")}get DisplayPath(){return this.get("DisplayPath")}constructor(e,t){super(),this.wu=e;let s=t.split("\\").join("/"),n=s.split("/"),i="res/"+this.wu.Wuid+"/",o="",a="";s.indexOf(i)===0&&(o=s.substr(i.length),a=n[n.length-1]),this.set({URL:t,DisplayName:a,DisplayPath:o})}};import{Cache as xt,exists as Rt,StateObject as bn}from"@hpcc-js/util";import{SAXStackParser as Fn,Stack as Bs}from"@hpcc-js/util";var Ve=class{e;constructor(e){this.e=e}fix(){delete this.e}},_e=class extends Ve{name;type;isSet=!1;attrs={};_children=[];constructor(e){super(e)}append(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")}fix(){this.name=this.e.$.name,this.type=this.e.$.type;for(let t=this._children.length-1;t>=0;--t){let s=this._children[t];s.name==="Row"&&s.type===void 0&&(this._children.push(...s._children),this._children.splice(t,1))}let e=this.setOfType();e&&(this.type=e,this.isSet=!0,this._children=[])}children(){return this._children}isAll(e){return e.name==="All"&&e.type===void 0}setOfType(){let e=this.children();if(this.type===void 0&&e.length===2){if(this.isAll(e[0]))return e[1].type;if(this.isAll(e[1]))return e[0].type}}charWidth(){let e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":e=8;break;case"xs:nonNegativeInteger":e=8;break;case"xs:double":e=8;break;case"xs:string":e=32;break;default:let t="0123456789",s=this.type.lastIndexOf("_"),n=s>0?s:this.type.length,i=n-1;for(;i>=0&&t.indexOf(this.type.charAt(i))!==-1;--i);i+1<n&&(e=parseInt(this.type.substring(i+1,n),10)),this.type.indexOf("data")===0&&(e*=2);break}return e<this.name.length&&(e=this.name.length),e}},He=class extends Ve{name;type;maxLength;_restricition;_maxLength;constructor(e){super(e)}append(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e;break;default:}}fix(){this.name=this.e.$.name,this.type=this._restricition.$.base,this.maxLength=this._maxLength?+this._maxLength.$.value:void 0,delete this._restricition,delete this._maxLength,super.fix()}},je=class{root;simpleTypes={};fields(){return this.root.children()}},Oe=class extends Fn{schema=new je;simpleType;simpleTypes={};xsdStack=new Bs;startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xs:element":let t=new _e(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 He(e);break;default:break}}endXMLNode(e){switch(e.name){case"xs:element":this.xsdStack.pop().fix();break;case"xs:simpleType":this.simpleType.fix(),this.simpleTypes[this.simpleType.name]=this.simpleType,delete this.simpleType;break;case"xs:appinfo":let s=this.xsdStack.top();for(let n in e.$)s.attrs[n]=e.$[n];break;default:this.simpleType&&this.simpleType.append(e)}super.endXMLNode(e)}};function St(r){let e=new Oe;return e.parse(r),e.schema}var Ct=class extends Oe{_rootName;schema=new je;simpleTypes={};xsdStack=new Bs;constructor(e){super(),this._rootName=e}startXMLNode(e){switch(super.startXMLNode(e),e.name){case"xsd:element":let t=new _e(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 He(e);break;default:break}}endXMLNode(e){switch(e.name){case"xsd:element":this.xsdStack.pop().fix();break;case"xsd:simpleType":break;default:break}super.endXMLNode(e)}};function ta(r,e){let t=new Ct(e);return t.parse(r),t.schema}var At=class extends xt{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}-${e.ResultName}`)}},Ye=new At,Xe=class r extends bn{connection;get BaseUrl(){return this.connection.baseUrl}xsdSchema;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get ResultName(){return this.get("ResultName")}get ResultSequence(){return this.get("ResultSequence")}get LogicalFileName(){return this.get("LogicalFileName")}get Name(){return this.get("Name")}get Sequence(){return this.get("Sequence")}get Value(){return this.get("Value")}get Link(){return this.get("Link")}get FileName(){return this.get("FileName")}get IsSupplied(){return this.get("IsSupplied")}get ShowFileContent(){return this.get("ShowFileContent")}get Total(){return this.get("Total")}get ECLSchemas(){return this.get("ECLSchemas")}get NodeGroup(){return this.get("NodeGroup")}get ResultViews(){return this.get("ResultViews")}get XmlSchema(){return this.get("XmlSchema")}static attach(e,t,s,n){let i;return Array.isArray(n)?(i=Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s.Name},()=>new r(e,t,s,n)),i.set(s)):typeof n>"u"&&(typeof s=="number"?i=Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:"Sequence_"+s},()=>new r(e,t,s)):typeof s=="string"&&(i=Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new r(e,t,s)))),i}static attachLogicalFile(e,t,s){return Ye.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:s},()=>new r(e,t,s,!0))}constructor(e,t,s,n){super(),e instanceof W?this.connection=e:this.connection=new W(e),typeof n=="boolean"&&n===!0?this.set({NodeGroup:t,LogicalFileName:s}):Ss(s)&&Array.isArray(n)?this.set({...s,Wuid:t,ResultName:s.Name,ResultViews:n}):typeof n>"u"?typeof s=="number"?this.set({Wuid:t,ResultSequence:s}):typeof s=="string"?this.set({Wuid:t,ResultName:s}):console.warn("Unknown Result.attach (1)"):console.warn("Unknown Result.attach (2)")}isComplete(){return this.Total!==-1}_fetchXMLSchemaPromise;fetchXMLSchema(e=!1){return(!this._fetchXMLSchemaPromise||e)&&(this._fetchXMLSchemaPromise=this.WUResult().then(t=>t.Result?.XmlSchema?.xml?(this.xsdSchema=St(t.Result.XmlSchema.xml),this.xsdSchema):null)),this._fetchXMLSchemaPromise}async refresh(){return await this.fetchRows(0,1,!0),this}fetchRows(e=0,t=-1,s=!1,n={},i){return this.WUResult(e,t,!s,n,i).then(o=>{let a=o.Result;return delete o.Result,this.set({...o}),Rt("XmlSchema.xml",a)&&(this.xsdSchema=St(a.XmlSchema.xml)),Rt("Row",a)?a.Row:this.ResultName&&Rt(this.ResultName,a)?a[this.ResultName].Row:[]})}rootField(){return this.xsdSchema?this.xsdSchema.root:null}fields(){return this.xsdSchema?this.xsdSchema.root.children():[]}WUResult(e=0,t=1,s=!1,n={},i){let o={NamedValue:{itemcount:0}};for(let u in n)o.NamedValue[o.NamedValue.itemcount++]={Name:u,Value:n[u]};let a={FilterBy:o};return this.Wuid&&this.ResultName!==void 0?(a.Wuid=this.Wuid,a.ResultName=this.ResultName):this.Wuid&&this.ResultSequence!==void 0?(a.Wuid=this.Wuid,a.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(a.LogicalName=this.LogicalFileName,a.Cluster=this.NodeGroup):this.LogicalFileName&&(a.LogicalName=this.LogicalFileName),a.Start=e,a.Count=t,a.SuppressXmlSchema=s,this.connection.WUResult(a,i).then(u=>u)}},qe=class extends xt{constructor(){super(e=>xt.hash([e.Sequence,e.Name,e.Value,e.FileName]))}};import{StateObject as ws}from"@hpcc-js/util";var _=class extends ws{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)}},Wt=class extends ws{_attributeMap={};_children=[];get properties(){return this.get()}get ScopeName(){return this.get("ScopeName")}get Id(){return this.get("Id")}get ScopeType(){return this.get("ScopeType")}get Properties(){return this.get("Properties",{Property:[]})}get Notes(){return this.get("Notes",{Note:[]})}get SinkActivity(){return this.get("SinkActivity")}get CAttributes(){let e=[],t={start:null,end:null};return this.Properties.Property.forEach(s=>{s.Measure==="ts"&&s.Name.indexOf("Started")>=0?t.start=s:this.ScopeName&&s.Measure==="ts"&&s.Name.indexOf("Finished")>=0?t.end=s:e.push(new _(this,s))}),t.start&&t.end?(t.start.FormattedEnd=t.end.Formatted,e.push(new _(this,t.start))):t.start?e.push(new _(this,t.start)):t.end&&e.push(new _(this,t.end)),e}constructor(e){super(),this.update(e)}update(e){this.set(e),this.CAttributes.forEach(t=>{this._attributeMap[t.Name]=t}),this.Properties.Property=[];for(let t in this._attributeMap)this._attributeMap.hasOwnProperty(t)&&this.Properties.Property.push(this._attributeMap[t].properties)}parentScope(){let e=this.ScopeName.split(":");return e.pop(),e.join(":")}children(e){return arguments.length?(this._children=e,this):this._children}walk(e){if(e.start(this))return!0;for(let t of this.children())if(t.walk(e))return!0;return e.end(this)}formattedAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e}rawAttrs(){let e={};for(let t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e}hasAttr(e){return this._attributeMap[e]!==void 0}attr(e){return this._attributeMap[e]||new _(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})}attrMeasure(e){return this._attributeMap[e].Measure}calcTooltip(e){let t="",s=[];t=this.Id,s.push(`<tr><td class="key">ID:</td><td class="value">${this.Id}</td></tr>`),e&&s.push(`<tr><td class="key">Parent ID:</td><td class="value">${e.Id}</td></tr>`),s.push(`<tr><td class="key">Scope:</td><td class="value">${this.ScopeName}</td></tr>`);let n=this.formattedAttrs();for(let i in n)i==="Label"?t=n[i]:s.push(`<tr><td class="key">${i}</td><td class="value">${n[i]}</td></tr>`);return`<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">
|
|
911
911
|
<h4 align="center">${t}</h4>
|
|
912
912
|
<table>
|
|
913
913
|
${s.join("")}
|
|
914
914
|
</table>
|
|
915
|
-
</div>`}},ue=class extends Wt{wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as Pn}from"@hpcc-js/util";var Je=class extends Pn{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof W?this.connection=e:this.connection=new W(e),this.set({Wuid:t,...s})}};import{espTime2Seconds as In,StateObject as Tn}from"@hpcc-js/util";var ze=class extends Tn{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof W?this.connection=e:this.connection=new W(e);let n=In(s.Value);this.set({Wuid:t,Seconds:Math.round(n*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var Gn=Qn("%Y-%m-%dT%H:%M:%S.%LZ"),kn=Ln("%Y-%m-%dT%H:%M:%S.%LZ"),vn=Nn(",");function Vn(r){return r&&!isNaN(+r)?vn(+r):r}function Ns(r,e,t){r[e]===void 0||r[e][t]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete r[e][t]}var le="DefinitionList",_n=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Hn=["Avg","Min","Max","Delta","StdDev"],jn=["SkewMin","SkewMax","NodeMin","NodeMax"],On=/[A-Z][a-z]*/g;function Yn(r){for(let t of jn){let s=r.indexOf(t);if(s===0){let n="",i=r.slice(s+t.length);return{measure:n,ext:t,label:i}}}let e=r.match(On);if(e?.length){let t=e.shift(),s=e.join("");for(let n of Hn){let i=s.indexOf(n);if(i===0)return s=s.slice(i+n.length),{measure:t,ext:n,label:s}}return{measure:t,ext:"",label:s}}return{measure:"",ext:"",label:r}}var Qs={};function Xn(r){let e=Qs[r];return e||(e=Yn(r),Qs[r]=e),e}function B(r,e){return r.__formattedProps?.[e]??r[e]}function Ke(r){if(r===void 0)return;let e=parseFloat(r);return isNaN(e)?void 0:e}function qn(r,e,t){let s=Xn(e);if(!t[s.measure]){t[s.label]=!0;let n=Ke(r[`${s.measure}Avg${s.label}`]),i=Ke(r[`${s.measure}Min${s.label}`]),o=Ke(r[`${s.measure}Max${s.label}`]),a=Ke(r[`${s.measure}StdDev${s.label}`]),u=Math.max((n-i)/a,(o-n)/a);return{Key:`${s.measure}${s.label}`,Value:B(r,`${s.measure}${s.label}`),Avg:B(r,`${s.measure}Avg${s.label}`),Min:B(r,`${s.measure}Min${s.label}`),Max:B(r,`${s.measure}Max${s.label}`),Delta:B(r,`${s.measure}Delta${s.label}`),StdDev:B(r,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(u)?void 0:u,SkewMin:B(r,`SkewMin${s.label}`),SkewMax:B(r,`SkewMax${s.label}`),NodeMin:B(r,`NodeMin${s.label}`),NodeMax:B(r,`NodeMax${s.label}`)}}return null}var Ze=Bn("workunit.ts"),Et=class extends Mn{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},$e=new Et,K=class r extends wn{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",0)}get State(){return this.get("State")||ht[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 qe;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,()=>Xe.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new ze(this.connection,this.Wuid,e))}_graphCache=new Le;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 Qe(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 ve(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 Je(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){let t=new r(e);return t.connection.WUCreate().then(s=>($e.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let n=$e.get({BaseUrl:e.baseUrl,Wuid:t},()=>new r(e,t));return s&&n.set(s),n}static existsLocal(e,t){return $e.has({BaseUrl:e,Wuid:t})}static submit(e,t,s,n=!1){return r.create(e).then(i=>i.update({QueryText:s})).then(i=>n?i.submit(t,V.Action.Compile):i.submit(t))}static compile(e,t,s){return r.submit(e,t,s,!0)}static query(e,t){return new W(e).WUQuery(t).then(n=>n.Workunits.ECLWorkunit.map(function(i){return r.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new W(e),this.topologyConnection=new y(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:0})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(t=>(this.set(t.Workunit),this))}submit(e,t=V.Action.Run,s){let n;return e!==void 0?n=Promise.resolve(e):n=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===V.Action.Debug&&(t=V.Action.Run,this._debugMode=!0),n.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:s,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===V.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){switch(this.StateID){case 999:return!0;default:}return!1}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(E.ECLWUActions.SetToFailed)}pause(){return this.WUAction(E.ECLWUActions.Pause)}pauseNow(){return this.WUAction(E.ECLWUActions.PauseNow)}resume(){return this.WUAction(E.ECLWUActions.Resume)}abort(){return this.WUAction(E.ECLWUActions.Abort)}protect(){return this.WUAction(E.ECLWUActions.Protect)}unprotect(){return this.WUAction(E.ECLWUActions.Unprotect)}delete(){return this.WUAction(E.ECLWUActions.Delete)}restore(){return this.WUAction(E.ECLWUActions.Restore)}deschedule(){return this.WUAction(E.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(E.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=>r.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope)}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},n=[];for(let i of t){let o={},a={};if(i&&i.Id&&i.Properties&&i.Properties.Property)for(let c in i.Properties.Property){let l=i.Properties.Property[c];switch(l.Measure==="ns"&&(l.Measure="s"),s[l.Name]={...l},Ns(s,l.Name,"RawValue"),Ns(s,l.Name,"Formatted"),l.Measure){case"bool":o[l.Name]=!!+l.RawValue;break;case"sz":o[l.Name]=+l.RawValue;break;case"s":o[l.Name]=+l.RawValue/1e9;break;case"ns":o[l.Name]=+l.RawValue;break;case"ts":o[l.Name]=new Date(+l.RawValue/1e3).toISOString();break;case"cnt":o[l.Name]=+l.RawValue;break;case"cost":o[l.Name]=+l.RawValue/1e6;break;case"cpu":case"skw":case"node":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:o[l.Name]=l.RawValue}a[l.Name]=Vn(l.Formatted??o[l.Name])}let u={id:i.Id,name:i.ScopeName,type:i.ScopeType,Kind:i.Kind,Label:i.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...o};if(u[le])try{let c=JSON.parse(u[le].split("\\").join("\\\\"));u[le]=[],c.forEach((l,g)=>{let C=l.match(_n);if(C){let T=(C[1]??"")+C[2]+C[3],ut=parseInt(C[5]),D=parseInt(C[6]);u[le].push({filePath:T,line:ut,col:D})}})}catch{Ze.error(`Unexpected "DefinitionList": ${u[le]}`)}let p={};for(let c in u)if(c.indexOf("__")!==0){let l=qn(u,c,p);l&&(u.__groupedProps[l.Key]=l,!isNaN(l.StdDevs)&&u.__StdDevs<l.StdDevs&&(u.__StdDevs=l.StdDevs,u.__StdDevsSource=l.Key))}n.push(u)}return{meta:e,columns:s,data:n}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope.map(s=>new ue(this,s)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let s=[],n={};t.Scopes.Scope.forEach(i=>{if(n[i.ScopeName])return n[i.ScopeName].update(i),null;{let o=new ue(this,i);return n[o.ScopeName]=o,o}});for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],a=o.parentScope();a&&n[a]?n[a].children().push(o):s.push(o)}return s})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>ke(t))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let t={};e.forEach(n=>{t[n.ScopeName]=t[n.ScopeName]||{scope:n.ScopeName,start:null,elapsed:null,finish:null},n.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?t[n.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(t[n.ScopeName].start=i.Formatted)})});let s=[];for(let n in t){let i=t[n];if(i.start&&i.elapsed){let o=kn(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Gn(o),s.push(i)}}return s.sort((n,i)=>n.start<i.start?-1:n.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",n=>{this.isComplete()&&t([n])});break;case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(n=>n.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Ze.warning("Unexpected exception: "),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),$e.set(this),e))}WUInfo(e={}){let t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(s=>(this.set(s.Workunit),t&&this.set({ResultViews:s.ResultViews}),s)).catch(s=>{if(!s.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Ze.warning("Unexpected exception: "),s;return{}})}WUResubmit(e){return this.connection.WUResubmit(yt({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(yt({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(t=>yt({Scopes:{Scope:[]}},t))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:E.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new Ne({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(let n in t)t.hasOwnProperty(n)&&(s+=` ${n}='${t[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(n=>n)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(s=>{let n=s.children(e);return n.length?n[0]:new Ut(e)}).catch(s=>(Ze.error(s),Promise.resolve(new Ut(e)))):Promise.resolve(new Ut(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(t=>{if(t.name==="break")return t.$})}debugBreakpointAdd(e,t,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).then(n=>this.debugBreakpointResponseParser(n))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=Ms(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Kn(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(n=>n.children().map(i=>{let o={};return i.children().forEach(a=>{o[a.name]=a.content}),o}))}},Ft="definition";function Jn(r){return r._[Ft]!==void 0}function zn(r){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(r._[Ft]);if(e){let[,t,s,n]=e;return t.replace(/\/\.\//g,"/"),{id:r._.id,file:t,line:+s,column:+n}}throw new Error(`Bad definition: ${r._[Ft]}`)}function Kn(r,e){let t=[];for(let s of r.vertices)if(Jn(s)){let n=zn(s);(n&&!e||e===n.file)&&t.push(n)}return t.sort((s,n)=>s.line-n.line)}var et,Ls=class r extends $n{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 et||(et=new r(e)),t&&et.set(t),et}constructor(e){super(),e instanceof oe?this.connection=e:this.connection=new oe(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>K.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=Zn(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as er,scopedLogger as tr,StateObject as sr}from"@hpcc-js/util";var nr=tr("logicalFile.ts"),bt=class extends er{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},rr=new bt,Gs=class r extends sr{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 properties(){return this.get()}static attach(e,t,s,n){let i=rr.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new r(e,t,s));return n&&i.set(n),i}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let n={...t,...s};delete n.DFUFileParts,e.push(n)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw nr.warning("Unexpected exception: "),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};import{Cache as ir,StateObject as or}from"@hpcc-js/util";var Pt=class extends ir{constructor(){super(e=>e.Address)}},ar=new Pt,tt=class r extends or{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let n=ar.get({Address:t},()=>new r(e));return s&&n.set(s),n}constructor(e){super(),e instanceof N?this.connection=e:this.connection=new N(e)}};import{Cache as vs,StateObject as Dr,scopedLogger as Cr}from"@hpcc-js/util";import{format as Sr}from"d3-format";import{Cache as pr,exists as ks,StateObject as gr}from"@hpcc-js/util";import{Cache as cr,StateObject as ur}from"@hpcc-js/util";var Tt=class extends cr{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},lr=new Tt,Z=class r extends ur{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=>tt.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let n=lr.get({BaseUrl:e.baseUrl,Name:t},()=>new r(e,t));return s&&n.set(s),n}constructor(e,t){super(),e instanceof y?(this.connection=e,this.machineConnection=new N(e.connectionOptions())):(this.connection=new y(e),this.machineConnection=new N(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let s=[];for(let n of t.TargetClusterInfoList.TargetClusterInfo)for(let i of n.Processes.MachineInfoEx)s.push(i);return this.set("MachineInfoEx",s),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(let n of this.CMachineInfoEx)for(let i of n.Storage.StorageInfo){t+=i.Available,s+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function cc(r){let e;return r instanceof y?e=r:e=new y(r),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>Z.attach(r,s.Name,s)))}var It={};function uc(r){if(!It[r.baseUrl]){let e;r instanceof y?e=r:e=new y(r),It[r.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,n,i;t.TargetClusters.TpClusterNameType.forEach(a=>{s||(s=a),!n&&a.IsDefault===!0&&(n=a),!i&&a.Type==="hthor"&&(i=a)});let o=n||i||s;return Z.attach(r,o.Name,o)})}return It[r.baseUrl]}var Mt=class extends pr{constructor(){super(e=>e.BaseUrl)}},dr=new Mt,st=class r extends gr{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=>Z.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=dr.get({BaseUrl:e.baseUrl},()=>new r(e));return t&&s.set(t),s}constructor(e){super(),e instanceof y?this.connection=e:this.connection=new y(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),n=this.connection.ip(),i=s==="https:"?"18002":"8002";if(ks("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if(ks("TpBindings.TpBinding",o))for(let a of o.TpBindings.TpBinding)a.Service===e&&a.Protocol+":"===s&&(i=a.Port)}return`${s}//${n}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){if(this.isCallback(t))switch(e){case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}};function Q(r,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(r[e]=t)}function pe(r){return r=""+r,r.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function mr(r){if(r){if(!isNaN(+r))return parseFloat(r)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(r);if(!t)return 0;let s=+t[1]||0,n=+t[2]||0,i=+t[3]||0,o=+t[4]||0,a=+t[5]||0,u=+t[6]||0,p=+t[7]||0;return s*24*60*60+n*60*60+i*60+o+a/1e3+u/1e6+p/1e9}function L(r,e){let t=r.indexOf(e);return t!==-1?parseFloat(r.substring(0,t)):-1}function hr(r){if(r){if(!isNaN(+r))return parseFloat(r)}else return 0;let e=L(r,"Kb");return e>=0?e*1024:(e=L(r,"Mb"),e>=0?e*Math.pow(1024,2):(e=L(r,"Gb"),e>=0?e*Math.pow(1024,3):(e=L(r,"Tb"),e>=0?e*Math.pow(1024,4):(e=L(r,"Pb"),e>=0?e*Math.pow(1024,5):(e=L(r,"Eb"),e>=0?e*Math.pow(1024,6):(e=L(r,"Zb"),e>=0?e*Math.pow(1024,7):(e=L(r,"b"),e>=0?e:0)))))))}function fr(r){return r?parseFloat(r):0}var Bt=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,s,n){this.noSpills=n,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,s),this.calcOutVertexVisibility(i,s)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),s-1),this.calcOutVertexVisibility(i.getTarget(),s-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(s=>{this.calcInVertexVisibility(s.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(s=>{this.calcOutVertexVisibility(s.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((n,i)=>{this.calcSubgraphVisibility(n,t-1)}),e.__hpcc_subgraphs.forEach((n,i)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n}),e.__hpcc_vertices.forEach((n,i)=>{this.m_visibleVertices[n.__hpcc_id]=n});let s={};this.graph.edges.forEach((n,i)=>{n.getSource().__hpcc_parent!==n.getTarget().__hpcc_parent&&e===this.getCommonAncestor(n)&&(s[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]||(s[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[n.__hpcc_id]=n))})}buildVertexString(e,t){let s="",n="",i=e.getProperties();for(let o in i)t&&o.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':o==="id"||o==="label"?s+=" "+o+'="'+pe(i[o])+'"':n+='<att name="'+o+'" value="'+pe(i[o])+'"/>';return"<node"+s+">"+n+"</node>"}buildEdgeString(e){let t="",s="",n=e.getProperties();for(let i in n)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+pe(n[i])+'"':s+='<att name="'+i+'" value="'+pe(n[i])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){let s=[],n=[];this.getAncestors(e,s),this.getAncestors(t,n);let i=s.length-1,o=n.length-1,a=null;for(;i>=0&&o>=0&&s[i]===n[o];)a=s[i],--i,--o;return a}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((s,n)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((s,n)=>{this.m_visibleEdges[s.__hpcc_id]=s}),t.getOutEdges().forEach((s,n)=>{this.m_visibleEdges[s.__hpcc_id]=s}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getSource(),this.addSemiVisibleVertex(s);else break}let n=t.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getTarget(),this.addSemiVisibleVertex(n);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)s+='<att name="'+o+'" value="'+pe(i[o])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},ge=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf("__")!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},G=class extends ge{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType=t==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}},H=class extends ge{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(t=>{t.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},j=class extends ge{_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]}},nt=class r{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;let s=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(s.documentElement,"0")}isSubgraph(e){return e instanceof G}isVertex(e){return e instanceof H}isEdge(e){return e instanceof j}getGlobalType(e){return e instanceof H?3:e instanceof j?4:e instanceof G?2:e instanceof r?1:0}getGlobalTypeString(e){return e instanceof H?"Vertex":e instanceof j?"Edge":e instanceof G?"Cluster":e instanceof r?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let n=new G(this,t);this.subgraphs.push(n),this.idx[t]=n;break;case"node":let i=new H(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new j(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let s=this.idx[t];return Array.from(e.attributes).forEach(n=>{Q(s,n.name,n.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof G?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof H?this.vertices=this.vertices.filter(t=>e!==t):e instanceof j&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(n=>{if(n.tagName===t)return s=n,!0}),s}walkDocument(e,t){let s=this.getItem(e,t);return e.childNodes.forEach(n=>{switch(n.nodeType){case 1:switch(n.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(n,"att");if(o){let l=this.getChildByTagName(o,"graph");if(l){i=!0;let g=this.walkDocument(l,n.getAttribute("id"));s.addSubgraph(g)}}if(!i){let l=this.walkDocument(n,n.getAttribute("id"));s.addVertex(l)}break;case"att":let a=n.getAttribute("name"),u="_"+a,p=n.getAttribute("value");a.indexOf("Time")===0?(Q(s,u,p),Q(s,a,""+mr(p))):a.indexOf("Size")===0?(Q(s,u,p),Q(s,a,""+hr(p))):a.indexOf("Skew")===0?(Q(s,u,p),Q(s,a,""+fr(p))):Q(s,a,p);break;case"edge":let c=this.walkDocument(n,n.getAttribute("id"));if(c.NumRowsProcessed!==void 0?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):c.Count!==void 0?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):c.count!==void 0&&(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){if(!c._childGraph){if(c._sourceActivity||c._targetActivity){c._isSpill=!0;let l=c.getSource();l._isSpill=!0;let g=c.getTarget();g._isSpill=!0}}}s.addEdge(c);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof G&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,n){let i=new Bt(this);return i.calcVisibility(e,t,s,n),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var wt=Cr("@hpcc-js/comms/ecl/query.ts"),Rr=Sr("~s");function xr(r){return!isNaN(parseFloat(r))&&!isNaN(r-0)}var Nt=class extends vs{constructor(){super(e=>vs.hash([e.QueryId,e.QuerySet]))}},Ar=new Nt,Vs=class r extends Dr{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,n){super(),e instanceof W?this.wsWorkunitsService=e:this.wsWorkunitsService=new W(e),this.topology=st.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...n})}static attach(e,t,s,n){let i=Ar.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new r(e,t,s));return n&&i.set(n),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let s of t?.TpBindings?.TpBinding??[])if(s?.Service==="ws_ecl"){let n=`${s.Protocol}://${globalThis.location.hostname}:${s.Port}`;return new Ee({baseUrl:n})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(t){wt.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(t){wt.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(s=>{let n=new nt,i=!0;for(let o of s?.Graphs?.ECLGraphEx||[])i?(n.load(o.Graph),i=!1):n.merge(o.Graph);return n})}fetchDetailsNormalized(e={}){let t=K.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(s=>{let n=s[0],i=s[1],a=s[2].map(u=>{if(u.Id[0]==="a"||u.Id[0]==="e"){let p=n.idx[u.Id.substring(1)];for(let c in p)if(c.charAt(0)!=="_"&&c.charAt(0)===c.charAt(0).toUpperCase()&&(typeof p[c]=="string"||typeof p[c]=="number"||typeof p[c]=="boolean")&&!u.Properties.Property.some(l=>l.Name===c)){let g=xr(p[c])?parseFloat(p[c]):p[c],C=p[c];c.indexOf("Time")>=0&&(g=g/1e9,C=Rr(g)+"s"),u.Properties.Property.push({Name:c,RawValue:g,Formatted:C})}}return u});return t.normalizeDetails(i,a)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(s=>{for(let n in s)s[n]=s[n].Row;return s})??[]}catch(s){return wt.debug(s.message??s),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};import{Cache as Wr,Dispatch as yr,Message as Ur}from"@hpcc-js/util";var Qt=class extends Wr{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},Er=new Qt,O=class extends Ur{constructor(t,s,n){super();this.key=t;this.value=s;this.oldValue=n}get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},_s=class r{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new yr;static attach(e,t="HPCCApps",s,n=!0){return Er.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:n,Namespace:s},()=>new r(e,t,s,n))}constructor(e,t,s,n){e instanceof ae?this.connection=e:this.connection=new ae(e),this.Name=t,this.UserSpecific=n,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(n=>{let i=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new O(e,t,i))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let n=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new O(e,s.Value,n)),s.Value}).catch(s=>{console.error(`Store.get(${e}) failed:`,s)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let s={},n=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete n[i.Key],s[i.Key]=i.Value,e&&this._dispatch.post(new O(i.Key,i.Value,o))}),e)for(let i in n)this._dispatch.post(new O(i,void 0,n[i]));return s}).catch(t=>(console.error("Store.getAll failed:",t),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let n=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new O(e,void 0,n))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};import{Cache as Fr,scopedLogger as br,StateObject as Pr}from"@hpcc-js/util";var Ir=br("@hpcc-js/comms/dfuWorkunit.ts");var Lt=class extends Fr{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Hs=new Lt,js=class r extends Pr{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){let s=new r(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(n=>(Hs.set(s),s.set(n.result),s))}static attach(e,t,s){let n=Hs.get({BaseUrl:e.baseUrl,ID:t},()=>new r(e,t));return s&&n.set(s),n}static sprayFixed(e,t){let s=new v(e);return s.SprayFixedEx({...t}).then(n=>{let i=n.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>r.attach(e,i,o.result))})}static sprayVariable(e,t){let s=new v(e);return s.SprayVariableEx({...t}).then(n=>{let i=n.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>r.attach(e,i,o.result))})}static despray(e,t){let s=new v(e);return s.DesprayEx({...t}).then(n=>{let i=n.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>r.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(re.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(t=>t).catch(t=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===re.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",n=>{this.isComplete()&&t([n])});break;case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}constructor(e,t){super(),this.connection=new v(e),this.topologyConnection=new y(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(t=>(this.set(t.result),t)).catch(t=>{if(!t.Exception.some(n=>n.Code===20080||n.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw Ir.warning("Unexpected exception: "),t;return{}})}};import*as tn from"child_process";import*as U from"fs";import*as q from"os";import*as P from"path";import*as sn from"tmp";import{exists as vr,scopedLogger as Vr,xml2json as _r}from"@hpcc-js/util";import*as Y from"fs";import*as S from"path";import{Dictionary as Ys,DictionaryNoCase as Os,find as Tr,SAXStackParser as Mr,scopedLogger as Br,XMLNode as wr}from"@hpcc-js/util";var Nr=Br("clienttools/eclmeta"),Qr=!1;function $(r,e,t){if(Qr){for(let s in r){let n=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&Nr.debug(n)}r.$&&$(r.$,e+".$",t)}}var kt=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},vt=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,t){this.__attrs=t.$,this.definition=e,this.name=t.$.name,this.type=t.$.type}},ee=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,n,i=1,o=0,a=0,u=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=S.normalize(s),this.line=+i-1,this.start=+o,this.body=+a,this.end=+u,this.definitions=this.parseDefinitions(n)}parseDefinitions(e=[]){return e.map(t=>{let s=new Vt(this.sourcePath,t);return $(t,"definition",s),s})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let t=[];return this.contains(e)&&(t.push(this),this.definitions.forEach(s=>{t=s.scopeStackAt(e).concat(t)})),t}_resolve(e=[],t){let s=t.split("."),n=s.shift(),i=Tr(e,o=>typeof o.name=="string"&&typeof n=="string"&&o.name.toLowerCase()===n.toLowerCase());return i&&i.definitions.length&&s.length?this._resolve(i.definitions,s.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Vt=class extends ee{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,t){super(t.$.name,t.$.type,e,t.children("Definition"),t.$.line,t.$.start,t.$.body,t.$.end),this.__attrs=t.$,this.exported=!!t.$.exported,this.shared=!!t.$.shared,this.fullname=t.$.fullname,this.inherittype=t.$.inherittype,this.attrs=this.parseAttrs(t.children("Attr")),this.fields=this.parseFields(t.children("Field"))}parseAttrs(e=[]){return e.map(t=>{let s=new kt(t);return $(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new vt(this,t);return $(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},rt=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},_t=class extends ee{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let t=e.$.name.split(".");t.pop();let s=new wr("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new rt(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new rt(t);return $(t,"import",s),s})}resolve(e,t){let s;return!s&&t!==void 0&&this.scopeStackAt(t).some(i=>(s=i.resolve(e),!!s)),s||(s=super.resolve(e)),s}},Lr=r=>S.basename(r).indexOf(".")===0,Xs=r=>Y.lstatSync(r).isDirectory()&&!Lr(r),Gr=r=>[".ecl",".ecllib"].indexOf(S.extname(r).toLowerCase())>=0,qs=r=>Y.readdirSync(r).map(e=>S.join(r,e)).filter(e=>Xs(e)||Gr(e)),Ht=class extends ee{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},jt=class extends ee{constructor(e,t){super(e,"folder",t,[])}suggestions(){return qs(this.sourcePath).map(e=>({name:S.basename(e,".ecl"),type:"folder"}))}},Ot=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new Os;_sourceByPath=new Ys;_test=new Os;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return Js(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let t of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[t]&&Y.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){Y.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let n of qs(e))Xs(n)?this.visitFolder(n,t,s):this.visitFile(n,t,s)}visitFile(e,t,s=!1){let n=S.parse(e),i=S.join(n.dir,n.name),o=S.relative(t,i).split(S.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Ht("",e))}visitFolder(e,t,s=!1){let n=S.relative(t,e).split(S.sep).join(".");(s||!this._test.has(n))&&(this._test.set(n,new jt(n,e)),this.walkChildFolders(e,t,s))}buildStack(e,t,s){let n=t.split(".");s&&e[e.length-1]===n[0]&&n.shift();let i=[...e,...n],o=i.join(".");return{stack:i,qid:o}}walkECLScope(e,t){let s=this.buildStack(e,t.name,!0);this._test.set(s.qid,t);for(let n of t.definitions)this.walkDefinition(s.stack,n)}walkField(e,t){let s=this.buildStack(e,t.name,!1);this._test.set(s.qid,t)}walkDefinition(e,t){let s=this.buildStack(e,t.name,!0);this.walkECLScope(e,t);for(let n of t.fields)this.walkField(s.stack,n)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let t of e)if(t.$.name){let s=new _t(t);if($(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=S.dirname(o),--i;this.visitFolder(o,S.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new Yt;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>S.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let n;if(!n&&this._test.has(t)&&(n=this._test.get(t).scope),!n&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let u of i.imports)if(u.name.toLowerCase()===o[0].toLowerCase()){u.ref?o[0]=u.ref:o.shift();break}let a=o.join(".");!n&&this._test.has(a)&&(n=this._test.get(a).scope),n||(a=[...i.name.split("."),...o].join("."),this._test.has(a)&&(n=this._test.get(a).scope))}return n}resolvePartialID(e,t,s){t=t.toLowerCase();let n=t.split(".");n.pop();let i=n.length===1?n[0]:n.join(".");return this.resolveQualifiedID(e,i,s)}},Gt=new Ys;function X(r,e){let t=S.normalize(r);if(!Gt.has(t)){let s=new Ot(t,e);Gt.set(t,s),s.refresh()}return Gt.get(t)}function kr(r,e,t){if(e<0)return!1;let s=r.charAt(e);return(t?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(s)}function wu(r,e,t){for(;kr(r,e,t);)e+=t?-1:1;return e+(t?1:-1)}var Yt=class extends Mr{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var ct=Vr("clienttools/eclcc"),Xt=q.type()==="Windows_NT"?".exe":"";function zs(r){return r.split(`\r
|
|
915
|
+
</div>`}},ue=class extends Wt{wu;constructor(e,t){super(t),this.wu=e}};import{StateObject as Pn}from"@hpcc-js/util";var Je=class extends Pn{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get FileCluster(){return this.get("FileCluster")}get Name(){return this.get("Name")}get IsSuperFile(){return this.get("IsSuperFile")}get Subs(){return this.get("Subs")}get Count(){return this.get("Count")}get ECLSourceFiles(){return this.get("ECLSourceFiles")}constructor(e,t,s){super(),e instanceof W?this.connection=e:this.connection=new W(e),this.set({Wuid:t,...s})}};import{espTime2Seconds as In,StateObject as Tn}from"@hpcc-js/util";var ze=class extends Tn{connection;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Name(){return this.get("Name")}get Value(){return this.get("Value")}get Seconds(){return this.get("Seconds")}get GraphName(){return this.get("GraphName")}get SubGraphId(){return this.get("SubGraphId")}get HasSubGraphId(){return this.get("HasSubGraphId")}get count(){return this.get("count")}get Timestamp(){return this.get("Timestamp")}get When(){return this.get("When")}constructor(e,t,s){super(),e instanceof W?this.connection=e:this.connection=new W(e);let n=In(s.Value);this.set({Wuid:t,Seconds:Math.round(n*1e3)/1e3,HasSubGraphId:s.SubGraphId!==void 0,...s})}};var Gn=Qn("%Y-%m-%dT%H:%M:%S.%LZ"),kn=Ln("%Y-%m-%dT%H:%M:%S.%LZ"),vn=Nn(",");function Vn(r){return r&&!isNaN(+r)?vn(+r):r}function Ns(r,e,t){r[e]===void 0||r[e][t]===void 0||e==="__proto__"||e==="constructor"||e==="prototype"||delete r[e][t]}var le="DefinitionList",_n=/([a-zA-Z]:)?(.*[\\\/])(.*)(\((\d+),(\d+)\))/,Hn=["Avg","Min","Max","Delta","StdDev"],jn=["SkewMin","SkewMax","NodeMin","NodeMax"],On=/[A-Z][a-z]*/g;function Yn(r){for(let t of jn){let s=r.indexOf(t);if(s===0){let n="",i=r.slice(s+t.length);return{measure:n,ext:t,label:i}}}let e=r.match(On);if(e?.length){let t=e.shift(),s=e.join("");for(let n of Hn){let i=s.indexOf(n);if(i===0)return s=s.slice(i+n.length),{measure:t,ext:n,label:s}}return{measure:t,ext:"",label:s}}return{measure:"",ext:"",label:r}}var Qs={};function Xn(r){let e=Qs[r];return e||(e=Yn(r),Qs[r]=e),e}function B(r,e){return r.__formattedProps?.[e]??r[e]}function Ke(r){if(r===void 0)return;let e=parseFloat(r);return isNaN(e)?void 0:e}function qn(r,e,t){let s=Xn(e);if(!t[s.measure]){t[s.label]=!0;let n=Ke(r[`${s.measure}Avg${s.label}`]),i=Ke(r[`${s.measure}Min${s.label}`]),o=Ke(r[`${s.measure}Max${s.label}`]),a=Ke(r[`${s.measure}StdDev${s.label}`]),u=Math.max((n-i)/a,(o-n)/a);return{Key:`${s.measure}${s.label}`,Value:B(r,`${s.measure}${s.label}`),Avg:B(r,`${s.measure}Avg${s.label}`),Min:B(r,`${s.measure}Min${s.label}`),Max:B(r,`${s.measure}Max${s.label}`),Delta:B(r,`${s.measure}Delta${s.label}`),StdDev:B(r,`${s.measure}StdDev${s.label}`),StdDevs:isNaN(u)?void 0:u,SkewMin:B(r,`SkewMin${s.label}`),SkewMax:B(r,`SkewMax${s.label}`),NodeMin:B(r,`NodeMin${s.label}`),NodeMax:B(r,`NodeMax${s.label}`)}}return null}var Ze=Bn("workunit.ts"),Et=class extends Mn{constructor(){super(e=>`${e.BaseUrl}-${e.Wuid}`)}},$e=new Et,K=class r extends wn{connection;topologyConnection;get BaseUrl(){return this.connection.baseUrl}_debugMode=!1;_debugAllGraph;_submitAction;get properties(){return this.get()}get Wuid(){return this.get("Wuid")}get Owner(){return this.get("Owner","")}get Cluster(){return this.get("Cluster","")}get Jobname(){return this.get("Jobname","")}get Description(){return this.get("Description","")}get ActionEx(){return this.get("ActionEx","")}get StateID(){return this.get("StateID",0)}get State(){return this.get("State")||ht[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 qe;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,()=>Xe.attach(this.connection,this.Wuid,e,this.ResultViews.View)))}get SequenceResults(){let e={};return this.CResults.forEach(t=>{e[t.Sequence]=t}),e}get Timers(){return this.get("Timers",{ECLTimer:[]})}get CTimers(){return this.Timers.ECLTimer.map(e=>new ze(this.connection,this.Wuid,e))}_graphCache=new Le;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 Qe(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 ve(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 Je(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){let t=new r(e);return t.connection.WUCreate().then(s=>($e.set(t),t.set(s.Workunit),t))}static attach(e,t,s){let n=$e.get({BaseUrl:e.baseUrl,Wuid:t},()=>new r(e,t));return s&&n.set(s),n}static existsLocal(e,t){return $e.has({BaseUrl:e,Wuid:t})}static submit(e,t,s,n=!1){return r.create(e).then(i=>i.update({QueryText:s})).then(i=>n?i.submit(t,V.Action.Compile):i.submit(t))}static compile(e,t,s){return r.submit(e,t,s,!0)}static query(e,t){return new W(e).WUQuery(t).then(n=>n.Workunits.ECLWorkunit.map(function(i){return r.attach(e,i.Wuid,i)}))}constructor(e,t){super(),this.connection=new W(e),this.topologyConnection=new y(e),this.clearState(t)}clearState(e){this.clear({Wuid:e,StateID:0})}update(e){return this.connection.WUUpdate({...e,Wuid:this.Wuid,StateOrig:this.StateID,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster}).then(t=>(this.set(t.Workunit),this))}submit(e,t=V.Action.Run,s){let n;return e!==void 0?n=Promise.resolve(e):n=this.topologyConnection.DefaultTpLogicalClusterQuery().then(i=>i.Name),this._debugMode=!1,t===V.Action.Debug&&(t=V.Action.Run,this._debugMode=!0),n.then(i=>this.connection.WUUpdate({Wuid:this.Wuid,Action:t,ResultLimit:s,DebugValues:{DebugValue:[{Name:"Debug",Value:this._debugMode?"1":""}]}}).then(o=>(this.set(o.Workunit),this._submitAction=t,this.connection.WUSubmit({Wuid:this.Wuid,Cluster:i})))).then(()=>this)}isComplete(){switch(this.StateID){case 1:return this.ActionEx==="compile"||this._submitAction===V.Action.Compile;case 3:case 4:case 7:case 999:return!0;default:}return!1}isFailed(){switch(this.StateID){case 7:case 4:return!0;default:}return!1}isDeleted(){switch(this.StateID){case 999:return!0;default:}return!1}isDebugging(){switch(this.StateID){case 14:case 15:return!0;default:}return this._debugMode}isRunning(){switch(this.StateID){case 1:case 2:case 6:case 8:case 14:case 15:return!0;default:}return!1}setToFailed(){return this.WUAction(E.ECLWUActions.SetToFailed)}pause(){return this.WUAction(E.ECLWUActions.Pause)}pauseNow(){return this.WUAction(E.ECLWUActions.PauseNow)}resume(){return this.WUAction(E.ECLWUActions.Resume)}abort(){return this.WUAction(E.ECLWUActions.Abort)}protect(){return this.WUAction(E.ECLWUActions.Protect)}unprotect(){return this.WUAction(E.ECLWUActions.Unprotect)}delete(){return this.WUAction(E.ECLWUActions.Delete)}restore(){return this.WUAction(E.ECLWUActions.Restore)}deschedule(){return this.WUAction(E.ECLWUActions.Deschedule)}reschedule(){return this.WUAction(E.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=>r.attach(this.connection.opts(),e.WUs.WU[0].WUID).refresh())}async refreshState(){return await this.WUQuery(),this.StateID===1&&!this.ActionEx&&!this._submitAction&&await this.refreshInfo(),this}async refreshInfo(e){return await this.WUInfo(e),this}async refreshDebug(){return await this.debugStatus(),this}async refresh(e=!1,t){return e?await Promise.all([this.refreshInfo(t),this.refreshDebug()]):await this.refreshState(),this}eclExceptions(){return this.Exceptions.ECLException}fetchArchive(){return this.connection.WUFileEx({Wuid:this.Wuid,Type:"ArchiveQuery"})}fetchECLExceptions(){return this.WUInfo({IncludeExceptions:!0}).then(()=>this.eclExceptions())}fetchResults(){return this.WUInfo({IncludeResults:!0}).then(()=>this.CResults)}fetchGraphs(){return this.WUInfo({IncludeGraphs:!0}).then(()=>this.CGraphs)}fetchQuery(){return this.WUInfo({IncludeECL:!0,TruncateEclTo64k:!1}).then(()=>this.Query)}fetchHelpers(){return this.WUInfo({IncludeHelpers:!0}).then(()=>this.Helpers?.ECLHelpFile||[])}fetchAllowedClusters(){return this.WUInfo({IncludeAllowedClusters:!0}).then(()=>this.AllowedClusters?.AllowedCluster||[])}fetchTotalClusterTime(){return this.WUInfo({IncludeTotalClusterTime:!0}).then(()=>this.TotalClusterTime)}fetchServiceNames(){return this.WUInfo({IncludeServiceNames:!0}).then(()=>this.ServiceNames?.Item)}fetchDetailsMeta(e={}){return this.WUDetailsMeta(e)}fetchDetailsRaw(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope)}normalizeDetails(e,t){let s={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},n=[];for(let i of t){let o={},a={};if(i&&i.Id&&i.Properties&&i.Properties.Property)for(let c in i.Properties.Property){let l=i.Properties.Property[c];switch(l.Measure==="ns"&&(l.Measure="s"),s[l.Name]={...l},Ns(s,l.Name,"RawValue"),Ns(s,l.Name,"Formatted"),l.Measure){case"bool":o[l.Name]=!!+l.RawValue;break;case"sz":o[l.Name]=+l.RawValue;break;case"s":o[l.Name]=+l.RawValue/1e9;break;case"ns":o[l.Name]=+l.RawValue;break;case"ts":o[l.Name]=new Date(+l.RawValue/1e3).toISOString();break;case"cnt":o[l.Name]=+l.RawValue;break;case"cost":o[l.Name]=+l.RawValue/1e6;break;case"cpu":case"skw":case"node":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:o[l.Name]=l.RawValue}a[l.Name]=Vn(l.Formatted??o[l.Name])}let u={id:i.Id,name:i.ScopeName,type:i.ScopeType,Kind:i.Kind,Label:i.Label,__formattedProps:a,__groupedProps:{},__groupedRawProps:{},__StdDevs:0,__StdDevsSource:"",...o};if(u[le])try{let c=JSON.parse(u[le].split("\\").join("\\\\"));u[le]=[],c.forEach((l,g)=>{let C=l.match(_n);if(C){let T=(C[1]??"")+C[2]+C[3],ut=parseInt(C[5]),D=parseInt(C[6]);u[le].push({filePath:T,line:ut,col:D})}})}catch{Ze.error(`Unexpected "DefinitionList": ${u[le]}`)}let p={};for(let c in u)if(c.indexOf("__")!==0){let l=qn(u,c,p);l&&(u.__groupedProps[l.Key]=l,!isNaN(l.StdDevs)&&u.__StdDevs<l.StdDevs&&(u.__StdDevs=l.StdDevs,u.__StdDevsSource=l.Key))}n.push(u)}return{meta:e,columns:s,data:n}}fetchDetailsNormalized(e={}){return Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(t=>this.normalizeDetails(t[0],t[1]))}fetchInfo(e={}){return this.WUInfo(e)}fetchDetails(e={}){return this.WUDetails(e).then(t=>t.Scopes.Scope.map(s=>new ue(this,s)))}fetchDetailsHierarchy(e={}){return this.WUDetails(e).then(t=>{let s=[],n={};t.Scopes.Scope.forEach(i=>{if(n[i.ScopeName])return n[i.ScopeName].update(i),null;{let o=new ue(this,i);return n[o.ScopeName]=o,o}});for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],a=o.parentScope();a&&n[a]?n[a].children().push(o):s.push(o)}return s})}fetchGraphDetails(e=[],t){return this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge","function"]},PropertiesToReturn:{AllStatistics:!0,AllAttributes:!0,AllHints:!0,AllProperties:!0,AllScopes:!0},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}})}fetchScopeGraphs(e=[]){return this.fetchGraphDetails(e,["graph"]).then(t=>ke(t))}fetchTimeElapsed(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(e=>{let t={};e.forEach(n=>{t[n.ScopeName]=t[n.ScopeName]||{scope:n.ScopeName,start:null,elapsed:null,finish:null},n.CAttributes.forEach(i=>{i.Name==="TimeElapsed"?t[n.ScopeName].elapsed=+i.RawValue:i.Measure==="ts"&&i.Name.indexOf("Started")>=0&&(t[n.ScopeName].start=i.Formatted)})});let s=[];for(let n in t){let i=t[n];if(i.start&&i.elapsed){let o=kn(i.start);o.setMilliseconds(o.getMilliseconds()+i.elapsed/1e6),i.finish=Gn(o),s.push(i)}}return s.sort((n,i)=>n.start<i.start?-1:n.start>i.start?1:0),s})}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e}on(e,t,s){if(this.isCallback(t))switch(e){case"completed":super.on("propChanged","StateID",n=>{this.isComplete()&&t([n])});break;case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}WUQuery(e={}){return this.connection.WUQuery({...e,Wuid:this.Wuid}).then(t=>(this.set(t.Workunits.ECLWorkunit[0]),t)).catch(t=>{if(!t.Exception.some(n=>n.Code===20081?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Ze.warning("Unexpected exception: "),t;return{}})}WUCreate(){return this.connection.WUCreate().then(e=>(this.set(e.Workunit),$e.set(this),e))}WUInfo(e={}){let t=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo({...e,Wuid:this.Wuid,IncludeResults:t,IncludeResultsViewNames:t,SuppressResultSchemas:!1}).then(s=>(this.set(s.Workunit),t&&this.set({ResultViews:s.ResultViews}),s)).catch(s=>{if(!s.Exception.some(i=>i.Code===20080?(this.clearState(this.Wuid),this.set("StateID",999),!0):!1))throw Ze.warning("Unexpected exception: "),s;return{}})}WUResubmit(e){return this.connection.WUResubmit(yt({},e,{Wuids:{Item:[this.Wuid]}}))}WUDetailsMeta(e){return this.connection.WUDetailsMeta(e)}WUDetails(e){return this.connection.WUDetails(yt({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(t=>yt({Scopes:{Scope:[]}},t))}WUAction(e){return this.connection.WUAction({Wuids:{Item:[this.Wuid]},WUActionType:e}).then(t=>this.refresh().then(()=>(this._monitor(),t)))}publish(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:E.WUQueryActivationMode.ActivateQuery,Wait:5e3})}publishEx(e){let t=new Ne({baseUrl:""}),s={Wuid:this.Wuid,Cluster:this.Cluster,JobName:this.Jobname,AllowForeignFiles:!0,Activate:1,Wait:5e3,...e};return t.WUPublishWorkunitEx(s)}WUCDebug(e,t={}){let s="";for(let n in t)t.hasOwnProperty(n)&&(s+=` ${n}='${t[n]}'`);return this.connection.WUCDebugEx({Wuid:this.Wuid,Command:`<debug:${e} uid='${this.Wuid}'${s}/>`}).then(n=>n)}debug(e,t){return this.isDebugging()?this.WUCDebug(e,t).then(s=>{let n=s.children(e);return n.length?n[0]:new Ut(e)}).catch(s=>(Ze.error(s),Promise.resolve(new Ut(e)))):Promise.resolve(new Ut(e))}debugStatus(){return this.isDebugging()?this.debug("status").then(e=>{let t={...this.DebugState,...e.$};return this.set({DebugState:t}),e}):Promise.resolve({DebugState:{state:"unknown"}})}debugContinue(e=""){return this.debug("continue",{mode:e})}debugStep(e){return this.debug("step",{mode:e})}debugPause(){return this.debug("interrupt")}debugQuit(){return this.debug("quit")}debugDeleteAllBreakpoints(){return this.debug("delete",{idx:0})}debugBreakpointResponseParser(e){return e.children().map(t=>{if(t.name==="break")return t.$})}debugBreakpointAdd(e,t,s){return this.debug("breakpoint",{id:e,mode:t,action:s}).then(n=>this.debugBreakpointResponseParser(n))}debugBreakpointList(){return this.debug("list").then(e=>this.debugBreakpointResponseParser(e))}debugGraph(){return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(e=>(this.DebugState._prevGraphSequenceNum=this.DebugState.graphSequenceNum,this._debugAllGraph=Ms(this.Wuid,e),this._debugAllGraph))}debugBreakpointValid(e){return this.debugGraph().then(t=>Kn(t,e))}debugPrint(e,t=0,s=10){return this.debug("print",{edgeID:e,startRow:t,numRows:s}).then(n=>n.children().map(i=>{let o={};return i.children().forEach(a=>{o[a.name]=a.content}),o}))}},Ft="definition";function Jn(r){return r._[Ft]!==void 0}function zn(r){let e=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(r._[Ft]);if(e){let[,t,s,n]=e;return t.replace(/\/\.\//g,"/"),{id:r._.id,file:t,line:+s,column:+n}}throw new Error(`Bad definition: ${r._[Ft]}`)}function Kn(r,e){let t=[];for(let s of r.vertices)if(Jn(s)){let n=zn(s);(n&&!e||e===n.file)&&t.push(n)}return t.sort((s,n)=>s.line-n.line)}var et,Ls=class r extends $n{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 et||(et=new r(e)),t&&et.set(t),et}constructor(e){super(),e instanceof oe?this.connection=e:this.connection=new oe(e),this.clear({})}runningWorkunits(e=""){return this.Running.ActiveWorkunit.filter(t=>e===""||t.ClusterName===e).map(t=>K.attach(this.connection.connectionOptions(),t.Wuid,t))}setBanner(e){return this.connection.SetBanner({...e}).then(t=>(this.set(t),this))}lazyRefresh=Zn(async()=>{let e=await this.connection.Activity({});return this.set(e),this});async refresh(){return this.lazyRefresh()}};import{Cache as er,scopedLogger as tr,StateObject as sr}from"@hpcc-js/util";var nr=tr("logicalFile.ts"),bt=class extends er{constructor(){super(e=>`${e.BaseUrl}-${e.Cluster}-${e.Name}`)}},rr=new bt,Gs=class r extends sr{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 properties(){return this.get()}static attach(e,t,s,n){let i=rr.get({BaseUrl:e.baseUrl,Cluster:t,Name:s},()=>new r(e,t,s));return n&&i.set(n),i}constructor(e,t,s){super(),e instanceof ie?this.connection=e:this.connection=new ie(e),this.clear({Cluster:t,Name:s})}filePartsOnCluster(){return[...this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[]]}fileParts(){let e=[];for(let t of this.DFUFilePartsOnClusters?.DFUFilePartsOnCluster||[])for(let s of t?.DFUFileParts?.DFUPart||[]){let n={...t,...s};delete n.DFUFileParts,e.push(n)}return e}update(e){return this.connection.DFUInfo({...e,Cluster:this.Cluster,Name:this.Name}).then(t=>(this.set({Cluster:this.Cluster,...t.FileDetail}),t))}fetchInfo(){return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(e=>(this.set({Cluster:this.Cluster,...e.FileDetail}),e.FileDetail)).catch(e=>{if(!e.Exception.some(s=>s.Code===20038?(this.set("Name",this.Name+" (Deleted)"),this.set("StateID",999),!0):!1))throw nr.warning("Unexpected exception: "),e;return{}})}fetchDefFile(e){return this.connection.DFUFile({Name:this.Name,Format:e})}fetchListHistory(){return this.connection.ListHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}eraseHistory(){return this.connection.EraseHistory({Name:this.Name}).then(e=>e?.History?.Origin||[])}};import{Cache as ir,StateObject as or}from"@hpcc-js/util";var Pt=class extends ir{constructor(){super(e=>e.Address)}},ar=new Pt,tt=class r extends or{connection;get Address(){return this.get("Address")}get ConfigAddress(){return this.get("ConfigAddress")}get Name(){return this.get("Name")}get ProcessType(){return this.get("ProcessType")}get DisplayType(){return this.get("DisplayType")}get Description(){return this.get("Description")}get AgentVersion(){return this.get("AgentVersion")}get Contact(){return this.get("Contact")}get Location(){return this.get("Location")}get UpTime(){return this.get("UpTime")}get ComponentName(){return this.get("ComponentName")}get ComponentPath(){return this.get("ComponentPath")}get RoxieState(){return this.get("RoxieState")}get RoxieStateDetails(){return this.get("RoxieStateDetails")}get OS(){return this.get("OS")}get ProcessNumber(){return this.get("ProcessNumber")}get Channels(){return this.get("Channels")}get Processors(){return this.get("Processors")}get Storage(){return this.get("Storage")}get Running(){return this.get("Running")}get PhysicalMemory(){return this.get("PhysicalMemory")}get VirtualMemory(){return this.get("VirtualMemory")}get ComponentInfo(){return this.get("ComponentInfo")}get Exception(){return this.get("Exception")}static attach(e,t,s){let n=ar.get({Address:t},()=>new r(e));return s&&n.set(s),n}constructor(e){super(),e instanceof w?this.connection=e:this.connection=new w(e)}};import{Cache as vs,StateObject as Dr,scopedLogger as Cr}from"@hpcc-js/util";import{format as Sr}from"d3-format";import{Cache as pr,exists as ks,StateObject as gr}from"@hpcc-js/util";import{Cache as cr,StateObject as ur}from"@hpcc-js/util";var Tt=class extends cr{constructor(){super(e=>`${e.BaseUrl}-${e.Name}`)}},lr=new Tt,Z=class r extends ur{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=>tt.attach(this.machineConnection,e.Address,e))}static attach(e,t,s){let n=lr.get({BaseUrl:e.baseUrl,Name:t},()=>new r(e,t));return s&&n.set(s),n}constructor(e,t){super(),e instanceof y?(this.connection=e,this.machineConnection=new w(e.connectionOptions())):(this.connection=new y(e),this.machineConnection=new w(e)),this.clear({Name:t})}fetchMachines(e={}){return this.machineConnection.GetTargetClusterInfo({TargetClusters:{Item:[`${this.Type}:${this.Name}`]},...e}).then(t=>{let s=[];for(let n of t.TargetClusterInfoList.TargetClusterInfo)for(let i of n.Processes.MachineInfoEx)s.push(i);return this.set("MachineInfoEx",s),this.CMachineInfoEx})}machineStats(){let e=0,t=0,s=0;for(let n of this.CMachineInfoEx)for(let i of n.Storage.StorageInfo){t+=i.Available,s+=i.Total;let o=1-i.Available/i.Total;o>e&&(e=o)}return{maxDisk:e,meanDisk:1-(s?t/s:1)}}fetchUsage(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])}};function cc(r){let e;return r instanceof y?e=r:e=new y(r),e.TpListTargetClusters({}).then(t=>t.TargetClusters.TpClusterNameType.map(s=>Z.attach(r,s.Name,s)))}var It={};function uc(r){if(!It[r.baseUrl]){let e;r instanceof y?e=r:e=new y(r),It[r.baseUrl]=e.TpListTargetClusters({}).then(t=>{let s,n,i;t.TargetClusters.TpClusterNameType.forEach(a=>{s||(s=a),!n&&a.IsDefault===!0&&(n=a),!i&&a.Type==="hthor"&&(i=a)});let o=n||i||s;return Z.attach(r,o.Name,o)})}return It[r.baseUrl]}var Mt=class extends pr{constructor(){super(e=>e.BaseUrl)}},dr=new Mt,st=class r extends gr{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=>Z.attach(this.connection,e.Name,e))}get LogicalClusters(){return this.get("LogicalClusters")}get Services(){return this.get("Services")}static attach(e,t){let s=dr.get({BaseUrl:e.baseUrl},()=>new r(e));return t&&s.set(t),s}constructor(e){super(),e instanceof y?this.connection=e:this.connection=new y(e)}GetESPServiceBaseURL(e=""){return this.connection.TpServiceQuery({}).then(t=>{let s=this.connection.protocol(),n=this.connection.ip(),i=s==="https:"?"18002":"8002";if(ks("ServiceList.TpEspServers.TpEspServer",t)){for(let o of t.ServiceList.TpEspServers.TpEspServer)if(ks("TpBindings.TpBinding",o))for(let a of o.TpBindings.TpBinding)a.Service===e&&a.Protocol+":"===s&&(i=a.Port)}return`${s}//${n}:${i}/`})}fetchTargetClusters(){return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(e=>(this.set({TargetClusters:e.TpTargetClusters?.TpTargetCluster??[]}),this.CTargetClusters))}fetchLogicalClusters(e={}){return this.connection.TpLogicalClusterQuery(e).then(t=>(this.set({LogicalClusters:t.TpLogicalClusters.TpLogicalCluster}),this.LogicalClusters))}fetchServices(e={}){return this.connection.TpServiceQuery(e).then(t=>(this.set({Services:t.ServiceList}),this.Services))}_prevRefresh;refresh(e=!1){return(!this._prevRefresh||e)&&(this._prevRefresh=Promise.all([this.fetchTargetClusters(),this.fetchLogicalClusters(),this.fetchServices()]).then(()=>this)),this._prevRefresh}on(e,t,s){if(this.isCallback(t))switch(e){case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}};function N(r,e,t){e==="__proto__"||e==="constructor"||e==="prototype"||(r[e]=t)}function pe(r){return r=""+r,r.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g," ").replace(/\r/g," ")}function mr(r){if(r){if(!isNaN(+r))return parseFloat(r)}else return 0;let t=/(?:(?:(\d+).days.)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+\.\d+|\d+)s))|(?:(\d+\.\d+|\d+)ms|(\d+\.\d+|\d+)us|(\d+\.\d+|\d+)ns)/.exec(r);if(!t)return 0;let s=+t[1]||0,n=+t[2]||0,i=+t[3]||0,o=+t[4]||0,a=+t[5]||0,u=+t[6]||0,p=+t[7]||0;return s*24*60*60+n*60*60+i*60+o+a/1e3+u/1e6+p/1e9}function Q(r,e){let t=r.indexOf(e);return t!==-1?parseFloat(r.substring(0,t)):-1}function hr(r){if(r){if(!isNaN(+r))return parseFloat(r)}else return 0;let e=Q(r,"Kb");return e>=0?e*1024:(e=Q(r,"Mb"),e>=0?e*Math.pow(1024,2):(e=Q(r,"Gb"),e>=0?e*Math.pow(1024,3):(e=Q(r,"Tb"),e>=0?e*Math.pow(1024,4):(e=Q(r,"Pb"),e>=0?e*Math.pow(1024,5):(e=Q(r,"Eb"),e>=0?e*Math.pow(1024,6):(e=Q(r,"Zb"),e>=0?e*Math.pow(1024,7):(e=Q(r,"b"),e>=0?e:0)))))))}function fr(r){return r?parseFloat(r):0}var Bt=class{graph;m_xgmml;m_visibleSubgraphs;m_visibleVertices;m_semiVisibleVertices;m_visibleEdges;noSpills;constructor(e){this.graph=e,this.m_xgmml="",this.m_visibleSubgraphs={},this.m_visibleVertices={},this.m_semiVisibleVertices={},this.m_visibleEdges={}}calcVisibility(e,t,s,n){this.noSpills=n,e.forEach(i=>{this.graph.isVertex(i)?(this.calcInVertexVisibility(i,s),this.calcOutVertexVisibility(i,s)):this.graph.isEdge(i)?(this.calcInVertexVisibility(i.getSource(),s-1),this.calcOutVertexVisibility(i.getTarget(),s-1)):this.graph.isSubgraph(i)&&(this.m_visibleSubgraphs[i.__hpcc_id]=i,this.calcSubgraphVisibility(i,t-1))}),this.calcVisibility2()}calcInVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getInEdges().forEach(s=>{this.calcInVertexVisibility(s.getSource(),t-1)})}calcOutVertexVisibility(e,t){this.noSpills&&e.isSpill()&&t++,this.m_visibleVertices[e.__hpcc_id]=e,t>0&&e.getOutEdges().forEach(s=>{this.calcOutVertexVisibility(s.getTarget(),t-1)})}calcSubgraphVisibility(e,t){if(t<0)return;t>0&&e.__hpcc_subgraphs.forEach((n,i)=>{this.calcSubgraphVisibility(n,t-1)}),e.__hpcc_subgraphs.forEach((n,i)=>{this.m_visibleSubgraphs[n.__hpcc_id]=n}),e.__hpcc_vertices.forEach((n,i)=>{this.m_visibleVertices[n.__hpcc_id]=n});let s={};this.graph.edges.forEach((n,i)=>{n.getSource().__hpcc_parent!==n.getTarget().__hpcc_parent&&e===this.getCommonAncestor(n)&&(s[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]||(s[n.getSource().__hpcc_parent.__hpcc_id+"::"+n.getTarget().__hpcc_parent.__hpcc_id]=!0,this.m_visibleEdges[n.__hpcc_id]=n))})}buildVertexString(e,t){let s="",n="",i=e.getProperties();for(let o in i)t&&o.indexOf("_kind")>=0?n+='<att name="_kind" value="point"/>':o==="id"||o==="label"?s+=" "+o+'="'+pe(i[o])+'"':n+='<att name="'+o+'" value="'+pe(i[o])+'"/>';return"<node"+s+">"+n+"</node>"}buildEdgeString(e){let t="",s="",n=e.getProperties();for(let i in n)i.toLowerCase()==="id"||i.toLowerCase()==="label"||i.toLowerCase()==="source"||i.toLowerCase()==="target"?t+=" "+i+'="'+pe(n[i])+'"':s+='<att name="'+i+'" value="'+pe(n[i])+'"/>';return"<edge"+t+">"+s+"</edge>"}getAncestors(e,t){let s=e.__hpcc_parent;for(;s;)t.push(s),s=s.__hpcc_parent}getCommonAncestorV(e,t){let s=[],n=[];this.getAncestors(e,s),this.getAncestors(t,n);let i=s.length-1,o=n.length-1,a=null;for(;i>=0&&o>=0&&s[i]===n[o];)a=s[i],--i,--o;return a}getCommonAncestor(e){return this.getCommonAncestorV(e.getSource(),e.getTarget())}calcAncestorVisibility(e){let t=[];this.getAncestors(e,t),t.forEach((s,n)=>{this.m_visibleSubgraphs[s.__hpcc_id]=s})}calcVisibility2(){for(let e in this.m_visibleVertices){let t=this.m_visibleVertices[e];t.getInEdges().forEach((s,n)=>{this.m_visibleEdges[s.__hpcc_id]=s}),t.getOutEdges().forEach((s,n)=>{this.m_visibleEdges[s.__hpcc_id]=s}),this.calcAncestorVisibility(t)}this.calcSemiVisibleVertices()}addSemiVisibleEdge(e){e&&!this.m_visibleEdges[e.__hpcc_id]&&(this.m_visibleEdges[e.__hpcc_id]=e)}addSemiVisibleVertex(e){this.m_visibleVertices[e.__hpcc_id]||(this.m_semiVisibleVertices[e.__hpcc_id]=e,this.calcAncestorVisibility(e))}calcSemiVisibleVertices(){for(let e in this.m_visibleEdges){let t=this.m_visibleEdges[e],s=t.getSource();for(this.addSemiVisibleVertex(s);this.noSpills&&s.isSpill();){let i=s.getInEdges();if(i.length)this.addSemiVisibleEdge(i[0]),s=i[0].getSource(),this.addSemiVisibleVertex(s);else break}let n=t.getTarget();for(this.addSemiVisibleVertex(n);this.noSpills&&n.isSpill();){let i=n.getOutEdges();if(i.length)this.addSemiVisibleEdge(i[0]),n=i[0].getTarget(),this.addSemiVisibleVertex(n);else break}}}writeXgmml(){this.subgraphVisited(this.graph.subgraphs[0],!0),this.graph.edges.forEach((e,t)=>{this.edgeVisited(e)})}subgraphVisited(e,t=!1){if(this.m_visibleSubgraphs[e.__hpcc_id]){let s="";this.m_xgmml+=t?"":'<node id="'+e.__hpcc_id+'"><att><graph>';let n=this.m_xgmml.length;if(e.walkSubgraphs(this),e.walkVertices(this),n===this.m_xgmml.length){let o=e.__hpcc_vertices[0];o&&(this.m_xgmml+=this.buildVertexString(o,!0))}let i=e.getProperties();for(let o in i)s+='<att name="'+o+'" value="'+pe(i[o])+'"/>';this.m_xgmml+=t?"":"</graph></att>"+s+"</node>"}return!1}vertexVisited(e){this.m_visibleVertices[e.__hpcc_id]?this.m_xgmml+=this.buildVertexString(e,!1):this.m_semiVisibleVertices[e.__hpcc_id]&&(this.m_xgmml+=this.buildVertexString(e,!0))}edgeVisited(e){this.m_visibleEdges[e.__hpcc_id]&&(this.m_xgmml+=this.buildEdgeString(e))}},ge=class{__hpcc_graph;__hpcc_parent;__widget;__hpcc_id;_globalID;constructor(e,t){this.__hpcc_graph=e,this.__hpcc_id=t,this._globalID=t}getProperties(){let e={};for(let t in this)t.indexOf("__")!==0&&this.hasOwnProperty(t)&&(e[t]=this[t]);return e}},L=class extends ge{_globalType;__hpcc_subgraphs;__hpcc_vertices;__hpcc_edges;id;constructor(e,t){super(e,t),this._globalType=t==="0"?"Graph":"Cluster",this.__hpcc_subgraphs=[],this.__hpcc_vertices=[],this.__hpcc_edges=[],this.id=t}addSubgraph(e){e.__hpcc_parent=this,this.__hpcc_subgraphs.some(t=>e===t)||this.__hpcc_subgraphs.push(e)}addVertex(e){e.__hpcc_parent=this,this.__hpcc_vertices.some(t=>e===t)||this.__hpcc_vertices.push(e)}removeVertex(e){this.__hpcc_vertices=this.__hpcc_vertices.filter(t=>e!==t)}addEdge(e){e.__hpcc_parent=this,this.__hpcc_edges.some(t=>e===t)||this.__hpcc_edges.push(e)}removeEdge(e){this.__hpcc_edges=this.__hpcc_edges.filter(t=>e!==t)}remove(){this.__hpcc_subgraphs.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_vertices.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),this.__hpcc_edges.forEach(e=>e.__hpcc_parent=this.__hpcc_parent),delete this.__hpcc_parent,this.__hpcc_graph.removeItem(this)}walkSubgraphs(e){this.__hpcc_subgraphs.forEach((t,s)=>{e.subgraphVisited(t)&&t.walkSubgraphs(e)})}walkVertices(e){this.__hpcc_vertices.forEach((t,s)=>{e.vertexVisited(t)})}},H=class extends ge{_globalType="Vertex";_isSpill;constructor(e,t){super(e,t)}isSpill(){return this._isSpill}remove(){let e=this.getInVertices();e.length<=1&&console.warn(this.__hpcc_id+": remove only supports single or zero inputs activities..."),this.getInEdges().forEach(t=>{t.remove()}),this.getOutEdges().forEach(t=>{t.setSource(e[0])}),this.__hpcc_parent?.removeVertex(this),this.__hpcc_graph.removeItem(this)}getInVertices(){return this.getInEdges().map(e=>e.getSource())}getInEdges(){return this.__hpcc_graph.edges.filter(e=>e.getTarget()===this)}getOutVertices(){return this.getOutEdges().map(e=>e.getTarget())}getOutEdges(){return this.__hpcc_graph.edges.filter(e=>e.getSource()===this)}},j=class extends ge{_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]}},nt=class r{idx={};subgraphs=[];vertices=[];edges=[];xgmml="";constructor(){this.clear()}clear(){this.xgmml="",this.idx={},this.subgraphs=[],this.vertices=[],this.edges=[]}load(e){this.clear(),this.merge(e)}merge(e){this.xgmml=e;let s=new DOMParser().parseFromString(e,"text/xml");this.walkDocument(s.documentElement,"0")}isSubgraph(e){return e instanceof L}isVertex(e){return e instanceof H}isEdge(e){return e instanceof j}getGlobalType(e){return e instanceof H?3:e instanceof j?4:e instanceof L?2:e instanceof r?1:0}getGlobalTypeString(e){return e instanceof H?"Vertex":e instanceof j?"Edge":e instanceof L?"Cluster":e instanceof r?"Graph":"Unknown"}getItem(e,t){if(!this.idx[t])switch(e.tagName){case"graph":let n=new L(this,t);this.subgraphs.push(n),this.idx[t]=n;break;case"node":let i=new H(this,t);this.vertices.push(i),this.idx[t]=i;break;case"edge":let o=new j(this,t);this.edges.push(o),this.idx[t]=o;break;default:console.warn("Graph.getItem - Unknown Node Type!");break}let s=this.idx[t];return Array.from(e.attributes).forEach(n=>{N(s,n.name,n.value)}),s}removeItem(e){delete this.idx[e.__hpcc_id],e instanceof L?this.subgraphs=this.subgraphs.filter(t=>e!==t):e instanceof H?this.vertices=this.vertices.filter(t=>e!==t):e instanceof j&&(this.edges=this.edges.filter(t=>e!==t))}getChildByTagName(e,t){let s=null;return Array.from(e.childNodes).some(n=>{if(n.tagName===t)return s=n,!0}),s}walkDocument(e,t){let s=this.getItem(e,t);return e.childNodes.forEach(n=>{switch(n.nodeType){case 1:switch(n.tagName){case"graph":break;case"node":let i=!1,o=this.getChildByTagName(n,"att");if(o){let l=this.getChildByTagName(o,"graph");if(l){i=!0;let g=this.walkDocument(l,n.getAttribute("id"));s.addSubgraph(g)}}if(!i){let l=this.walkDocument(n,n.getAttribute("id"));s.addVertex(l)}break;case"att":let a=n.getAttribute("name"),u="_"+a,p=n.getAttribute("value");a.indexOf("Time")===0?(N(s,u,p),N(s,a,""+mr(p))):a.indexOf("Size")===0?(N(s,u,p),N(s,a,""+hr(p))):a.indexOf("Skew")===0?(N(s,u,p),N(s,a,""+fr(p))):N(s,a,p);break;case"edge":let c=this.walkDocument(n,n.getAttribute("id"));if(c.NumRowsProcessed!==void 0?c._eclwatchCount=c.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g,","):c.Count!==void 0?c._eclwatchCount=c.Count.replace(/\B(?=(\d{3})+(?!\d))/g,","):c.count!==void 0&&(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){if(!c._childGraph){if(c._sourceActivity||c._targetActivity){c._isSpill=!0;let l=c.getSource();l._isSpill=!0;let g=c.getTarget();g._isSpill=!0}}}s.addEdge(c);break;default:break}break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break;default:break}}),s}removeSubgraphs(){[...this.subgraphs].forEach(t=>{t.__hpcc_parent instanceof L&&t.remove()})}removeSpillVertices(){[...this.vertices].forEach(t=>{t.isSpill()&&t.remove()})}getLocalisedXGMML(e,t,s,n){let i=new Bt(this);return i.calcVisibility(e,t,s,n),i.writeXgmml(),"<graph>"+i.m_xgmml+"</graph>"}};var wt=Cr("@hpcc-js/comms/ecl/query.ts"),Rr=Sr("~s");function xr(r){return!isNaN(parseFloat(r))&&!isNaN(r-0)}var Nt=class extends vs{constructor(){super(e=>vs.hash([e.QueryId,e.QuerySet]))}},Ar=new Nt,Vs=class r extends Dr{wsWorkunitsService;get BaseUrl(){return this.wsWorkunitsService.baseUrl}topology;_requestSchema;_responseSchema;get properties(){return this.get()}get Exceptions(){return this.get("Exceptions")}get QueryId(){return this.get("QueryId")}get QuerySet(){return this.get("QuerySet")}get QueryName(){return this.get("QueryName")}get Wuid(){return this.get("Wuid")}get Dll(){return this.get("Dll")}get Suspended(){return this.get("Suspended")}get Activated(){return this.get("Activated")}get SuspendedBy(){return this.get("SuspendedBy")}get Clusters(){return this.get("Clusters")}get PublishedBy(){return this.get("PublishedBy")}get Comment(){return this.get("Comment")}get LogicalFiles(){return this.get("LogicalFiles")}get SuperFiles(){return this.get("SuperFiles")}get IsLibrary(){return this.get("IsLibrary")}get Priority(){return this.get("Priority")}get WUSnapShot(){return this.get("WUSnapShot")}get CompileTime(){return this.get("CompileTime")}get LibrariesUsed(){return this.get("LibrariesUsed")}get CountGraphs(){return this.get("CountGraphs")}get ResourceURLCount(){return this.get("ResourceURLCount")}get WsEclAddresses(){return this.get("WsEclAddresses")}get WUGraphs(){return this.get("WUGraphs")}get WUTimers(){return this.get("WUTimers")}get PriorityID(){return this.get("PriorityID")}constructor(e,t,s,n){super(),e instanceof W?this.wsWorkunitsService=e:this.wsWorkunitsService=new W(e),this.topology=st.attach(this.wsWorkunitsService.opts()),this.set({QuerySet:t,QueryId:s,...n})}static attach(e,t,s,n){let i=Ar.get({BaseUrl:e.baseUrl,QuerySet:t,QueryId:s},()=>new r(e,t,s));return n&&i.set(n),i}_eclService;async wsEclService(){return this._eclService||(this._eclService=this.topology.fetchServices({}).then(e=>{for(let t of e?.TpEspServers?.TpEspServer??[])for(let s of t?.TpBindings?.TpBinding??[])if(s?.Service==="ws_ecl"){let n=`${s.Protocol}://${globalThis.location.hostname}:${s.Port}`;return new Ee({baseUrl:n})}})),this._eclService}async fetchDetails(){let e=await this.wsWorkunitsService.WUQueryDetails({QuerySet:this.QuerySet,QueryId:this.QueryId,IncludeStateOnClusters:!0,IncludeSuperFiles:!0,IncludeWsEclAddresses:!0,CheckAllNodes:!1});this.set({...e})}async fetchRequestSchema(){let e=await this.wsEclService();try{this._requestSchema=await e?.requestJson(this.QuerySet,this.QueryId)??[]}catch(t){wt.debug(t.message??t),this._requestSchema=[]}}async fetchResponseSchema(){let e=await this.wsEclService();try{this._responseSchema=await e?.responseJson(this.QuerySet,this.QueryId)??{}}catch(t){wt.debug(t.message??t),this._responseSchema={}}}async fetchSchema(){await Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])}fetchSummaryStats(){return this.wsWorkunitsService.WUQueryGetSummaryStats({Target:this.QuerySet,QueryId:this.QueryId})}fetchGraph(e="",t=""){return this.wsWorkunitsService.WUQueryGetGraph({Target:this.QuerySet,QueryId:this.QueryId,GraphName:e,SubGraphId:t}).then(s=>{let n=new nt,i=!0;for(let o of s?.Graphs?.ECLGraphEx||[])i?(n.load(o.Graph),i=!1):n.merge(o.Graph);return n})}fetchDetailsNormalized(e={}){let t=K.attach(this.wsWorkunitsService,this.Wuid);return t?Promise.all([this.fetchGraph(),t.fetchDetailsMeta(),t.fetchDetailsRaw(e)]).then(s=>{let n=s[0],i=s[1],a=s[2].map(u=>{if(u.Id[0]==="a"||u.Id[0]==="e"){let p=n.idx[u.Id.substring(1)];for(let c in p)if(c.charAt(0)!=="_"&&c.charAt(0)===c.charAt(0).toUpperCase()&&(typeof p[c]=="string"||typeof p[c]=="number"||typeof p[c]=="boolean")&&!u.Properties.Property.some(l=>l.Name===c)){let g=xr(p[c])?parseFloat(p[c]):p[c],C=p[c];c.indexOf("Time")>=0&&(g=g/1e9,C=Rr(g)+"s"),u.Properties.Property.push({Name:c,RawValue:g,Formatted:C})}}return u});return t.normalizeDetails(i,a)}):Promise.resolve({meta:void 0,columns:void 0,data:void 0})}async submit(e){let t=await this.wsEclService();try{return t?.submit(this.QuerySet,this.QueryId,e).then(s=>{for(let n in s)s[n]=s[n].Row;return s})??[]}catch(s){return wt.debug(s.message??s),[]}}async refresh(){return await Promise.all([this.fetchDetails(),this.fetchSchema()]),this}requestFields(){return this._requestSchema?this._requestSchema:[]}responseFields(){return this._responseSchema?this._responseSchema:{}}resultNames(){let e=[];for(let t in this.responseFields())e.push(t);return e}resultFields(e){return this._responseSchema[e]?this._responseSchema[e]:[]}};import{Cache as Wr,Dispatch as yr,Message as Ur}from"@hpcc-js/util";var Qt=class extends Wr{constructor(){super(e=>`${e.BaseUrl}-${e.Name}:${e.UserSpecific}-${e.Namespace}`)}},Er=new Qt,O=class extends Ur{constructor(t,s,n){super();this.key=t;this.value=s;this.oldValue=n}get canConflate(){return!0}conflate(t){return this.key===t.key?(this.value=t.value,!0):!1}void(){return this.value===this.oldValue}},_s=class r{connection;get BaseUrl(){return this.connection.baseUrl}Name;UserSpecific;Namespace;_dispatch=new yr;static attach(e,t="HPCCApps",s,n=!0){return Er.get({BaseUrl:e.baseUrl,Name:t,UserSpecific:n,Namespace:s},()=>new r(e,t,s,n))}constructor(e,t,s,n){e instanceof ae?this.connection=e:this.connection=new ae(e),this.Name=t,this.UserSpecific=n,this.Namespace=s}_knownValues={};create(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})}set(e,t,s=!0){return this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(n=>{let i=this._knownValues[e];this._knownValues[e]=t,s&&this._dispatch.post(new O(e,t,i))}).catch(n=>{console.error(`Store.set("${e}", "${t}") failed:`,n)})}get(e,t=!0){return this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let n=this._knownValues[e];return this._knownValues[e]=s.Value,t&&this._dispatch.post(new O(e,s.Value,n)),s.Value}).catch(s=>{console.error(`Store.get(${e}) failed:`,s)})}getAll(e=!0){return this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(t=>{let s={},n=this._knownValues;if(this._knownValues={},t.Pairs.Pair.forEach(i=>{let o=this._knownValues[i.Key];this._knownValues[i.Key]=i.Value,delete n[i.Key],s[i.Key]=i.Value,e&&this._dispatch.post(new O(i.Key,i.Value,o))}),e)for(let i in n)this._dispatch.post(new O(i,void 0,n[i]));return s}).catch(t=>(console.error("Store.getAll failed:",t),{}))}delete(e,t=!0){return this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(s=>{let n=this._knownValues[e];delete this._knownValues[e],t&&this._dispatch.post(new O(e,void 0,n))}).catch(s=>{console.error(`Store.delete(${e}) failed:`,s)})}monitor(e){return this._dispatch.attach(e)}};import{Cache as Fr,scopedLogger as br,StateObject as Pr}from"@hpcc-js/util";var Ir=br("@hpcc-js/comms/dfuWorkunit.ts");var Lt=class extends Fr{constructor(){super(e=>`${e.BaseUrl}-${e.ID}`)}},Hs=new Lt,js=class r extends Pr{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){let s=new r(e);return s.connection.CreateDFUWorkunit({DFUServerQueue:t}).then(n=>(Hs.set(s),s.set(n.result),s))}static attach(e,t,s){let n=Hs.get({BaseUrl:e.baseUrl,ID:t},()=>new r(e,t));return s&&n.set(s),n}static sprayFixed(e,t){let s=new v(e);return s.SprayFixedEx({...t}).then(n=>{let i=n.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>r.attach(e,i,o.result))})}static sprayVariable(e,t){let s=new v(e);return s.SprayVariableEx({...t}).then(n=>{let i=n.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>r.attach(e,i,o.result))})}static despray(e,t){let s=new v(e);return s.DesprayEx({...t}).then(n=>{let i=n.wuid;return s.GetDFUWorkunit({wuid:i}).then(o=>r.attach(e,i,o.result))})}update(e){return this.connection.UpdateDFUWorkunitEx({wu:{JobName:e?.wu?.JobName??this.JobName,isProtected:e?.wu?.isProtected??this.isProtected,ID:this.ID,State:this.State},ClusterOrig:this.ClusterName,JobNameOrig:this.JobName,isProtectedOrig:this.isProtected,StateOrig:this.State})}isComplete(){switch(this.State){case 6:case 5:case 4:case 999:return!0;default:}return!1}isFailed(){return!!(this.isComplete()&&this.State!==6)}isDeleted(){switch(this.State){case 999:return!0;default:}return!1}isRunning(){return!this.isComplete()}abort(){return this.connection.AbortDFUWorkunit({wuid:this.ID})}delete(){return this.DFUWUAction(re.DFUWUActions.Delete).then(e=>this.refresh().then(()=>(this._monitor(),e)))}async refresh(e=!1){return await this.GetDFUWorkunit(),this}fetchXML(e){return this.DFUWUFile()}_monitor(){if(this.isComplete()){this._monitorTickCount=0;return}super._monitor()}_monitorTimeoutDuration(){let e=super._monitorTimeoutDuration();return this._monitorTickCount<=1?3e3:this._monitorTickCount<=5?6e3:this._monitorTickCount<=7?12e3:e}DFUWUFile(e={}){return this.connection.DFUWUFileEx({...e,Wuid:this.ID}).then(t=>t).catch(t=>"")}DFUWUAction(e){return this.connection.DFUWorkunitsAction({wuids:{Item:[this.ID]},Type:e}).then(t=>e===re.DFUWUActions.Delete?t:this.refresh().then(()=>(this._monitor(),t)))}on(e,t,s){if(this.isCallback(t))switch(e){case"finished":super.on("propChanged","State",n=>{this.isComplete()&&t([n])});break;case"changed":super.on(e,t);break;default:}else switch(e){case"changed":super.on(e,t,s);break;default:}return this._monitor(),this}watchUntilComplete(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),this.isComplete()&&(n.release(),t(this))})})}watchUntilRunning(e){return new Promise((t,s)=>{let n=this.watch(i=>{e&&e(i),(this.isComplete()||this.isRunning())&&(n.release(),t(this))})})}constructor(e,t){super(),this.connection=new v(e),this.topologyConnection=new y(e),this.clearState(t)}clearState(e){this.clear({ID:e,State:0})}GetDFUWorkunit(e={}){return this.connection.GetDFUWorkunit({...e,wuid:this.ID}).then(t=>(this.set(t.result),t)).catch(t=>{if(!t.Exception.some(n=>n.Code===20080||n.Code===20081?(this.clearState(this.ID),this.set("State",999),!0):!1))throw Ir.warning("Unexpected exception: "),t;return{}})}};import*as tn from"child_process";import*as U from"fs";import*as q from"os";import*as P from"path";import*as sn from"tmp";import{exists as vr,scopedLogger as Vr,xml2json as _r}from"@hpcc-js/util";import*as Y from"fs";import*as S from"path";import{Dictionary as Ys,DictionaryNoCase as Os,find as Tr,SAXStackParser as Mr,scopedLogger as Br,XMLNode as wr}from"@hpcc-js/util";var Nr=Br("clienttools/eclmeta"),Qr=!1;function $(r,e,t){if(Qr){for(let s in r){let n=`${e}.${s}`;s!=="$"&&t[s]===void 0&&t[s.toLowerCase()+"s"]===void 0&&Nr.debug(n)}r.$&&$(r.$,e+".$",t)}}var kt=class{__attrs;name;constructor(e){this.__attrs=e.$,this.name=e.$.name}},vt=class{__attrs;definition;get scope(){return this.definition}name;type;constructor(e,t){this.__attrs=t.$,this.definition=e,this.name=t.$.name,this.type=t.$.type}},ee=class{get scope(){return this}name;type;sourcePath;line;start;body;end;definitions;constructor(e,t,s,n,i=1,o=0,a=0,u=Number.MAX_VALUE){this.name=e,this.type=t,this.sourcePath=S.normalize(s),this.line=+i-1,this.start=+o,this.body=+a,this.end=+u,this.definitions=this.parseDefinitions(n)}parseDefinitions(e=[]){return e.map(t=>{let s=new Vt(this.sourcePath,t);return $(t,"definition",s),s})}contains(e){return e>=this.start&&e<=this.end}scopeStackAt(e){let t=[];return this.contains(e)&&(t.push(this),this.definitions.forEach(s=>{t=s.scopeStackAt(e).concat(t)})),t}_resolve(e=[],t){let s=t.split("."),n=s.shift(),i=Tr(e,o=>typeof o.name=="string"&&typeof n=="string"&&o.name.toLowerCase()===n.toLowerCase());return i&&i.definitions.length&&s.length?this._resolve(i.definitions,s.join(".")):i}resolve(e){return this._resolve(this.definitions,e)}suggestions(){return this.definitions.map(e=>({name:e.name,type:this.type}))}},Vt=class extends ee{__attrs;exported;shared;fullname;inherittype;attrs;fields;constructor(e,t){super(t.$.name,t.$.type,e,t.children("Definition"),t.$.line,t.$.start,t.$.body,t.$.end),this.__attrs=t.$,this.exported=!!t.$.exported,this.shared=!!t.$.shared,this.fullname=t.$.fullname,this.inherittype=t.$.inherittype,this.attrs=this.parseAttrs(t.children("Attr")),this.fields=this.parseFields(t.children("Field"))}parseAttrs(e=[]){return e.map(t=>{let s=new kt(t);return $(t,"attr",s),s})}parseFields(e=[]){return e.map(t=>{let s=new vt(this,t);return $(t,"field",s),s})}suggestions(){return super.suggestions().concat(this.fields.map(e=>({name:e.name,type:e.type})))}},rt=class{__attrs;name;ref;start;end;line;constructor(e){this.__attrs=e.$,this.name=e.$.name,this.ref=e.$.ref,this.start=e.$.start,this.end=e.$.end,this.line=e.$.line}},_t=class extends ee{imports;__attrs;constructor(e){super(e.$.name,"source",e.$.sourcePath,e.children("Definition")),this.__attrs=e.$;let t=e.$.name.split(".");t.pop();let s=new wr("");s.appendAttribute("name","$"),s.appendAttribute("ref",t.join(".")),this.imports=[new rt(s),...this.parseImports(e.children("Import"))]}parseImports(e=[]){return e.map(t=>{let s=new rt(t);return $(t,"import",s),s})}resolve(e,t){let s;return!s&&t!==void 0&&this.scopeStackAt(t).some(i=>(s=i.resolve(e),!!s)),s||(s=super.resolve(e)),s}},Lr=r=>S.basename(r).indexOf(".")===0,Xs=r=>Y.lstatSync(r).isDirectory()&&!Lr(r),Gr=r=>[".ecl",".ecllib"].indexOf(S.extname(r).toLowerCase())>=0,qs=r=>Y.readdirSync(r).map(e=>S.join(r,e)).filter(e=>Xs(e)||Gr(e)),Ht=class extends ee{constructor(e,t){super(e,"file",t,[])}suggestions(){return[]}},jt=class extends ee{constructor(e,t){super(e,"folder",t,[])}suggestions(){return qs(this.sourcePath).map(e=>({name:S.basename(e,".ecl"),type:"folder"}))}},Ot=class{_workspacePath;_eclccPath;_clientTools;_sourceByID=new Os;_sourceByPath=new Ys;_test=new Os;constructor(e,t){this._workspacePath=e,this._eclccPath=t}refresh(){this.primeWorkspace(),this.primeClientTools()}primeClientTools(){return Js(this._eclccPath,"",this._workspacePath).then(e=>(this._clientTools=e,e.paths())).then(e=>{for(let t of["ECLCC_ECLLIBRARY_PATH","ECLCC_PLUGIN_PATH"])e[t]&&Y.existsSync(e[t])&&this.walkChildFolders(e[t],e[t]);return this})}primeWorkspace(){Y.existsSync(this._workspacePath)&&this.visitFolder(this._workspacePath,this._workspacePath)}walkChildFolders(e,t,s=!1){for(let n of qs(e))Xs(n)?this.visitFolder(n,t,s):this.visitFile(n,t,s)}visitFile(e,t,s=!1){let n=S.parse(e),i=S.join(n.dir,n.name),o=S.relative(t,i).split(S.sep).join(".");(s||!this._test.has(o))&&this._test.set(o,new Ht("",e))}visitFolder(e,t,s=!1){let n=S.relative(t,e).split(S.sep).join(".");(s||!this._test.has(n))&&(this._test.set(n,new jt(n,e)),this.walkChildFolders(e,t,s))}buildStack(e,t,s){let n=t.split(".");s&&e[e.length-1]===n[0]&&n.shift();let i=[...e,...n],o=i.join(".");return{stack:i,qid:o}}walkECLScope(e,t){let s=this.buildStack(e,t.name,!0);this._test.set(s.qid,t);for(let n of t.definitions)this.walkDefinition(s.stack,n)}walkField(e,t){let s=this.buildStack(e,t.name,!1);this._test.set(s.qid,t)}walkDefinition(e,t){let s=this.buildStack(e,t.name,!0);this.walkECLScope(e,t);for(let n of t.fields)this.walkField(s.stack,n)}walkSource(e){this.walkECLScope([],e)}parseSources(e=[]){for(let t of e)if(t.$.name){let s=new _t(t);if($(t,"source",s),this._sourceByID.set(s.name,s),this._sourceByPath.set(s.sourcePath,s),s.name){let i=s.name.split(".").length;if(i>1){let o=s.sourcePath;for(;i>1;)o=S.dirname(o),--i;this.visitFolder(o,S.dirname(o))}}this.walkSource(s)}}parseMetaXML(e){let t=new Yt;return t.parse(e),this.parseSources(t.sources),t.sources.map(s=>S.normalize(s.$.sourcePath))}resolveQualifiedID(e,t,s){let n;if(!n&&this._test.has(t)&&(n=this._test.get(t).scope),!n&&this._sourceByPath.has(e)){let i=this._sourceByPath.get(e),o=t.split(".");for(let u of i.imports)if(u.name.toLowerCase()===o[0].toLowerCase()){u.ref?o[0]=u.ref:o.shift();break}let a=o.join(".");!n&&this._test.has(a)&&(n=this._test.get(a).scope),n||(a=[...i.name.split("."),...o].join("."),this._test.has(a)&&(n=this._test.get(a).scope))}return n}resolvePartialID(e,t,s){t=t.toLowerCase();let n=t.split(".");n.pop();let i=n.length===1?n[0]:n.join(".");return this.resolveQualifiedID(e,i,s)}},Gt=new Ys;function X(r,e){let t=S.normalize(r);if(!Gt.has(t)){let s=new Ot(t,e);Gt.set(t,s),s.refresh()}return Gt.get(t)}function kr(r,e,t){if(e<0)return!1;let s=r.charAt(e);return(t?/[a-zA-Z\d_\.$]/:/[a-zA-Z\d_]/).test(s)}function wu(r,e,t){for(;kr(r,e,t);)e+=t?-1:1;return e+(t?1:-1)}var Yt=class extends Mr{sources=[];endXMLNode(e){switch(e.name){case"Source":this.sources.push(e);break;default:break}super.endXMLNode(e)}};var ct=Vr("clienttools/eclcc"),Xt=q.type()==="Windows_NT"?".exe":"";function zs(r){return r.split(`\r
|
|
916
916
|
`).join(`
|
|
917
917
|
`).split("\r").join(`
|
|
918
918
|
`)}var me=class{prefix="";major=0;minor=0;patch=0;postfix="";constructor(e){let t=e.split(" ");if(t.length){let s=/(?:(\w+)_)?(\d+)\.(\d+)\.(\d+)(?:-(.*))?/.exec(t[t.length-1]);s&&(this.prefix=s[1]||"",this.major=+s[2]||0,this.minor=+s[3]||0,this.patch=+s[4]||0,this.postfix=s[5]||"")}}parse(e){}exists(){return this.major!==0||this.minor!==0||this.patch!==0||this.postfix!==""}compare(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch?-1:this.postfix===""&&e.postfix!==""?1:this.postfix.localeCompare(e.postfix)}toString(){return`${this.prefix}_${this.major}.${this.minor}.${this.patch}-${this.postfix}`}},Ks="error",Zs="warning",ot=class{_checked;errWarn=[];errOther=[];constructor(e){this._checked=e}checked(){return this._checked}all(){return this.errWarn}errors(){return this.errWarn.filter(e=>e.severity===Ks)}hasError(){return this.errors().length>0}warnings(){return this.errWarn.filter(e=>e.severity===Zs)}hasWarning(){return this.warnings().length>0}info(){return this.errWarn.filter(e=>[Ks,Zs].indexOf(e.severity)<0)}hasOther(){return this.info().length>0}unknown(){return this.errOther}hasUnknown(){return this.unknown().length>0}},at=class extends ot{constructor(e,t){if(super(t),e&&e.length)for(let s of e.split(q.EOL)){let n=/([a-zA-Z]:\\(?:[- \w\.\d]+\\)*(?:[- \w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\) ?: ?(error|warning|info) C(\d*) ?: ?(.*)/.exec(s);if(n){let[,i,o,a,u,p,c]=n,l=+o,g=+a,C=p+": "+c;this.errWarn.push({filePath:i,line:l,col:g,msg:C,severity:u});continue}if(n=/(error|warning|info): (.*)/i.exec(s),n){let[,i,o]=n;this.errWarn.push({filePath:"",line:0,col:0,msg:o,severity:i});continue}n=/\d error(s?), \d warning(s?)/.exec(s),!n&&(ct.warning(`parseECLErrors: Unable to parse "${s}"`),this.errOther.push(s))}this._checked=t}},qt=class extends ot{_lines;constructor(e,t,s){super(s);let n=U.readFileSync(e,"utf8");if(n=n.replace(/\r\n/g,`
|
|
@@ -922,5 +922,5 @@ Sw==
|
|
|
922
922
|
`)).then(i=>{let o={};i.forEach(a=>{let u=a.split(":");o[u.shift().trim()]=u.join(":").trim()}),s[n]={name:n,props:o}}))).then(()=>s)})]).then(([t,s])=>{t.forEach(n=>{s[n.name]&&(n.props=s[n.name].props,delete s[n.name])});for(let n in s)t.push({name:n,url:"",description:"",props:s[n].props});return t}).catch(t=>[])}bundleInstall(e){return Promise.all([X(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["install",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}bundleUninstall(e){return Promise.all([X(this.cwd),this.execFile(this.eclBundlePath,this.cwd,this.args(["uninstall",e]),"ecl-bundle",`Cannot find ${this.eclBundlePath}`)]).then(([t,s])=>s)}execFile(e,t,s,n,i){return new Promise((o,a)=>{ct.debug(`${e} ${s.join(" ")}`);let u=tn.spawn(e,s,{cwd:t}),p="",c="";u.stdout.on("data",l=>{p+=l.toString()}),u.stderr.on("data",l=>{c+=l.toString()}),u.on("close",(l,g)=>{o({code:l,stdout:p.trim(),stderr:c.trim()})})})}};function it(r,e){if(r){let t=P.join(r,"HPCCSystems");if(U.existsSync(t)&&U.statSync(t).isDirectory()){if(q.type()!=="Windows_NT"){let s=P.join(t,"bin","eclcc");U.existsSync(s)&&e.push(new he(s))}U.readdirSync(t).forEach(s=>{let n=P.join(t,s,"clienttools","bin","eclcc"+Xt);if(U.existsSync(n)){let i=P.basename(s);new me(i).exists()&&e.push(new he(n))}})}}}var de;function vu(){de=void 0}function Hr(){if(de)return de;let r=[];switch(q.type()){case"Windows_NT":let e=process.env["ProgramFiles(x86)"]||"";e&&it(e,r);let t=process.env.ProgramFiles||"";t&&it(t,r),!e&&!t&&it("c:\\Program Files (x86)",r);break;case"Linux":case"Darwin":it("/opt",r);break;default:break}return de=Promise.all(r.map(e=>e.version())).then(()=>(r.sort((e,t)=>t.versionSync().compare(e.versionSync())),r)),de}var $s="";function en(r){let e=`Using eclccPath setting: ${r}`;$s!==e&&(ct.info(e),$s=e)}function Js(r="",e="",t=".",s=[],n=!1,i=[]){return r&&U.existsSync(r)?(en(r),Promise.resolve(new he(r,t,s,n,i))):Hr().then(o=>{if(!o.length)throw new Error("Unable to locate ECL Client Tools.");let a=new me(e),u,p;for(let l of o){let g=l.versionSync();if(g.exists()&&(u||(u=l),!p&&a.major===g.major&&(p=l),a.major===g.major&&a.minor===g.minor))return l.clone(t,s,n,i)}let c=p||u;return en(c.eclccPath),c.clone(t,s,n,i)})}b.DOMParser=jr;typeof b.fetch>"u"?(b.fetch=Or,b.Headers=Yr,b.Request=Xr,b.Response=qr,b.fetch.__rejectUnauthorizedAgent=new F.Agent({rejectUnauthorized:!1})):(b.fetch.__defaultAgent=new nn,b.fetch.__rejectUnauthorizedAgent=new nn({connect:{rejectUnauthorized:!1}}),b.fetch.__setGlobalDispatcher=Jr);typeof b.AbortController>"u"&&(b.AbortController=zr);var te="";F.globalAgent.options.ca!==void 0&&(Array.isArray(F.globalAgent.options.ca)&&F.globalAgent.options.ca.length?typeof F.globalAgent.options.ca[0]=="string"?te=F.globalAgent.options.ca.join(`
|
|
923
923
|
`):F.globalAgent.options.ca[0]instanceof Kt&&(te=F.globalAgent.options.ca.map(r=>r.toString()).join(`
|
|
924
924
|
`)):typeof F.globalAgent.options.ca=="string"?te=F.globalAgent.options.ca:F.globalAgent.options.ca instanceof Kt&&(te=F.globalAgent.options.ca.toString()),te+=`
|
|
925
|
-
`);b.fetch.__trustwaveAgent=new F.Agent({ca:te+Zt});typeof b.btoa>"u"&&(b.btoa=function(r){return Kt.from(r||"","utf8").toString("base64")});export{ss as AccessService,ns as AccountService,Ls as Activity,kt as Attr,_ as Attribute,ei as BUILD_VERSION,Wt as BaseScope,he as ClientTools,rs as CloudService,is as CodesignService,pt as Connection,Hi as DFUArrayActions,Oi as DFUChangeProtection,Yi as DFUChangeRestriction,ji as DFUDefFileFormat,ie as DFUService,js as DFUWorkunit,Lt as DFUWorkunitCache,as as DFUXRefService,os as DaliService,Vt as Definition,Qe as ECLGraph,ee as ECLScope,ne as ESPConnection,
|
|
925
|
+
`);b.fetch.__trustwaveAgent=new F.Agent({ca:te+Zt});typeof b.btoa>"u"&&(b.btoa=function(r){return Kt.from(r||"","utf8").toString("base64")});export{ss as AccessService,ns as AccountService,Ls as Activity,kt as Attr,_ as Attribute,ei as BUILD_VERSION,Wt as BaseScope,he as ClientTools,rs as CloudService,is as CodesignService,pt as Connection,Hi as DFUArrayActions,Oi as DFUChangeProtection,Yi as DFUChangeRestriction,ji as DFUDefFileFormat,ie as DFUService,js as DFUWorkunit,Lt as DFUWorkunitCache,as as DFUXRefService,os as DaliService,Vt as Definition,Qe as ECLGraph,ee as ECLScope,ne as ESPConnection,k as ESPExceptions,Ee as EclService,at as EclccErrors,us as ElkService,qt as EnvchkErrors,ot as Errors,vt as Field,Ht as File,re as FileSpray,v as FileSprayService,Dn as FileSprayStates,jt as Folder,At as GlobalResultCache,Le as GraphCache,rt as Import,zt as LocalWorkunit,Rn as LogType,ps as LogaccessService,Gs as LogicalFile,bt as LogicalFileCache,tt as Machine,Pt as MachineCache,w as MachineService,Zr as PKG_NAME,$r as PKG_VERSION,gs as PackageProcessService,Hn as PropertyType,Vs as Query,nt as QueryGraph,jn as RelatedProperty,ve as Resource,ds as ResourcesService,Xe as Result,qe as ResultCache,oe as SMCService,hs as SashaService,ue as Scope,Es as ScopeEdge,Ge as ScopeGraph,ys as ScopeSubgraph,Us as ScopeVertex,m as Service,_t as Source,Je as SourceFile,_s as Store,Qt as StoreCache,ae as StoreService,xn as TargetAudience,Z as TargetCluster,Tt as TargetClusterCache,ze as Timer,st as Topology,Mt as TopologyCache,y as TopologyService,O as ValueChangedMessage,me as Version,ht as WUStateID,V as WUUpdate,Ot as Workspace,K as Workunit,Et as WorkunitCache,W as WorkunitsService,Ne as WorkunitsServiceEx,ts as WsAccess,z as WsDfu,x as WsLogaccess,fs as WsSMC,ms as WsSasha,Ds as WsTopology,E as WsWorkunits,Ws as XGMMLEdge,Dt as XGMMLGraph,xs as XGMMLSubgraph,As as XGMMLVertex,Ve as XSDNode,je as XSDSchema,He as XSDSimpleType,_e as XSDXMLNode,X as attachWorkspace,vu as clearAllClientToolsCache,Ce as createConnection,ke as createGraph,Ms as createXGMMLGraph,uc as defaultTargetCluster,un as deserializeResponse,dn as get,ii as hookSend,ri as instanceOfIConnection,ni as instanceOfIOptions,hn as isArray,Ss as isECLResult,di as isExceptions,Oo as isWUInfoWorkunit,jo as isWUQueryECLWorkunit,ln as jsonp,Hr as locateAllClientTools,Js as locateClientTools,St as parseXSD,ta as parseXSD2,gn as post,wu as qualifiedIDBoundary,mn as send,G as serializeRequest,oi as setTransportFactory,Xn as splitMetric,cc as targetClusters,Jt as walkXmlJson};
|
|
926
926
|
//# sourceMappingURL=index.node.js.map
|