UNPKG

111 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/util")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/util"],t):t((e=e||self)["@hpcc-js/comms"]={},e["@hpcc-js/util"])}(this,function(e,t){"use strict";!function(e){if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};p.prototype.append=function(e,t){e=c(e),t=s(t);var n=this.map[e];this.map[e]=n?n+","+t:t},p.prototype.delete=function(e){delete this.map[c(e)]},p.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},p.prototype.set=function(e,t){this.map[c(e)]=s(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),a(e)},p.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},p.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),a(e)},t.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);var i=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},d.call(b.prototype),d.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var u=[301,302,303,307,308];m.redirect=function(e,t){if(-1===u.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.Headers=p,e.Request=b,e.Response=m,e.fetch=function(e,n){return new Promise(function(r,o){var i=new b(e,n),u=new XMLHttpRequest;u.onload=function(){var e,t,n={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new p,e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL");var o="response"in u?u.response:u.responseText;r(new m(o,n))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.open(i.method,i.url,!0),"include"===i.credentials&&(u.withCredentials=!0),"responseType"in u&&t.blob&&(u.responseType="blob"),i.headers.forEach(function(e,t){u.setRequestHeader(t,e)}),u.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function p(e){this.map={},e instanceof p?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function l(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function h(e){var t=new FileReader,n=l(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&r(e))this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=g(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=l(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),i.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function m(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:void 0);var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function r(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,c)}s((r=r.apply(e,t||[])).next())})}function u(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var c=t.scopedLogger("comms/connection.ts");var s={type:"post",baseUrl:"",userID:"",password:"",rejectUnauthorized:!0,timeoutSecs:60};function a(e,t){return void 0===t||!0===t?encodeURIComponent(e):""+e}function p(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=""),n&&(n+="."),"object"!=typeof e)return a(e,t);var r=[],o=function(o){if(e.hasOwnProperty(o))if(e[o]instanceof Array){var i=!1;e[o].forEach(function(e,u){"object"==typeof e?(i=!0,r.push(p(e,t,n+a(o+"."+u,t)))):r.push(n+a(o+"_i"+u,t)+"="+p(e,t))}),i&&r.push(n+a(o+".itemcount",t)+"="+e[o].length)}else"object"==typeof e[o]?e[o]&&e[o].Item instanceof Array?(r.push(p(e[o].Item,t,n+a(o,t))),r.push(n+a(o+".itemcount",t)+"="+e[o].Item.length)):r.push(p(e[o],t,n+a(o,t))):void 0!==e[o]?r.push(n+a(o,t)+"="+a(e[o],t)):r.push(n+a(o,t))};for(var i in e)o(i);return r.join("&")}function f(e){return JSON.parse(e)}function l(e,n,r,o,i){return void 0===r&&(r={}),void 0===o&&(o="json"),i&&console.warn("Header attributes ignored for JSONP connections"),new Promise(function(i,u){var s=1e3*e.timeoutSecs,a="jsonp_callback_"+Math.round(999999*Math.random());window[a]=function(e){s=0,d(),i("json"===o&&"string"==typeof e?f(e):e)};var l=document.createElement("script"),h=t.join(e.baseUrl,n);h+=h.indexOf("?")>=0?"&":"?",l.src=h+"jsonp="+a+"&"+p(r,e.encodeRequest),document.body.appendChild(l);var g=setInterval(function(){s<=0?clearInterval(g):(s-=5e3)<=0?(clearInterval(g),c.error("Request timeout: "+l.src),d(),u(Error("Request timeout: "+l.src))):c.debug("Request pending ("+s/1e3+" sec): "+l.src)},5e3);function d(){delete window[a],document.body.removeChild(l)}})}var h={};function g(e,n,r,i,u){function c(e){if(e.ok)return"json"===u?e.json():e.text();throw new Error(e.statusText)}return i=o(o({},function(e){return e.userID?{Authorization:"Basic "+btoa(e.userID+":"+e.password)}:{}}(e)),i),r=o(o({credentials:h[e.baseUrl]?"omit":"include"},r),{headers:i}),!1===e.rejectUnauthorized&&fetch.__agent&&0===e.baseUrl.indexOf("https:")&&(r.agent=fetch.__agent),t.promiseTimeout(1e3*e.timeoutSecs,fetch(t.join(e.baseUrl,n),r).then(c).catch(function(o){return r.credentials=h[e.baseUrl]?"include":"omit",fetch(t.join(e.baseUrl,n),r).then(c).then(function(t){return h[e.baseUrl]=!h[e.baseUrl],t})}))}function d(e,t,n,r,i){return void 0===r&&(r="json"),g(e,t,{method:"post",body:p(n,e.encodeRequest)},o({"Content-Type":"application/x-www-form-urlencoded"},i),r)}function b(e,t,n,r,i){return void 0===r&&(r="json"),g(e,t+"?"+p(n,e.encodeRequest),{method:"get"},o({},i),r)}function y(e,t,n,r,o){var i;switch(void 0===r&&(r="json"),e.type){case"jsonp":i=l(e,t,n,r,o);break;case"get":i=b(e,t,n,r,o);break;case"post":default:i=d(e,t,n,r,o)}return i}var m=y;var v=function(){function e(e){this.opts(e)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._opts.baseUrl},enumerable:!1,configurable:!0}),e.prototype.opts=function(e){return 0===arguments.length?this._opts:(this._opts=o(o({},s),e),this)},e.prototype.send=function(e,t,n,r){return void 0===n&&(n="json"),this._opts.hookSend?this._opts.hookSend(this._opts,e,t,n,m,r):m(this._opts,e,t,n,r)},e.prototype.clone=function(){return new e(this.opts())},e}();function S(e){return"[object Array]"===Object.prototype.toString.call(e)}e.createConnection=function(e){return new v(e)};var P=function(e){function t(t,n,r){var o=e.call(this,"ESPException: "+r.Source)||this;return o.isESPExceptions=!0,o.action=t,o.request=n,o.Source=r.Source,o.Exception=r.Exception,r.Exception.length&&(o.message=r.Exception[0].Code+": "+r.Exception[0].Message),o}return r(t,e),t}(Error);var C=function(){function n(t,n,r){this._connection=function(e){return void 0!==e.send}(t)?t:e.createConnection(t),this._service=n,this._version=r}return Object.defineProperty(n.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),n.prototype.service=function(e){return void 0===e?this._service:(this._service=e,this)},n.prototype.version=function(e){return void 0===e?this._version:(this._version=e,this)},n.prototype.toESPStringArray=function(e,t){if(S(e[t])){for(var n=0;n<e[t].length;++n)e[t+"_i"+n]=e[t][n];delete e[t]}return e},n.prototype.opts=function(e){return void 0===e?this._connection.opts():(this._connection.opts(e),this)},n.prototype.send=function(e,n,r,i){void 0===n&&(n={}),void 0===r&&(r="json"),void 0===i&&(i=!1);var u,c=o(o({},n),{ver_:this._version});i&&(c.upload_=!0);var s="json";switch(r){case"text":u=t.join(this._service,e),s="text";break;case"xsd":u=t.join(this._service,e+".xsd"),s="text";break;case"json2":u=t.join(this._service,e+"/json"),r="json";var a=e.split("/");e=a.pop();break;default:u=t.join(this._service,e+".json")}return this._connection.send(u,c,s).then(function(t){if("json"===r){var n=void 0;if(t&&t.Exceptions)throw new P(e,c,t.Exceptions);if(t&&(n=t[("WUCDebug"===e?"WUDebug":e)+"Response"]),!n)throw new P(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:"Missing Response"}]});return n}return t}).catch(function(t){if(t.isESPExceptions)throw t;throw new P(e,c,{Source:"ESPConnection.send",Exception:[{Code:0,Message:t.message}]})})},n.prototype.clone=function(){return new n(this._connection.clone(),this._service,this._version)},n}(),O=function(){function e(e,t,n){this._connection=new C(e,t,n)}return Object.defineProperty(e.prototype,"baseUrl",{get:function(){return this._connection.opts().baseUrl},enumerable:!1,configurable:!0}),e}(),U=function(){function e(e){this._connection=new C(e,"Ws_Account","1.03")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.VerifyUser=function(e){return this._connection.send("VerifyUser",e)},e}(),j=function(e){function t(t){return e.call(this,t,"WsDfu","1.5")||this}return r(t,e),t.prototype.DFUQuery=function(e){return this._connection.send("DFUQuery",e)},t.prototype.DFUInfo=function(e){return this._connection.send("DFUInfo",e)},t}(O);function w(e,t){var n=typeof t;switch(n){case"boolean":case"number":case"string":return{id:e,type:n};case"object":if(t.Row instanceof Array&&(t=t.Row),t instanceof Array)return{id:e,type:"dataset",children:T(t[0])};if(t instanceof Object){if(t.Item&&t.Item instanceof Array&&1===t.Item.length){var r=typeof t.Item[0];if("string"===r||"number"===r)return{id:e,type:"set",fieldType:r};throw new Error("Unknown field type")}return{id:e,type:"object",fields:D(t)}}default:throw new Error("Unknown field type")}}function T(e){e.Row&&e.Row instanceof Array&&(e=e.Row[0]);var t=[];for(var n in e)t.push(w(n,e[n]));return t}function D(e){var t={};for(var n in e)t[n]=w(n,e[n]);return t}var x=function(e){function t(t){return e.call(this,t,"WsEcl","0")||this}return r(t,e),t.prototype.opts=function(){return this._connection.opts()},t.prototype.requestJson=function(e,t){return this._connection.send("example/request/query/"+e+"/"+t+"/json",{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n];return{}}).then(T)},t.prototype.responseJson=function(e,t){return this._connection.send("example/response/query/"+e+"/"+t+"/json",{},"text").then(function(e){var t=JSON.parse(e);for(var n in t)return t[n].Results;return{}}).then(function(e){var t={};for(var n in e)t[n]=T(e[n]);return t})},t.prototype.submit=function(e,t,n){var r="submit/query/"+e+"/"+t;return this._connection.send(r,n,"json2").then(function(e){if(e.Results&&e.Results.Exception)throw new P(r,n,{Source:"wsEcl.submit",Exception:e.Results.Exception});return e.Results})},t}(O);function _(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var W,R;1===(W=_).length&&(R=W,W=function(e,t){return _(R(e),t)});function N(e){return null===e?NaN:+e}function I(e,t){var n,r,o=e.length,i=-1;if(null==t){for(;++i<o;)if(null!=(n=e[i])&&n>=n)for(r=n;++i<o;)null!=(n=e[i])&&n>r&&(r=n)}else for(;++i<o;)if(null!=(n=t(e[i],i,e))&&n>=n)for(r=n;++i<o;)null!=(n=t(e[i],i,e))&&n>r&&(r=n);return r}function A(e,t){var n,r=e.length,o=r,i=-1,u=0;if(null==t)for(;++i<r;)isNaN(n=N(e[i]))?--o:u+=n;else for(;++i<r;)isNaN(n=N(t(e[i],i,e)))?--o:u+=n;if(o)return u/o}var M,E,F=function(){function e(e){this._connection=new C(e,"ws_machine","1.13")}return e.prototype.GetTargetClusterInfo=function(e){return void 0===e&&(e={}),this._connection.send("GetTargetClusterInfo",e)},e.prototype.GetTargetClusterUsage=function(e,n){return void 0===n&&(n=!1),this._connection.send("GetTargetClusterUsage",{TargetClusters:e?{Item:e}:{},BypassCachedResult:n}).then(function(e){return t.exists("TargetClusterUsages.TargetClusterUsage",e)?e.TargetClusterUsages.TargetClusterUsage:[]})},e.prototype.GetTargetClusterUsageEx=function(e,t){return void 0===t&&(t=!1),this.GetTargetClusterUsage(e,t).then(function(e){return e.filter(function(e){return!!e.ComponentUsages}).map(function(e){var t=e.ComponentUsages.ComponentUsage.map(function(e){var t=(e.MachineUsages&&e.MachineUsages.MachineUsage?e.MachineUsages.MachineUsage:[]).map(function(e){var t=e.DiskUsages&&e.DiskUsages.DiskUsage?e.DiskUsages.DiskUsage.map(function(e){return o(o({},e),{Total:e.InUse+e.Available,PercentUsed:100-e.PercentAvailable})}):[];return{Name:e.Name,NetAddress:e.NetAddress,Description:e.Description,DiskUsages:t,mean:A(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed}),max:I(t.filter(function(e){return!isNaN(e.PercentUsed)}),function(e){return e.PercentUsed})}});return{Type:e.Type,Name:e.Name,Description:e.Description,MachineUsages:t,MachineUsagesDescription:t.reduce(function(e,t){return e+(t.Description||"")},""),mean:A(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:I(t.filter(function(e){return!isNaN(e.max)}),function(e){return e.max})}});return{Name:e.Name,Description:e.Description,ComponentUsages:t,ComponentUsagesDescription:t.reduce(function(e,t){return e+(t.MachineUsagesDescription||"")},""),mean:A(t.filter(function(e){return!isNaN(e.mean)}),function(e){return e.mean}),max:I(t.filter(function(e){return!isNaN(e.max)}),function(e){return e.max})}})})},e}(),L=function(){function e(e){this._connection=new C(e,"WsSMC","1.19")}return e.prototype.connectionOptions=function(){return this._connection.opts()},e.prototype.Activity=function(e){return this._connection.send("Activity",e).then(function(e){return o({Running:{ActiveWorkunit:[]}},e)})},e}(),k=function(e){function t(t){return e.call(this,t,"WsStore","1")||this}return r(t,e),t.prototype.CreateStore=function(e){return this._connection.send("Fetch",e)},t.prototype.Delete=function(e){return this._connection.send("Delete",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return-1===e.Code}))return{Exceptions:void 0,Success:!0};throw e})},t.prototype.DeleteNamespace=function(e){return this._connection.send("DeleteNamespace",e)},t.prototype.Fetch=function(e){return this._connection.send("Fetch",e).catch(function(e){if(e.isESPExceptions&&e.Exception.some(function(e){return-1===e.Code}))return{Exceptions:void 0,Value:void 0};throw e})},t.prototype.FetchAll=function(e){return this._connection.send("FetchAll",e)},t.prototype.FetchKeyMD=function(e){return this._connection.send("FetchKeyMD",e)},t.prototype.ListKeys=function(e){return this._connection.send("ListKeys",e)},t.prototype.ListNamespaces=function(e){return this._connection.send("ListNamespaces",e)},t.prototype.Set=function(e){return this._connection.send("Set",e)},t}(O),V=function(e){function t(t){return e.call(this,t,"WsTopology","1.25")||this}return r(t,e),t.prototype.connectionOptions=function(){return this._connection.opts()},t.prototype.protocol=function(){return this._connection.opts().baseUrl.split("//")[0]},t.prototype.ip=function(){return this._connection.opts().baseUrl.split("//")[1].split(":")[0]},t.prototype.TpLogicalClusterQuery=function(e){return void 0===e&&(e={}),this._connection.send("TpLogicalClusterQuery",e)},t.prototype.DefaultTpLogicalClusterQuery=function(e){return void 0===e&&(e={}),this.TpLogicalClusterQuery(e).then(function(e){return e.default?e.default:(e.TpLogicalClusters.TpLogicalCluster.some(function(e,r){return 0===r&&(n=e),"hthor"===e.Type&&(t=e,!0)}),t||n);var t,n})},t.prototype.TpServiceQuery=function(e){return this._connection.send("TpServiceQuery",e)},t.prototype.TpTargetClusterQuery=function(e){return this._connection.send("TpTargetClusterQuery",e)},t.prototype.TpListTargetClusters=function(e){return this._connection.send("TpListTargetClusters",e)},t}(O);!function(e){e[e.Unknown=0]="Unknown",e[e.Compiled=1]="Compiled",e[e.Running=2]="Running",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed",e[e.Archived=5]="Archived",e[e.Aborting=6]="Aborting",e[e.Aborted=7]="Aborted",e[e.Blocked=8]="Blocked",e[e.Submitted=9]="Submitted",e[e.Scheduled=10]="Scheduled",e[e.Compiling=11]="Compiling",e[e.Wait=12]="Wait",e[e.UploadingFiled=13]="UploadingFiled",e[e.DebugPaused=14]="DebugPaused",e[e.DebugRunning=15]="DebugRunning",e[e.Paused=16]="Paused",e[e.LAST=17]="LAST",e[e.NotFound=999]="NotFound"}(e.WUStateID||(e.WUStateID={})),E=e.WUUpdate||(e.WUUpdate={}),(M=E.Action||(E.Action={}))[M.Unknown=0]="Unknown",M[M.Compile=1]="Compile",M[M.Check=2]="Check",M[M.Run=3]="Run",M[M.ExecuteExisting=4]="ExecuteExisting",M[M.Pause=5]="Pause",M[M.PauseNow=6]="PauseNow",M[M.Resume=7]="Resume",M[M.Debug=8]="Debug",M[M.__size=9]="__size";var B=function(e){function n(t){return e.call(this,t,"WsWorkunits","1.68")||this}return r(n,e),n.prototype.opts=function(){return this._connection.opts()},n.prototype.connection=function(){return this._connection},n.prototype.WUQuery=function(e){return void 0===e&&(e={}),this._connection.send("WUQuery",e).then(function(e){return t.deepMixin({Workunits:{ECLWorkunit:[]}},e)})},n.prototype.WUInfo=function(e){var t=o({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,SuppressResultSchemas:!0},e);return this._connection.send("WUInfo",t)},n.prototype.WUCreate=function(){return this._connection.send("WUCreate")},n.prototype.WUUpdate=function(e){return this._connection.send("WUUpdate",e,"json",!0)},n.prototype.WUSubmit=function(e){return this._connection.send("WUSubmit",e)},n.prototype.WUResubmit=function(e){return this._connection.toESPStringArray(e,"Wuids"),this._connection.send("WUResubmit",e)},n.prototype.WUQueryDetails=function(e){return this._connection.send("WUQueryDetails",e)},n.prototype.WUListQueries=function(e){return this._connection.send("WUListQueries",e)},n.prototype.WUPushEvent=function(e){return this._connection.send("WUPushEvent",e)},n.prototype.WUAction=function(e){return e.ActionType=e.WUActionType,this._connection.send("WUAction",e)},n.prototype.WUGetZAPInfo=function(e){return this._connection.send("WUGetZAPInfo",e)},n.prototype.WUShowScheduled=function(e){return this._connection.send("WUShowScheduled",e)},n.prototype.WUQuerySetAliasAction=function(e){return this._connection.send("WUQuerySetAliasAction",e)},n.prototype.WUQuerySetQueryAction=function(e){return this._connection.send("WUQuerySetQueryAction",e)},n.prototype.WUPublishWorkunit=function(e){return this._connection.send("WUPublishWorkunit",e)},n.prototype.WUGetGraph=function(e){return this._connection.send("WUGetGraph",e)},n.prototype.WUResult=function(e){return this._connection.send("WUResult",e)},n.prototype.WUQueryGetGraph=function(e){return this._connection.send("WUQueryGetGraph",e)},n.prototype.WUFile=function(e){return this._connection.send("WUFile",e,"text")},n.prototype.WUGetStats=function(e){return this._connection.send("WUGetStats",e)},n.prototype.WUDetailsMeta=function(e){return this._WUDetailsMetaPromise||(this._WUDetailsMetaPromise=this._connection.send("WUDetailsMeta",e)),this._WUDetailsMetaPromise},n.prototype.WUDetails=function(e){return this._connection.send("WUDetails",e)},n.prototype.WUCDebug=function(e){return this._connection.send("WUCDebug",e).then(function(e){var n=t.xml2json(e.Result).children();return n.length?n[0]:null})},n}(O),G=new Date,Q=new Date;function H(e,t,n,r){function o(t){return e(t=new Date(+t)),t}return o.floor=o,o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,r,i){var u=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return u;do{u.push(new Date(+n))}while(t(n,i),e(n),n<r);return u},o.filter=function(n){return H(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(o.count=function(t,r){return G.setTime(+t),Q.setTime(+r),e(G),e(Q),Math.floor(n(G,Q))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?function(t){return r(t)%e==0}:function(t){return o.count(0,t)%e==0}):o:null}),o}var q=H(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});q.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?H(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):q:null};var X=6e4,Y=6048e5,z=(H(function(e){e.setTime(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),H(function(e){e.setTime(Math.floor(e/X)*X)},function(e,t){e.setTime(+e+t*X)},function(e,t){return(t-e)/X},function(e){return e.getMinutes()}),H(function(e){var t=e.getTimezoneOffset()*X%36e5;t<0&&(t+=36e5),e.setTime(36e5*Math.floor((+e-t)/36e5)+t)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),H(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*X)/864e5},function(e){return e.getDate()-1}));function J(e){return H(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*X)/Y})}var K=J(0),Z=J(1),$=(J(2),J(3),J(4)),ee=(J(5),J(6),H(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())},function(e){return e.getMonth()}),H(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()}));ee.every=function(e){return isFinite(e=Math.floor(e))&&e>0?H(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null};H(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*X)},function(e,t){return(t-e)/X},function(e){return e.getUTCMinutes()}),H(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()});var te=H(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1});function ne(e){return H(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Y})}var re=ne(0),oe=ne(1),ie=(ne(2),ne(3),ne(4)),ue=(ne(5),ne(6),H(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()}),H(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()}));function ce(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function se(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ae(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}ue.every=function(e){return isFinite(e=Math.floor(e))&&e>0?H(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null};var pe,fe,le,he={"-":"",_:" ",0:"0"},ge=/^\s*\d+/,de=/^%/,be=/[\\^$*+?|[\]().{}]/g;function ye(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(t)+o:o)}function me(e){return e.replace(be,"\\$&")}function ve(e){return new RegExp("^(?:"+e.map(me).join("|")+")","i")}function Se(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function Pe(e,t,n){var r=ge.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ce(e,t,n){var r=ge.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Oe(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ue(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function je(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function we(e,t,n){var r=ge.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Te(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function De(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function xe(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function _e(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function We(e,t,n){var r=ge.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Re(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ne(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ie(e,t,n){var r=ge.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ae(e,t,n){var r=ge.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Me(e,t,n){var r=ge.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ee(e,t,n){var r=de.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Fe(e,t,n){var r=ge.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Le(e,t,n){var r=ge.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function ke(e,t){return ye(e.getDate(),t,2)}function Ve(e,t){return ye(e.getHours(),t,2)}function Be(e,t){return ye(e.getHours()%12||12,t,2)}function Ge(e,t){return ye(1+z.count(ee(e),e),t,3)}function Qe(e,t){return ye(e.getMilliseconds(),t,3)}function He(e,t){return Qe(e,t)+"000"}function qe(e,t){return ye(e.getMonth()+1,t,2)}function Xe(e,t){return ye(e.getMinutes(),t,2)}function Ye(e,t){return ye(e.getSeconds(),t,2)}function ze(e){var t=e.getDay();return 0===t?7:t}function Je(e,t){return ye(K.count(ee(e),e),t,2)}function Ke(e,t){var n=e.getDay();return e=n>=4||0===n?$(e):$.ceil(e),ye($.count(ee(e),e)+(4===ee(e).getDay()),t,2)}function Ze(e){return e.getDay()}function $e(e,t){return ye(Z.count(ee(e),e),t,2)}function et(e,t){return ye(e.getFullYear()%100,t,2)}function tt(e,t){return ye(e.getFullYear()%1e4,t,4)}function nt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function rt(e,t){return ye(e.getUTCDate(),t,2)}function ot(e,t){return ye(e.getUTCHours(),t,2)}function it(e,t){return ye(e.getUTCHours()%12||12,t,2)}function ut(e,t){return ye(1+te.count(ue(e),e),t,3)}function ct(e,t){return ye(e.getUTCMilliseconds(),t,3)}function st(e,t){return ct(e,t)+"000"}function at(e,t){return ye(e.getUTCMonth()+1,t,2)}function pt(e,t){return ye(e.getUTCMinutes(),t,2)}function ft(e,t){return ye(e.getUTCSeconds(),t,2)}function lt(e){var t=e.getUTCDay();return 0===t?7:t}function ht(e,t){return ye(re.count(ue(e),e),t,2)}function gt(e,t){var n=e.getUTCDay();return e=n>=4||0===n?ie(e):ie.ceil(e),ye(ie.count(ue(e),e)+(4===ue(e).getUTCDay()),t,2)}function dt(e){return e.getUTCDay()}function bt(e,t){return ye(oe.count(ue(e),e),t,2)}function yt(e,t){return ye(e.getUTCFullYear()%100,t,2)}function mt(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function vt(){return"+0000"}function St(){return"%"}function Pt(e){return+e}function Ct(e){return Math.floor(+e/1e3)}pe=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,u=e.shortDays,c=e.months,s=e.shortMonths,a=ve(o),p=Se(o),f=ve(i),l=Se(i),h=ve(u),g=Se(u),d=ve(c),b=Se(c),y=ve(s),m=Se(s),v={a:function(e){return u[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return c[e.getMonth()]},c:null,d:ke,e:ke,f:He,H:Ve,I:Be,j:Ge,L:Qe,m:qe,M:Xe,p:function(e){return o[+(e.getHours()>=12)]},Q:Pt,s:Ct,S:Ye,u:ze,U:Je,V:Ke,w:Ze,W:$e,x:null,X:null,y:et,Y:tt,Z:nt,"%":St},S={a:function(e){return u[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return c[e.getUTCMonth()]},c:null,d:rt,e:rt,f:st,H:ot,I:it,j:ut,L:ct,m:at,M:pt,p:function(e){return o[+(e.getUTCHours()>=12)]},Q:Pt,s:Ct,S:ft,u:lt,U:ht,V:gt,w:dt,W:bt,x:null,X:null,y:yt,Y:mt,Z:vt,"%":St},P={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=g[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=l[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=m[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.m=b[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return U(e,t,n,r)},d:_e,e:_e,f:Me,H:Re,I:Re,j:We,L:Ae,m:xe,M:Ne,p:function(e,t,n){var r=a.exec(t.slice(n));return r?(e.p=p[r[0].toLowerCase()],n+r[0].length):-1},Q:Fe,s:Le,S:Ie,u:Ce,U:Oe,V:Ue,w:Pe,W:je,x:function(e,t,r){return U(e,n,t,r)},X:function(e,t,n){return U(e,r,t,n)},y:Te,Y:we,Z:De,"%":Ee};function C(e,t){return function(n){var r,o,i,u=[],c=-1,s=0,a=e.length;for(n instanceof Date||(n=new Date(+n));++c<a;)37===e.charCodeAt(c)&&(u.push(e.slice(s,c)),null!=(o=he[r=e.charAt(++c)])?r=e.charAt(++c):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),u.push(r),s=c+1);return u.push(e.slice(s,c)),u.join("")}}function O(e,t){return function(n){var r,o,i=ae(1900);if(U(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("p"in i&&(i.H=i.H%12+12*i.p),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(r=se(ae(i.y))).getUTCDay(),r=o>4||0===o?oe.ceil(r):oe(r),r=te.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=t(ae(i.y))).getDay(),r=o>4||0===o?Z.ceil(r):Z(r),r=z.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?se(ae(i.y)).getUTCDay():t(ae(i.y)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,se(i)):t(i)}}function U(e,t,n,r){for(var o,i,u=0,c=t.length,s=n.length;u<c;){if(r>=s)return-1;if(37===(o=t.charCodeAt(u++))){if(o=t.charAt(u++),!(i=P[o in he?t.charAt(u++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return v.x=C(n,v),v.X=C(r,v),v.c=C(t,v),S.x=C(n,S),S.X=C(r,S),S.c=C(t,S),{format:function(e){var t=C(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=O(e+="",ce);return t.toString=function(){return e},t},utcFormat:function(e){var t=C(e+="",S);return t.toString=function(){return e},t},utcParse:function(e){var t=O(e,se);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),pe.format,pe.parse,fe=pe.utcFormat,le=pe.utcParse;Date.prototype.toISOString||fe("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||le("%Y-%m-%dT%H:%M:%S.%LZ");var Ot=function(e){function t(t,n,r){var i=e.call(this)||this;i.wu=t;for(var u=0,c=0,s=r;c<s.length;c++){var a=s[c];if(a.GraphName===n.Name&&!a.HasSubGraphId){u=Math.round(1e3*a.Seconds)/1e3;break}}return i.set(o({Time:u},n)),i}return r(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Label",{get:function(){return this.get("Label")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.get("Type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Complete",{get:function(){return this.get("Complete")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WhenStarted",{get:function(){return this.get("WhenStarted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WhenFinished",{get:function(){return this.get("WhenFinished")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Time",{get:function(){return this.get("Time")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Running",{get:function(){return this.get("Running")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RunningId",{get:function(){return this.get("RunningId")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Failed",{get:function(){return this.get("Failed")},enumerable:!1,configurable:!0}),t.prototype.fetchScopeGraph=function(e){return e?this.wu.fetchGraphDetails([e],["subgraph"]).then(function(e){return At(e)}):this.wu.fetchGraphDetails([this.Name],["graph"]).then(function(e){return At(e)})},t}(t.StateObject),Ut=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Name])})||this}return r(n,e),n}(t.Cache);function jt(e){var t={};return e.forEach(function(e){"att"===e.name&&(t[e.$.name]=e.$.value)}),t}var wt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Graph),Tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Subgraph),Dt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Vertex),xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Edge);function _t(e,t){var n={},r={},o={},i=new wt(function(e){return e._.id}),u=[i.root];return function e(t,n,r){(r=r||[]).push(t),n(t.name,t.$,t.children(),r),t.children().forEach(function(t){e(t,n,r)}),r.pop()}(t,function(e,t,i,c){var s=u[u.length-1];switch(e){case"graph":break;case"node":if(i.length&&i[0].children().length&&"graph"===i[0].children()[0].name){var a=s.createSubgraph(jt(i));u.push(a),n[t.id]=a}var p=s.createVertex(jt(i));r[t.id]=p;break;case"edge":var f=s.createEdge(r[t.source],r[t.target],jt(i));o[t.id]=f}}),i}var Wt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Graph),Rt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Subgraph),Nt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Vertex),It=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(t.Edge);function At(e){for(var t,n={},r={},o=0,i=e;o<i.length;o++){switch((f=i[o]).ScopeType){case"graph":t=new Wt(function(e){return e._.Id},f),n[f.ScopeName]=t.root;break;case"subgraph":t||(t=new Wt(function(e){return e._.Id},f),n[f.ScopeName]=t.root);for(var u=f.parentScope().split(":"),c=n[f.parentScope()];u.length&&!c;)c=n[u.join(":")],u.pop();if(c){var s=c;n[f.ScopeName]=s.createSubgraph(f)}else console.log("Missing SG:Parent ("+f.Id+"): "+f.parentScope());break;case"activity":var a=n[f.parentScope()];a?a.createVertex(f):console.log("Missing A:Parent ("+f.Id+"): "+f.parentScope());break;case"edge":r[f.ScopeName]=f}}for(var p in r){var f,l=n[(f=r[p]).parentScope()];if(l){var h=l;try{var g=t.vertex(f.attr("IdSource").RawValue),d=t.vertex(f.attr("IdTarget").RawValue);h.createEdge(g,d,f)}catch(e){console.log("Invalid Edge: "+p)}}else console.log("Missing E:Parent ("+f.Id+"): "+f.parentScope())}return t}var Mt=function(e){function t(t,n){var r=e.call(this)||this;r.wu=t;var o=n.split("\\").join("/"),i=o.split("/"),u="res/"+r.wu.Wuid+"/",c="",s="";return 0===o.indexOf(u)&&(c=o.substr(u.length),s=i[i.length-1]),r.set({URL:n,DisplayName:s,DisplayPath:c}),r}return r(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"URL",{get:function(){return this.get("URL")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayName",{get:function(){return this.get("DisplayName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayPath",{get:function(){return this.get("DisplayPath")},enumerable:!1,configurable:!0}),t}(t.StateObject),Et=function(){function e(e){this.e=e}return e.prototype.fix=function(){delete this.e},e}(),Ft=function(e){function t(t){var n=e.call(this,t)||this;return n.attrs={},n._children=[],n}return r(t,e),t.prototype.append=function(e){this._children.push(e),this.type||(this.type="hpcc:childDataset")},t.prototype.fix=function(){var t;this.name=this.e.$.name,this.type=this.e.$.type;for(var n=this._children.length-1;n>=0;--n){var r=this._children[n];"Row"===r.name&&void 0===r.type&&((t=this._children).push.apply(t,r._children),this._children.splice(n,1))}e.prototype.fix.call(this)},t.prototype.children=function(){return this._children},t.prototype.charWidth=function(){var e=-1;switch(this.type){case"xs:boolean":e=5;break;case"xs:integer":case"xs:nonNegativeInteger":case"xs:double":e=8;break;case"xs:string":e=32;break;default:for(var t=this.type.lastIndexOf("_"),n=t>0?t:this.type.length,r=n-1;r>=0&&-1!=="0123456789".indexOf(this.type.charAt(r));--r);r+1<n&&(e=parseInt(this.type.substring(r+1,n),10)),0===this.type.indexOf("data")&&(e*=2)}return e<this.name.length&&(e=this.name.length),e},t}(Et),Lt=function(e){function t(t){return e.call(this,t)||this}return r(t,e),t.prototype.append=function(e){switch(e.name){case"xs:restriction":this._restricition=e;break;case"xs:maxLength":this._maxLength=e}},t.prototype.fix=function(){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,e.prototype.fix.call(this)},t}(Et),kt=function(){function e(){this.simpleTypes={}}return e.prototype.fields=function(){return this.root.children()},e}(),Vt=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.schema=new kt,n.simpleTypes={},n.xsdStack=new t.Stack,n}return r(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xs:element":var n=new Ft(t);this.schema.root?this.xsdStack.depth()&&this.xsdStack.top().append(n):this.schema.root=n,this.xsdStack.push(n);break;case"xs:simpleType":this.simpleType=new Lt(t)}},n.prototype.endXMLNode=function(t){switch(t.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":var n=this.xsdStack.top();for(var r in t.$)n.attrs[r]=t.$[r];break;default:this.simpleType&&this.simpleType.append(t)}e.prototype.endXMLNode.call(this,t)},n}(t.SAXStackParser);function Bt(e){var t=new Vt;return t.parse(e),t.schema}var Gt=function(e){function n(n){var r=e.call(this)||this;return r.schema=new kt,r.simpleTypes={},r.xsdStack=new t.Stack,r._rootName=n,r}return r(n,e),n.prototype.startXMLNode=function(t){switch(e.prototype.startXMLNode.call(this,t),t.name){case"xsd:element":var n=new Ft(t);this.schema.root||this._rootName!==t.$.name||(this.schema.root=n),this.xsdStack.depth()&&this.xsdStack.top().append(n),this.xsdStack.push(n);break;case"xsd:simpleType":this.simpleType=new Lt(t)}},n.prototype.endXMLNode=function(t){switch(t.name){case"xsd:element":this.xsdStack.pop().fix()}e.prototype.endXMLNode.call(this,t)},n}(Vt);var Qt,Ht=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Wuid+"-"+e.ResultName})||this}return r(t,e),t}(t.Cache),qt=new Ht,Xt=function(e){function n(t,n,r,i){void 0===i&&(i=[]);var u=e.call(this)||this;return u.connection=t instanceof B?t:new B(t),void 0===r?u.set({LogicalFileName:n}):"string"==typeof r?u.set({Wuid:n,ResultName:r,ResultViews:i}):"number"==typeof r?u.set({Wuid:n,ResultSequence:r,ResultViews:i}):u.set(o({Wuid:n,ResultName:r.Name,ResultViews:i},r)),u}return r(n,e),Object.defineProperty(n.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultName",{get:function(){return this.get("ResultName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultSequence",{get:function(){return this.get("ResultSequence")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"LogicalFileName",{get:function(){return this.get("LogicalFileName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Sequence",{get:function(){return this.get("Sequence")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Value",{get:function(){return this.get("Value")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Link",{get:function(){return this.get("Link")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"FileName",{get:function(){return this.get("FileName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsSupplied",{get:function(){return this.get("IsSupplied")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowFileContent",{get:function(){return this.get("ShowFileContent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Total",{get:function(){return this.get("Total")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ECLSchemas",{get:function(){return this.get("ECLSchemas")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"NodeGroup",{get:function(){return this.get("NodeGroup")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ResultViews",{get:function(){return this.get("ResultViews")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"XmlSchema",{get:function(){return this.get("XmlSchema")},enumerable:!1,configurable:!0}),n.attach=function(e,t,r,o){var i=qt.get({BaseUrl:e.baseUrl,Wuid:t,ResultName:r},function(){return new n(e,t,r)});return o&&i.set(o),i},n.prototype.isComplete=function(){return-1!==this.Total},n.prototype.fetchXMLSchema=function(){var e=this;return this.xsdSchema?Promise.resolve(this.xsdSchema):this.WUResult().then(function(n){return t.exists("Result.XmlSchema.xml",n)?(e.xsdSchema=Bt(n.Result.XmlSchema.xml),e.xsdSchema):null})},n.prototype.refresh=function(){return i(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.fetchRows(0,1,!0)];case 1:return e.sent(),[2,this]}})})},n.prototype.fetchRows=function(e,n,r,i){var u=this;return void 0===e&&(e=0),void 0===n&&(n=-1),void 0===r&&(r=!1),void 0===i&&(i={}),this.WUResult(e,n,!r,i).then(function(e){var n=e.Result;return delete e.Result,u.set(o({},e)),t.exists("XmlSchema.xml",n)&&(u.xsdSchema=Bt(n.XmlSchema.xml)),t.exists("Row",n)?n.Row:u.ResultName&&t.exists(u.ResultName,n)?n[u.ResultName].Row:[]})},n.prototype.rootField=function(){return this.xsdSchema?this.xsdSchema.root:null},n.prototype.fields=function(){return this.xsdSchema?this.xsdSchema.root.children():[]},n.prototype.WUResult=function(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=1),void 0===n&&(n=!1),void 0===r&&(r={});var o={NamedValue:{itemcount:0}};for(var i in r)o.NamedValue[o.NamedValue.itemcount++]={Name:i,Value:r[i]};var u={FilterBy:o};return this.Wuid&&void 0!==this.ResultName?(u.Wuid=this.Wuid,u.ResultName=this.ResultName):this.Wuid&&void 0!==this.ResultSequence?(u.Wuid=this.Wuid,u.Sequence=this.ResultSequence):this.LogicalFileName&&this.NodeGroup?(u.LogicalName=this.LogicalFileName,u.Cluster=this.NodeGroup):this.LogicalFileName&&(u.LogicalName=this.LogicalFileName),u.Start=e,u.Count=t,u.SuppressXmlSchema=n,this.connection.WUResult(u).then(function(e){return e})},n}(t.StateObject),Yt=function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.Sequence,e.Name,e.FileName])})||this}return r(n,e),n}(t.Cache),zt=function(e){function t(t,n){var r=e.call(this)||this;return r.scope=t,r.set(n),r}return r(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RawValue",{get:function(){return this.get("RawValue")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Formatted",{get:function(){return this.get("Formatted")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FormattedEnd",{get:function(){return this.get("FormattedEnd")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Measure",{get:function(){return this.get("Measure")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Creator",{get:function(){return this.get("Creator")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreatorType",{get:function(){return this.get("CreatorType")},enumerable:!1,configurable:!0}),t}(t.StateObject),Jt=function(e){function t(t){var n=e.call(this)||this;return n._attributeMap={},n._children=[],n.update(t),n}return r(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ScopeName",{get:function(){return this.get("ScopeName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this.get("Id")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ScopeType",{get:function(){return this.get("ScopeType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Properties",{get:function(){return this.get("Properties",{Property:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CAttributes",{get:function(){var e=this,t=[],n={start:null,end:null};return this.Properties.Property.forEach(function(r){"ts"===r.Measure&&r.Name.indexOf("Started")>=0?n.start=r:e.ScopeName&&"ts"===r.Measure&&r.Name.indexOf("Finished")>=0?n.end=r:t.push(new zt(e,r))}),n.start&&n.end?(n.start.FormattedEnd=n.end.Formatted,t.push(new zt(this,n.start))):n.start?t.push(new zt(this,n.start)):n.end&&t.push(new zt(this,n.end)),t},enumerable:!1,configurable:!0}),t.prototype.update=function(e){var t=this;for(var n in this.set(e),this.CAttributes.forEach(function(e){t._attributeMap[e.Name]=e}),this.Properties.Property=[],this._attributeMap)this._attributeMap.hasOwnProperty(n)&&this.Properties.Property.push(this._attributeMap[n].properties)},t.prototype.parentScope=function(){var e=this.ScopeName.split(":");return e.pop(),e.join(":")},t.prototype.children=function(e){return arguments.length?(this._children=e,this):this._children},t.prototype.walk=function(e){if(e.start(this))return!0;for(var t=0,n=this.children();t<n.length;t++){if(n[t].walk(e))return!0}return e.end(this)},t.prototype.formattedAttrs=function(){var e={};for(var t in this._attributeMap)e[t]=this._attributeMap[t].Formatted||this._attributeMap[t].RawValue;return e},t.prototype.rawAttrs=function(){var e={};for(var t in this._attributeMap)e[t]=this._attributeMap[t].RawValue;return e},t.prototype.hasAttr=function(e){return void 0!==this._attributeMap[e]},t.prototype.attr=function(e){return this._attributeMap[e]||new zt(this,{Creator:"",CreatorType:"",Formatted:"",Measure:"",Name:"",RawValue:""})},t.prototype.attrMeasure=function(e){return this._attributeMap[e].Measure},t.prototype.calcTooltip=function(e){var t="",n=[];t=this.Id,n.push('<tr><td class="key">ID:</td><td class="value">'+this.Id+"</td></tr>"),e&&n.push('<tr><td class="key">Parent ID:</td><td class="value">'+e.Id+"</td></tr>"),n.push('<tr><td class="key">Scope:</td><td class="value">'+this.ScopeName+"</td></tr>");var r=this.formattedAttrs();for(var o in r)"Label"===o?t=r[o]:n.push('<tr><td class="key">'+o+'</td><td class="value">'+r[o]+"</td></tr>");return'<div class="eclwatch_WUGraph_Tooltip" style="max-width:480px">\n <h4 align="center">'+t+"</h4>\n <table>\n "+n.join("")+"\n </table>\n </div>"},t}(t.StateObject),Kt=function(e){function t(t,n){var r=e.call(this,n)||this;return r.wu=t,r}return r(t,e),t}(Jt),Zt=function(e){function t(t,n,r){var i=e.call(this)||this;return i.connection=t instanceof B?t:new B(t),i.set(o({Wuid:n},r)),i}return r(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FileCluster",{get:function(){return this.get("FileCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsSuperFile",{get:function(){return this.get("IsSuperFile")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Subs",{get:function(){return this.get("Subs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.get("Count")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ECLSourceFiles",{get:function(){return this.get("ECLSourceFiles")},enumerable:!1,configurable:!0}),t}(t.StateObject),$t=function(e){function n(n,r,i){var u=e.call(this)||this;u.connection=n instanceof B?n:new B(n);var c=t.espTime2Seconds(i.Value);return u.set(o({Wuid:r,Seconds:Math.round(1e3*c)/1e3,HasSubGraphId:void 0!==i.SubGraphId},i)),u}return r(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Value",{get:function(){return this.get("Value")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Seconds",{get:function(){return this.get("Seconds")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"GraphName",{get:function(){return this.get("GraphName")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SubGraphId",{get:function(){return this.get("SubGraphId")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HasSubGraphId",{get:function(){return this.get("HasSubGraphId")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this.get("count")},enumerable:!1,configurable:!0}),n}(t.StateObject),en=fe("%Y-%m-%dT%H:%M:%S.%LZ"),tn=le("%Y-%m-%dT%H:%M:%S.%LZ"),nn=t.scopedLogger("workunit.ts"),rn=e.WUStateID,on=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Wuid})||this}return r(t,e),t}(t.Cache),un=new on,cn=function(n){function c(e,t){var r=n.call(this)||this;return r._debugMode=!1,r._resultCache=new Yt,r._graphCache=new Ut,r.connection=new B(e),r.topologyConnection=new V(e),r.clearState(t),r}return r(c,n),Object.defineProperty(c.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Owner",{get:function(){return this.get("Owner","")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Cluster",{get:function(){return this.get("Cluster","")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Jobname",{get:function(){return this.get("Jobname","")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Description",{get:function(){return this.get("Description","")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ActionEx",{get:function(){return this.get("ActionEx","")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"StateID",{get:function(){return this.get("StateID",e.WUStateID.Unknown)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"State",{get:function(){return this.get("State")||e.WUStateID[this.StateID]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Protected",{get:function(){return this.get("Protected",!1)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Exceptions",{get:function(){return this.get("Exceptions",{ECLException:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResultViews",{get:function(){return this.get("ResultViews",[])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResultCount",{get:function(){return this.get("ResultCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Results",{get:function(){return this.get("Results",{ECLResult:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"CResults",{get:function(){var e=this;return this.Results.ECLResult.map(function(t){return e._resultCache.get(t,function(){return new Xt(e.connection,e.Wuid,t,e.ResultViews)})})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"SequenceResults",{get:function(){var e={};return this.CResults.forEach(function(t){e[t.Sequence]=t}),e},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Timers",{get:function(){return this.get("Timers",{ECLTimer:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"CTimers",{get:function(){var e=this;return this.Timers.ECLTimer.map(function(t){return new $t(e.connection,e.Wuid,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"GraphCount",{get:function(){return this.get("GraphCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Graphs",{get:function(){return this.get("Graphs",{ECLGraph:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"CGraphs",{get:function(){var e=this;return this.Graphs.ECLGraph.map(function(t){return e._graphCache.get(t,function(){return new Ot(e,t,e.CTimers)})})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ThorLogList",{get:function(){return this.get("ThorLogList")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResourceURLCount",{get:function(){return this.get("ResourceURLCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResourceURLs",{get:function(){return this.get("ResourceURLs",{URL:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"CResourceURLs",{get:function(){var e=this;return this.ResourceURLs.URL.map(function(t){return new Mt(e,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"TotalClusterTime",{get:function(){return this.get("TotalClusterTime","")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DateTimeScheduled",{get:function(){return this.get("DateTimeScheduled")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"IsPausing",{get:function(){return this.get("IsPausing")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ThorLCR",{get:function(){return this.get("ThorLCR")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ApplicationValues",{get:function(){return this.get("ApplicationValues",{ApplicationValue:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"HasArchiveQuery",{get:function(){return this.get("HasArchiveQuery")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"StateEx",{get:function(){return this.get("StateEx")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"PriorityClass",{get:function(){return this.get("PriorityClass")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"PriorityLevel",{get:function(){return this.get("PriorityLevel")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Snapshot",{get:function(){return this.get("Snapshot")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResultLimit",{get:function(){return this.get("ResultLimit")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"EventSchedule",{get:function(){return this.get("EventSchedule")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"HaveSubGraphTimings",{get:function(){return this.get("HaveSubGraphTimings")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Query",{get:function(){return this.get("Query")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"HelpersCount",{get:function(){return this.get("HelpersCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Helpers",{get:function(){return this.get("Helpers",{ECLHelpFile:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DebugValues",{get:function(){return this.get("DebugValues")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"AllowedClusters",{get:function(){return this.get("AllowedClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ErrorCount",{get:function(){return this.get("ErrorCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"WarningCount",{get:function(){return this.get("WarningCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"InfoCount",{get:function(){return this.get("InfoCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"AlertCount",{get:function(){return this.get("AlertCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"SourceFileCount",{get:function(){return this.get("SourceFileCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"SourceFiles",{get:function(){return this.get("SourceFiles",{ECLSourceFile:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"CSourceFiles",{get:function(){var e=this;return this.SourceFiles.ECLSourceFile.map(function(t){return new Zt(e.connection,e.Wuid,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"VariableCount",{get:function(){return this.get("VariableCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Variables",{get:function(){return this.get("Variables",{ECLResult:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"TimerCount",{get:function(){return this.get("TimerCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"HasDebugValue",{get:function(){return this.get("HasDebugValue")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ApplicationValueCount",{get:function(){return this.get("ApplicationValueCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"XmlParams",{get:function(){return this.get("XmlParams")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"AccessFlag",{get:function(){return this.get("AccessFlag")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ClusterFlag",{get:function(){return this.get("ClusterFlag")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResultViewCount",{get:function(){return this.get("ResultViewCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DebugValueCount",{get:function(){return this.get("DebugValueCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"WorkflowCount",{get:function(){return this.get("WorkflowCount",0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Archived",{get:function(){return this.get("Archived")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"RoxieCluster",{get:function(){return this.get("RoxieCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DebugState",{get:function(){return this.get("DebugState",{})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Queue",{get:function(){return this.get("Queue")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Active",{get:function(){return this.get("Active")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Action",{get:function(){return this.get("Action")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Scope",{get:function(){return this.get("Scope")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"AbortBy",{get:function(){return this.get("AbortBy")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"AbortTime",{get:function(){return this.get("AbortTime")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"Workflows",{get:function(){return this.get("Workflows")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"TimingData",{get:function(){return this.get("TimingData")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"HelpersDesc",{get:function(){return this.get("HelpersDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"GraphsDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"SourceFilesDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ResultsDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"VariablesDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"TimersDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DebugValuesDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ApplicationValuesDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"WorkflowsDesc",{get:function(){return this.get("GraphsDesc")},enumerable:!1,configurable:!0}),c.create=function(e){var t=new c(e);return t.connection.WUCreate().then(function(e){return un.set(t),t.set(e.Workunit),t})},c.attach=function(e,t,n){var r=un.get({BaseUrl:e.baseUrl,Wuid:t},function(){return new c(e,t)});return n&&r.set(n),r},c.existsLocal=function(e,t){return un.has({BaseUrl:e,Wuid:t})},c.submit=function(e,t,n){return c.create(e).then(function(e){return e.update({QueryText:n})}).then(function(e){return e.submit(t)})},c.query=function(e,t){return new B(e).WUQuery(t).then(function(t){return t.Workunits.ECLWorkunit.map(function(t){return c.attach(e,t.Wuid,t)})})},c.prototype.clearState=function(e){this.clear({Wuid:e,StateID:rn.Unknown})},c.prototype.update=function(e){var t=this;return this.connection.WUUpdate(o(o({},e),{Wuid:this.Wuid,StateOrig:this.State,JobnameOrig:this.Jobname,DescriptionOrig:this.Description,ProtectedOrig:this.Protected,ClusterOrig:this.Cluster})).then(function(e){return t.set(e.Workunit),t})},c.prototype.submit=function(t,n,r){var o,i=this;return void 0===n&&(n=e.WUUpdate.Action.Run),o=void 0!==t?Promise.resolve(t):this.topologyConnection.DefaultTpLogicalClusterQuery().then(function(e){return e.Name}),this._debugMode=!1,n===e.WUUpdate.Action.Debug&&(n=e.WUUpdate.Action.Run,this._debugMode=!0),o.then(function(e){return i.connection.WUUpdate({Wuid:i.Wuid,Action:n,ResultLimit:r,DebugValues:{DebugValue:[{Name:"Debug",Value:i._debugMode?"1":""}]}}).then(function(t){return i.set(t.Workunit),i._submitAction=n,i.connection.WUSubmit({Wuid:i.Wuid,Cluster:e})})}).then(function(){return i})},c.prototype.isComplete=function(){switch(this.StateID){case rn.Compiled:return"compile"===this.ActionEx||this._submitAction===e.WUUpdate.Action.Compile;case rn.Completed:case rn.Failed:case rn.Aborted:case rn.NotFound:return!0}return!1},c.prototype.isFailed=function(){switch(this.StateID){case rn.Aborted:case rn.Failed:return!0}return!1},c.prototype.isDeleted=function(){switch(this.StateID){case rn.NotFound:return!0}return!1},c.prototype.isDebugging=function(){switch(this.StateID){case rn.DebugPaused:case rn.DebugRunning:return!0}return this._debugMode},c.prototype.isRunning=function(){switch(this.StateID){case rn.Compiled:case rn.Running:case rn.Aborting:case rn.Blocked:case rn.DebugPaused:case rn.DebugRunning:return!0}return!1},c.prototype.setToFailed=function(){return this.WUAction("SetToFailed")},c.prototype.pause=function(){return this.WUAction("Pause")},c.prototype.pauseNow=function(){return this.WUAction("PauseNow")},c.prototype.resume=function(){return this.WUAction("Resume")},c.prototype.abort=function(){return this.WUAction("Abort")},c.prototype.delete=function(){return this.WUAction("Delete")},c.prototype.restore=function(){return this.WUAction("Restore")},c.prototype.deschedule=function(){return this.WUAction("Deschedule")},c.prototype.reschedule=function(){return this.WUAction("Reschedule")},c.prototype.resubmit=function(){var e=this;return this.WUResubmit({CloneWorkunit:!1,ResetWorkflow:!1}).then(function(){return e.clearState(e.Wuid),e.refresh().then(function(){return e._monitor(),e})})},c.prototype.clone=function(){var e=this;return this.WUResubmit({CloneWorkunit:!0,ResetWorkflow:!1}).then(function(t){return c.attach(e.connection.connection(),t.WUs.WU[0].WUID).refresh()})},c.prototype.refreshState=function(){return i(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.WUQuery()];case 1:return e.sent(),[2,this]}})})},c.prototype.refreshInfo=function(){return i(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.WUInfo()];case 1:return e.sent(),[2,this]}})})},c.prototype.refreshDebug=function(){return i(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.debugStatus()];case 1:return e.sent(),[2,this]}})})},c.prototype.refresh=function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return e?[4,Promise.all([this.refreshInfo(),this.refreshDebug()])]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.refreshState()];case 3:t.sent(),t.label=4;case 4:return[2,this]}})})},c.prototype.eclExceptions=function(){return this.Exceptions.ECLException},c.prototype.fetchArchive=function(){return this.connection.WUFile({Wuid:this.Wuid,Type:"ArchiveQuery"})},c.prototype.fetchECLExceptions=function(){var e=this;return this.WUInfo({IncludeExceptions:!0}).then(function(){return e.eclExceptions()})},c.prototype.fetchResults=function(){var e=this;return this.WUInfo({IncludeResults:!0}).then(function(){return e.CResults})},c.prototype.fetchGraphs=function(){var e=this;return this.WUInfo({IncludeGraphs:!0}).then(function(){return e.CGraphs})},c.prototype.fetchDetailsMeta=function(e){return void 0===e&&(e={}),this.WUDetailsMeta(e)},c.prototype.fetchDetailsRaw=function(e){return void 0===e&&(e={}),this.WUDetails(e).then(function(e){return e.Scopes.Scope})},c.prototype.fetchDetailsNormalized=function(e){return void 0===e&&(e={}),Promise.all([this.fetchDetailsMeta(),this.fetchDetailsRaw(e)]).then(function(e){for(var t=e[0],n={id:{Measure:"label"},name:{Measure:"label"},type:{Measure:"label"}},r=[],i=0,u=e[1];i<u.length;i++){var c=u[i],s={};if(c&&c.Id&&c.Properties&&c.Properties.Property){for(var a in c.Properties.Property){var p=c.Properties.Property[a];switch("ns"===p.Measure&&(p.Measure="s"),n[p.Name]=o({},p),delete n[p.Name].RawValue,delete n[p.Name].Formatted,p.Measure){case"bool":s[p.Name]=!!+p.RawValue;break;case"sz":s[p.Name]=+p.RawValue;break;case"s":s[p.Name]=+p.RawValue/1e9;break;case"ns":s[p.Name]=+p.RawValue;break;case"ts":s[p.Name]=new Date(+p.RawValue/1e3).toISOString();break;case"cnt":s[p.Name]=+p.RawValue;break;case"cpu":case"skw":case"node":case"ppm":case"ip":case"cy":case"en":case"txt":case"id":case"fname":default:s[p.Name]=p.RawValue}}r.push(o({id:c.Id,name:c.ScopeName,type:c.ScopeType},s))}}return{meta:t,columns:n,data:r}})},c.prototype.fetchDetails=function(e){var t=this;return void 0===e&&(e={}),this.WUDetails(e).then(function(e){return e.Scopes.Scope.map(function(e){return new Kt(t,e)})})},c.prototype.fetchDetailsHierarchy=function(e){var t=this;return void 0===e&&(e={}),this.WUDetails(e).then(function(e){var n=[],r={};for(var o in e.Scopes.Scope.forEach(function(e){if(r[e.ScopeName])return r[e.ScopeName].update(e),null;var n=new Kt(t,e);return r[n.ScopeName]=n,n}),r)if(r.hasOwnProperty(o)){var i=r[o],u=i.parentScope();u&&r[u]?r[u].children().push(i):n.push(i)}return n})},c.prototype.fetchGraphDetails=function(e,t){return void 0===e&&(e=[]),this.fetchDetails({ScopeFilter:{MaxDepth:999999,Ids:e,ScopeTypes:t},NestedFilter:{Depth:999999,ScopeTypes:["graph","subgraph","activity","edge"]},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}})},c.prototype.fetchScopeGraphs=function(e){return void 0===e&&(e=[]),this.fetchGraphDetails(e,["graph"]).then(function(e){return At(e)})},c.prototype.fetchTimeElapsed=function(){return this.fetchDetails({ScopeFilter:{PropertyFilters:{PropertyFilter:[{Name:"TimeElapsed"}]}}}).then(function(e){var t={};e.forEach(function(e){t[e.ScopeName]=t[e.ScopeName]||{scope:e.ScopeName,start:null,elapsed:null,finish:null},e.CAttributes.forEach(function(n){"TimeElapsed"===n.Name?t[e.ScopeName].elapsed=+n.RawValue:"ts"===n.Measure&&n.Name.indexOf("Started")>=0&&(t[e.ScopeName].start=n.Formatted)})});var n=[];for(var r in t){var o=t[r];if(o.start&&o.elapsed){var i=tn(o.start);i.setMilliseconds(i.getMilliseconds()+o.elapsed/1e6),o.finish=en(i),n.push(o)}}return n.sort(function(e,t){return e.start<t.start?-1:e.start>t.start?1:0}),n})},c.prototype._monitor=function(){this.isComplete()?this._monitorTickCount=0:n.prototype._monitor.call(this)},c.prototype._monitorTimeoutDuraction=function(){var e=n.prototype._monitorTimeoutDuraction.call(this);return this._monitorTickCount<=1?1e3:this._monitorTickCount<=3?3e3:this._monitorTickCount<=5?5e3:this._monitorTickCount<=7?1e4:e},c.prototype.on=function(e,t,r){var o=this;if(this.isCallback(t))switch(e){case"completed":n.prototype.on.call(this,"propChanged","StateID",function(e){o.isComplete()&&t([e])});break;case"changed":n.prototype.on.call(this,e,t)}else switch(e){case"changed":n.prototype.on.call(this,e,t,r)}return this._monitor(),this},c.prototype.watchUntilComplete=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),t.isComplete()&&(o.release(),n(t))})})},c.prototype.watchUntilRunning=function(e){var t=this;return new Promise(function(n,r){var o=t.watch(function(r){e&&e(r),(t.isComplete()||t.isRunning())&&(o.release(),n(t))})})},c.prototype.WUQuery=function(e){var t=this;return void 0===e&&(e={}),this.connection.WUQuery(o(o({},e),{Wuid:this.Wuid})).then(function(e){return t.set(e.Workunits.ECLWorkunit[0]),e}).catch(function(e){if(!e.Exception.some(function(e){return 20081===e.Code&&(t.clearState(t.Wuid),t.set("StateID",rn.NotFound),!0)}))throw nn.warning("Unexpected exception: "),e;return{}})},c.prototype.WUCreate=function(){var e=this;return this.connection.WUCreate().then(function(t){return e.set(t.Workunit),un.set(e),t})},c.prototype.WUInfo=function(e){var t=this;void 0===e&&(e={});var n=e.IncludeResults||e.IncludeResultsViewNames;return this.connection.WUInfo(o(o({},e),{Wuid:this.Wuid,IncludeResults:n,IncludeResultsViewNames:n,SuppressResultSchemas:!1})).then(function(e){return t.set(e.Workunit),n&&t.set({ResultViews:e.ResultViews}),e}).catch(function(e){if(!e.Exception.some(function(e){return 20080===e.Code&&(t.clearState(t.Wuid),t.set("StateID",rn.NotFound),!0)}))throw nn.warning("Unexpected exception: "),e;return{}})},c.prototype.WUResubmit=function(e){return this.connection.WUResubmit(t.deepMixinT({},e,{Wuids:[this.Wuid]}))},c.prototype.WUDetailsMeta=function(e){return this.connection.WUDetailsMeta(e)},c.prototype.WUDetails=function(e){return this.connection.WUDetails(t.deepMixinT({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(function(e){return t.deepMixinT({Scopes:{Scope:[]}},e)})},c.prototype.WUAction=function(e){var t=this;return this.connection.WUAction({Wuids:[this.Wuid],WUActionType:e}).then(function(e){return t.refresh().then(function(){return t._monitor(),e})})},c.prototype.publish=function(e){return this.connection.WUPublishWorkunit({Wuid:this.Wuid,Cluster:this.Cluster,JobName:e||this.Jobname,AllowForeignFiles:!0,Activate:!0,Wait:5e3})},c.prototype.WUCDebug=function(e,t){void 0===t&&(t={});var n="";for(var r in t)t.hasOwnProperty(r)&&(n+=" "+r+"='"+t[r]+"'");return this.connection.WUCDebug({Wuid:this.Wuid,Command:"<debug:"+e+" uid='"+this.Wuid+"'"+n+"/>"}).then(function(e){return e})},c.prototype.debug=function(e,n){return this.isDebugging()?this.WUCDebug(e,n).then(function(n){var r=n.children(e);return r.length?r[0]:new t.XMLNode(e)}).catch(function(n){return nn.error(n),Promise.resolve(new t.XMLNode(e))}):Promise.resolve(new t.XMLNode(e))},c.prototype.debugStatus=function(){var e=this;return this.isDebugging()?this.debug("status").then(function(t){var n=o(o({},e.DebugState),t.$);return e.set({DebugState:n}),t}):Promise.resolve({DebugState:{state:"unknown"}})},c.prototype.debugContinue=function(e){return void 0===e&&(e=""),this.debug("continue",{mode:e})},c.prototype.debugStep=function(e){return this.debug("step",{mode:e})},c.prototype.debugPause=function(){return this.debug("interrupt")},c.prototype.debugQuit=function(){return this.debug("quit")},c.prototype.debugDeleteAllBreakpoints=function(){return this.debug("delete",{idx:0})},c.prototype.debugBreakpointResponseParser=function(e){return e.children().map(function(e){if("break"===e.name)return e.$})},c.prototype.debugBreakpointAdd=function(e,t,n){var r=this;return this.debug("breakpoint",{id:e,mode:t,action:n}).then(function(e){return r.debugBreakpointResponseParser(e)})},c.prototype.debugBreakpointList=function(){var e=this;return this.debug("list").then(function(t){return e.debugBreakpointResponseParser(t)})},c.prototype.debugGraph=function(){var e=this;return this._debugAllGraph&&this.DebugState._prevGraphSequenceNum===this.DebugState.graphSequenceNum?Promise.resolve(this._debugAllGraph):this.debug("graph",{name:"all"}).then(function(t){return e.DebugState._prevGraphSequenceNum=e.DebugState.graphSequenceNum,e._debugAllGraph=_t(e.Wuid,t),e._debugAllGraph})},c.prototype.debugBreakpointValid=function(e){return this.debugGraph().then(function(t){return function(e,t){for(var n=[],r=0,o=e.vertices;r<o.length;r++){var i=o[r];if(an(i)){var u=pn(i);(u&&!t||t===u.file)&&n.push(u)}}return n.sort(function(e,t){return e.line-t.line})}(t,e)})},c.prototype.debugPrint=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=10),this.debug("print",{edgeID:e,startRow:t,numRows:n}).then(function(e){return e.children().map(function(e){var t={};return e.children().forEach(function(e){t[e.name]=e.content}),t})})},c}(t.StateObject),sn="definition";function an(e){return void 0!==e._[sn]}function pn(e){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(e._[sn]);if(t){var n=t[1],r=t[2],o=t[3];return n.replace("/./","/"),{id:e._.id,file:n,line:+r,column:+o}}throw new Error("Bad definition: "+e._[sn])}var fn=function(e){function n(n){var r=e.call(this)||this;return r.lazyRefresh=t.debounce(function(){return i(r,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.connection.Activity({})];case 1:return e=t.sent(),this.set(e),[2,this]}})})}),r.connection=n instanceof L?n:new L(n),r.clear({}),r}return r(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Exceptions",{get:function(){return this.get("Exceptions")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Build",{get:function(){return this.get("Build")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ThorClusterList",{get:function(){return this.get("ThorClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RoxieClusterList",{get:function(){return this.get("RoxieClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HThorClusterList",{get:function(){return this.get("HThorClusterList")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"DFUJobs",{get:function(){return this.get("DFUJobs")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Running",{get:function(){return this.get("Running",{ActiveWorkunit:[]})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerContent",{get:function(){return this.get("BannerContent")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerColor",{get:function(){return this.get("BannerColor")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerSize",{get:function(){return this.get("BannerSize")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"BannerScroll",{get:function(){return this.get("BannerScroll")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ChatURL",{get:function(){return this.get("ChatURL")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowBanner",{get:function(){return this.get("ShowBanner")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShowChatURL",{get:function(){return this.get("ShowChatURL")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SortBy",{get:function(){return this.get("SortBy")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Descending",{get:function(){return this.get("Descending")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"SuperUser",{get:function(){return this.get("SuperUser")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"AccessRight",{get:function(){return this.get("AccessRight")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ServerJobQueues",{get:function(){return this.get("ServerJobQueues")},enumerable:!1,configurable:!0}),n.attach=function(e,t){return Qt||(Qt=new n(e)),t&&Qt.set(o({},t)),Qt},n.prototype.runningWorkunits=function(e){var t=this;return void 0===e&&(e=""),this.Running.ActiveWorkunit.filter(function(t){return""===e||t.ClusterName===e}).map(function(e){return cn.attach(t.connection.connectionOptions(),e.Wuid,e)})},n.prototype.refresh=function(){return i(this,void 0,void 0,function(){return u(this,function(e){return[2,this.lazyRefresh()]})})},n}(t.StateObject),ln=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Cluster+"-"+e.Name})||this}return r(t,e),t}(t.Cache),hn=new ln,gn=function(e){function t(t,n,r){var o=e.call(this)||this;return o.connection=t instanceof j?t:new j(t),o.clear({Cluster:n,Name:r}),o}return r(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Cluster",{get:function(){return this.get("Cluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Filename",{get:function(){return this.get("Filename")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Prefix",{get:function(){return this.get("Prefix")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"NodeGroup",{get:function(){return this.get("NodeGroup")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"NumParts",{get:function(){return this.get("NumParts")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Description",{get:function(){return this.get("Description")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dir",{get:function(){return this.get("Dir")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PathMask",{get:function(){return this.get("PathMask")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Filesize",{get:function(){return this.get("Filesize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FileSizeInt64",{get:function(){return this.get("FileSizeInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordSize",{get:function(){return this.get("RecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordCount",{get:function(){return this.get("RecordCount")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordSizeInt64",{get:function(){return this.get("RecordSizeInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RecordCountInt64",{get:function(){return this.get("RecordCountInt64")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Owner",{get:function(){return this.get("Owner")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"JobName",{get:function(){return this.get("JobName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Persistent",{get:function(){return this.get("Persistent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Format",{get:function(){return this.get("Format")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MaxRecordSize",{get:function(){return this.get("MaxRecordSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvSeparate",{get:function(){return this.get("CsvSeparate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvQuote",{get:function(){return this.get("CsvQuote")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvTerminate",{get:function(){return this.get("CsvTerminate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CsvEscape",{get:function(){return this.get("CsvEscape")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Modified",{get:function(){return this.get("Modified")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ecl",{get:function(){return this.get("Ecl")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Stat",{get:function(){return this.get("Stat")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DFUFilePartsOnClusters",{get:function(){return this.get("DFUFilePartsOnClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSuperfile",{get:function(){return this.get("isSuperfile")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ShowFileContent",{get:function(){return this.get("ShowFileContent")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subfiles",{get:function(){return this.get("subfiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Superfiles",{get:function(){return this.get("Superfiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProtectList",{get:function(){return this.get("ProtectList")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"FromRoxieCluster",{get:function(){return this.get("FromRoxieCluster")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Graphs",{get:function(){return this.get("Graphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UserPermission",{get:function(){return this.get("UserPermission")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ContentType",{get:function(){return this.get("ContentType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CompressedFileSize",{get:function(){return this.get("CompressedFileSize")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PercentCompressed",{get:function(){return this.get("PercentCompressed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsCompressed",{get:function(){return this.get("IsCompressed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BrowseData",{get:function(){return this.get("BrowseData")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsonInfo",{get:function(){return this.get("jsonInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"binInfo",{get:function(){return this.get("binInfo")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PackageID",{get:function(){return this.get("PackageID")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Partition",{get:function(){return this.get("Partition")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Blooms",{get:function(){return this.get("Blooms")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ExpireDays",{get:function(){return this.get("ExpireDays")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"KeyType",{get:function(){return this.get("KeyType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){return hn.get({BaseUrl:e.baseUrl,Cluster:n,Name:r},function(){return new t(e,n,r)})},t.prototype.fetchInfo=function(){var e=this;return this.connection.DFUInfo({Cluster:this.Cluster,Name:this.Name}).then(function(t){return e.set(o({Cluster:e.Cluster},t.FileDetail)),t.FileDetail})},t}(t.StateObject),dn=function(e){function t(){return e.call(this,function(e){return e.Address})||this}return r(t,e),t}(t.Cache),bn=new dn,yn=function(e){function t(t){var n=e.call(this)||this;return n.connection=t instanceof F?t:new F(t),n}return r(t,e),Object.defineProperty(t.prototype,"Address",{get:function(){return this.get("Address")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ConfigAddress",{get:function(){return this.get("ConfigAddress")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProcessType",{get:function(){return this.get("ProcessType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DisplayType",{get:function(){return this.get("DisplayType")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Description",{get:function(){return this.get("Description")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AgentVersion",{get:function(){return this.get("AgentVersion")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Contact",{get:function(){return this.get("Contact")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Location",{get:function(){return this.get("Location")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UpTime",{get:function(){return this.get("UpTime")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentName",{get:function(){return this.get("ComponentName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentPath",{get:function(){return this.get("ComponentPath")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RoxieState",{get:function(){return this.get("RoxieState")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RoxieStateDetails",{get:function(){return this.get("RoxieStateDetails")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"OS",{get:function(){return this.get("OS")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ProcessNumber",{get:function(){return this.get("ProcessNumber")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Processors",{get:function(){return this.get("Processors")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Storage",{get:function(){return this.get("Storage")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Running",{get:function(){return this.get("Running")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PhysicalMemory",{get:function(){return this.get("PhysicalMemory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VirtualMemory",{get:function(){return this.get("VirtualMemory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ComponentInfo",{get:function(){return this.get("ComponentInfo")},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var o=bn.get({Address:n},function(){return new t(e)});return r&&o.set(r),o},t}(t.StateObject),mn=new(function(e){function n(){return e.call(this,function(e){return t.Cache.hash([e.QueryId,e.QuerySet])})||this}return r(n,e),n}(t.Cache)),vn=function(e){function t(t,n,r,i){var u=e.call(this)||this;return u.connection=t instanceof x?t:new x(t),u.set(o({QuerySet:n,QueryId:r},i)),u}return r(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Exceptions",{get:function(){return this.get("Exceptions")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QueryId",{get:function(){return this.get("QueryId")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QuerySet",{get:function(){return this.get("QuerySet")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"QueryName",{get:function(){return this.get("QueryName")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wuid",{get:function(){return this.get("Wuid")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dll",{get:function(){return this.get("Dll")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Suspended",{get:function(){return this.get("Suspended")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Activated",{get:function(){return this.get("Activated")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SuspendedBy",{get:function(){return this.get("SuspendedBy")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Clusters",{get:function(){return this.get("Clusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PublishedBy",{get:function(){return this.get("PublishedBy")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Comment",{get:function(){return this.get("Comment")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LogicalFiles",{get:function(){return this.get("LogicalFiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SuperFiles",{get:function(){return this.get("SuperFiles")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsLibrary",{get:function(){return this.get("IsLibrary")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Priority",{get:function(){return this.get("Priority")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUSnapShot",{get:function(){return this.get("WUSnapShot")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CompileTime",{get:function(){return this.get("CompileTime")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LibrariesUsed",{get:function(){return this.get("LibrariesUsed")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CountGraphs",{get:function(){return this.get("CountGraphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ResourceURLCount",{get:function(){return this.get("ResourceURLCount")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WsEclAddresses",{get:function(){return this.get("WsEclAddresses")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUGraphs",{get:function(){return this.get("WUGraphs")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"WUTimers",{get:function(){return this.get("WUTimers")},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){return mn.get({BaseUrl:e.baseUrl,QuerySet:n,QueryId:r},function(){return new t(e,n,r)})},t.prototype.fetchRequestSchema=function(){return i(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return e=this,[4,this.connection.requestJson(this.QuerySet,this.QueryId)];case 1:return e._requestSchema=t.sent(),[2]}})})},t.prototype.fetchResponseSchema=function(){return i(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return e=this,[4,this.connection.responseJson(this.QuerySet,this.QueryId)];case 1:return e._responseSchema=t.sent(),[2]}})})},t.prototype.fetchSchema=function(){return i(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.fetchRequestSchema(),this.fetchResponseSchema()])];case 1:return e.sent(),[2]}})})},t.prototype.submit=function(e){return this.connection.submit(this.QuerySet,this.QueryId,e).then(function(e){for(var t in e)e[t]=e[t].Row;return e})},t.prototype.refresh=function(){return i(this,void 0,void 0,function(){var e=this;return u(this,function(t){return[2,this.fetchSchema().then(function(t){return e})]})})},t.prototype.requestFields=function(){return this._requestSchema?this._requestSchema:[]},t.prototype.responseFields=function(){return this._responseSchema?this._responseSchema:{}},t.prototype.resultNames=function(){var e=[];for(var t in this.responseFields())e.push(t);return e},t.prototype.resultFields=function(e){return this._responseSchema[e]?this._responseSchema[e]:[]},t}(t.StateObject),Sn=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Name+":"+e.UserSpecific+"-"+e.Namespace})||this}return r(t,e),t}(t.Cache),Pn=new Sn,Cn=function(e){function t(t,n,r){var o=e.call(this)||this;return o.key=t,o.value=n,o.oldValue=r,o}return r(t,e),Object.defineProperty(t.prototype,"canConflate",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.conflate=function(e){return this.key===e.key&&(this.value=e.value,!0)},t.prototype.void=function(){return this.value===this.oldValue},t}(t.Message),On=function(){function e(e,n,r,o){this._dispatch=new t.Dispatch,this._knownValues={},this.connection=e instanceof k?e:new k(e),this.Name=n,this.UserSpecific=o,this.Namespace=r}return Object.defineProperty(e.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),e.attach=function(t,n,r,o){return void 0===n&&(n="HPCCApps"),void 0===o&&(o=!0),Pn.get({BaseUrl:t.baseUrl,Name:n,UserSpecific:o,Namespace:r},function(){return new e(t,n,r,o)})},e.prototype.create=function(){this.connection.CreateStore({Name:this.Name,UserSpecific:this.UserSpecific,Type:"",Description:""})},e.prototype.set=function(e,t,n){var r=this;return void 0===n&&(n=!0),this.connection.Set({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e,Value:t}).then(function(o){var i=r._knownValues[e];r._knownValues[e]=t,n&&r._dispatch.post(new Cn(e,t,i))}).catch(function(n){console.error('Store.set("'+e+'", "'+t+'") failed:',n)})},e.prototype.get=function(e,t){var n=this;return void 0===t&&(t=!0),this.connection.Fetch({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(function(r){var o=n._knownValues[e];return n._knownValues[e]=r.Value,t&&n._dispatch.post(new Cn(e,r.Value,o)),r.Value}).catch(function(t){console.error("Store.get("+e+") failed:",t)})},e.prototype.getAll=function(e){var t=this;return void 0===e&&(e=!0),this.connection.FetchAll({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace}).then(function(n){var r={},o=t._knownValues;if(t._knownValues={},n.Pairs.Pair.forEach(function(n){var i=t._knownValues[n.Key];t._knownValues[n.Key]=n.Value,delete o[n.Key],r[n.Key]=n.Value,e&&t._dispatch.post(new Cn(n.Key,n.Value,i))}),e)for(var i in o)t._dispatch.post(new Cn(i,void 0,o[i]));return r}).catch(function(e){return console.error("Store.getAll failed:",e),{}})},e.prototype.delete=function(e,t){var n=this;return void 0===t&&(t=!0),this.connection.Delete({StoreName:this.Name,UserSpecific:this.UserSpecific,Namespace:this.Namespace,Key:e}).then(function(r){var o=n._knownValues[e];delete n._knownValues[e],t&&n._dispatch.post(new Cn(e,void 0,o))}).catch(function(t){console.error("Store.delete("+e+") failed:",t)})},e.prototype.monitor=function(e){return this._dispatch.attach(e)},e}(),Un=function(e){function t(){return e.call(this,function(e){return e.BaseUrl+"-"+e.Name})||this}return r(t,e),t}(t.Cache),jn=new Un,wn=function(e){function t(t,n){var r=e.call(this)||this;return t instanceof V?(r.connection=t,r.machineConnection=new F(t.connectionOptions())):(r.connection=new V(t),r.machineConnection=new F(t)),r.clear({Name:n}),r}return r(t,e),Object.defineProperty(t.prototype,"BaseUrl",{get:function(){return this.connection.baseUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Name",{get:function(){return this.get("Name")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Prefix",{get:function(){return this.get("Prefix")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.get("Type")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"IsDefault",{get:function(){return this.get("IsDefault")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpClusters",{get:function(){return this.get("TpClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclCCServers",{get:function(){return this.get("TpEclCCServers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclServers",{get:function(){return this.get("TpEclServers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclAgents",{get:function(){return this.get("TpEclAgents")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TpEclSchedulers",{get:function(){return this.get("TpEclSchedulers")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"MachineInfoEx",{get:function(){return this.get("MachineInfoEx",[])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMachineInfoEx",{get:function(){var e=this;return this.MachineInfoEx.map(function(t){return yn.attach(e.machineConnection,t.Address,t)})},enumerable:!1,configurable:!0}),t.attach=function(e,n,r){var i=jn.get({BaseUrl:e.baseUrl,Name:n},function(){return new t(e,n)});return r&&i.set(o({},r)),i},t.prototype.fetchMachines=function(e){var t=this;return void 0===e&&(e={}),this.machineConnection.GetTargetClusterInfo(o({TargetClusters:{Item:[this.Type+":"+this.Name]}},e)).then(function(e){for(var n=[],r=0,o=e.TargetClusterInfoList.TargetClusterInfo;r<o.length;r++)for(var i=0,u=o[r].Processes.MachineInfoEx;i<u.length;i++){var c=u[i];n.push(c)}return t.set("MachineInfoEx",n),t.CMachineInfoEx})},t.prototype.machineStats=function(){for(var e=0,t=0,n=0,r=0,o=this.CMachineInfoEx;r<o.length;r++)for(var i=0,u=o[r].Storage.StorageInfo;i<u.length;i++){var c=u[i];t+=c.Available,n+=c.Total;var s=1-c.Available/c.Total;s>e&&(e=s)}return{maxDisk:e,meanDisk:1-(n?t/n:1)}},t.prototype.fetchUsage=function(){return this.machineConnection.GetTargetClusterUsageEx([this.Name])},t}(t.StateObject);var Tn={};var Dn=function(e){function n(t){var n=e.call(this)||this;return n.connection=t instanceof V?t:new V(t),n}return r(n,e),Object.defineProperty(n.prototype,"properties",{get:function(){return this.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"TargetClusters",{get:function(){return this.get("TargetClusters")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CTargetClusters",{get:function(){var e=this;return this.TargetClusters.map(function(t){return wn.attach(e.connection,t.Name,t)})},enumerable:!1,configurable:!0}),n.prototype.GetESPServiceBaseURL=function(e){var n=this;return void 0===e&&(e=""),this.connection.TpServiceQuery({}).then(function(r){var o=n.connection.protocol(),i=n.connection.ip(),u="https:"===o?"18002":"8002";if(t.exists("ServiceList.TpEspServers.TpEspServer",r))for(var c=0,s=r.ServiceList.TpEspServers.TpEspServer;c<s.length;c++){var a=s[c];if(t.exists("TpBindings.TpBinding",a))for(var p=0,f=a.TpBindings.TpBinding;p<f.length;p++){var l=f[p];l.Service===e&&l.Protocol+":"===o&&(u=l.Port)}}return o+"//"+i+":"+u+"/"})},n.prototype.fetchTargetClusters=function(){var e=this;return this.connection.TpTargetClusterQuery({Type:"ROOT"}).then(function(t){return e.set({TargetClusters:t.TpTargetClusters.TpTargetCluster}),e.CTargetClusters})},n.prototype.refresh=function(){return i(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.fetchTargetClusters()];case 1:return e.sent(),[2,this]}})})},n.prototype.on=function(t,n,r){if(this.isCallback(n))switch(t){case"changed":e.prototype.on.call(this,t,n)}else switch(t){case"changed":e.prototype.on.call(this,t,n,r)}return this._monitor(),this},n}(t.StateObject);e.AccountService=U,e.Activity=fn,e.Attribute=zt,e.BUILD_VERSION="2.28.0",e.BaseScope=Jt,e.Connection=v,e.DFUService=j,e.ECLGraph=Ot,e.ESPConnection=C,e.ESPExceptions=P,e.EclService=x,e.GlobalResultCache=Ht,e.GraphCache=Ut,e.LogicalFile=gn,e.LogicalFileCache=ln,e.Machine=yn,e.MachineCache=dn,e.MachineService=F,e.PKG_NAME="@hpcc-js/comms",e.PKG_VERSION="2.20.0",e.Query=vn,e.Resource=Mt,e.Result=Xt,e.ResultCache=Yt,e.SMCService=L,e.Scope=Kt,e.ScopeEdge=It,e.ScopeGraph=Wt,e.ScopeSubgraph=Rt,e.ScopeVertex=Nt,e.Service=O,e.SourceFile=Zt,e.Store=On,e.StoreCache=Sn,e.StoreService=k,e.TargetCluster=wn,e.TargetClusterCache=Un,e.Timer=$t,e.Topology=Dn,e.TopologyService=V,e.ValueChangedMessage=Cn,e.Workunit=cn,e.WorkunitCache=on,e.WorkunitsService=B,e.XGMMLEdge=xt,e.XGMMLGraph=wt,e.XGMMLSubgraph=Tt,e.XGMMLVertex=Dt,e.XSDNode=Et,e.XSDSchema=kt,e.XSDSimpleType=Lt,e.XSDXMLNode=Ft,e.createGraph=At,e.createXGMMLGraph=_t,e.defaultTargetCluster=function(e){if(!Tn[e.baseUrl]){var t=void 0;t=e instanceof V?e:new V(e),Tn[e.baseUrl]=t.TpListTargetClusters({}).then(function(t){var n,r,o;t.TargetClusters.TpClusterNameType.forEach(function(e){n||(n=e),r||!0!==e.IsDefault||(r=e),o||"hthor"!==e.Type||(o=e)});var i=r||o||n;return wn.attach(e,i.Name,i)})}return Tn[e.baseUrl]},e.deserializeResponse=f,e.get=b,e.hookSend=function(e){var t=m;return e&&(m=e),t},e.instanceOfIConnection=function(e){return"function"==typeof e.opts&&"function"==typeof e.send&&"function"==typeof e.clone},e.instanceOfIOptions=function(e){return"baseUrl"in e},e.isArray=S,e.isWUInfoWorkunit=function(e){return void 0!==e.StateEx},e.isWUQueryECLWorkunit=function(e){return void 0!==e.TotalClusterTime},e.jsonp=l,e.parseXSD=Bt,e.parseXSD2=function(e,t){var n=new Gt(t);return n.parse(e),n.schema},e.post=d,e.send=y,e.serializeRequest=p,e.setTransportFactory=function(t){var n=e.createConnection;return e.createConnection=t,n},e.targetClusters=function(e){return(e instanceof V?e:new V(e)).TpListTargetClusters({}).then(function(t){return t.TargetClusters.TpClusterNameType.map(function(t){return wn.attach(e,t.Name,t)})})},Object.defineProperty(e,"__esModule",{value:!0})});
2//# sourceMappingURL=index.min.js.map
\No newline at end of file