@emuanalytics/flow-engine-client 1.3.100 → 1.3.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";var FlowEngineClient=(()=>{var qs=Object.create;var se=Object.defineProperty,Ls=Object.defineProperties,Is=Object.getOwnPropertyDescriptor,Ds=Object.getOwnPropertyDescriptors,Us=Object.getOwnPropertyNames,Bt=Object.getOwnPropertySymbols,Ms=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty,$s=Object.prototype.propertyIsEnumerable;var Nt=(r,e,t)=>e in r?se(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,x=(r,e)=>{for(var t in e||(e={}))Ft.call(e,t)&&Nt(r,t,e[t]);if(Bt)for(var t of Bt(e))$s.call(e,t)&&Nt(r,t,e[t]);return r},ne=(r,e)=>Ls(r,Ds(e));var f=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),qt=(r,e)=>{for(var t in e)se(r,t,{get:e[t],enumerable:!0})},Lt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Us(e))!Ft.call(r,n)&&n!==t&&se(r,n,{get:()=>e[n],enumerable:!(s=Is(e,n))||s.enumerable});return r};var Xe=(r,e,t)=>(t=r!=null?qs(Ms(r)):{},Lt(e||!r||!r.__esModule?se(t,"default",{value:r,enumerable:!0}):t,r)),Ws=r=>Lt(se({},"__esModule",{value:!0}),r);var Ge=f((Ti,It)=>{"use strict";It.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(t,n)}}});var v=f((Pi,Mt)=>{"use strict";var js=Ge(),et=Object.prototype.toString,tt=function(r){return function(e){var t=et.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function U(r){return r=r.toLowerCase(),function(t){return tt(t)===r}}function rt(r){return Array.isArray(r)}function ve(r){return typeof r>"u"}function Ks(r){return r!==null&&!ve(r)&&r.constructor!==null&&!ve(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Dt=U("ArrayBuffer");function Vs(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Dt(r.buffer),e}function Hs(r){return typeof r=="string"}function Js(r){return typeof r=="number"}function Ut(r){return r!==null&&typeof r=="object"}function be(r){if(tt(r)!=="object")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}var zs=U("Date"),Qs=U("File"),Ys=U("Blob"),Xs=U("FileList");function st(r){return et.call(r)==="[object Function]"}function Gs(r){return Ut(r)&&st(r.pipe)}function Zs(r){var e="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||et.call(r)===e||st(r.toString)&&r.toString()===e)}var en=U("URLSearchParams");function tn(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function rn(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function nt(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),rt(r))for(var t=0,s=r.length;t<s;t++)e.call(null,r[t],t,r);else for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.call(null,r[n],n,r)}function Ze(){var r={};function e(n,i){be(r[i])&&be(n)?r[i]=Ze(r[i],n):be(n)?r[i]=Ze({},n):rt(n)?r[i]=n.slice():r[i]=n}for(var t=0,s=arguments.length;t<s;t++)nt(arguments[t],e);return r}function sn(r,e,t){return nt(e,function(n,i){t&&typeof n=="function"?r[i]=js(n,t):r[i]=n}),r}function nn(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function on(r,e,t,s){r.prototype=Object.create(e.prototype,s),r.prototype.constructor=r,t&&Object.assign(r.prototype,t)}function an(r,e,t){var s,n,i,o={};e=e||{};do{for(s=Object.getOwnPropertyNames(r),n=s.length;n-- >0;)i=s[n],o[i]||(e[i]=r[i],o[i]=!0);r=Object.getPrototypeOf(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e}function cn(r,e,t){r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;var s=r.indexOf(e,t);return s!==-1&&s===t}function un(r){if(!r)return null;var e=r.length;if(ve(e))return null;for(var t=new Array(e);e-- >0;)t[e]=r[e];return t}var hn=function(r){return function(e){return r&&e instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));Mt.exports={isArray:rt,isArrayBuffer:Dt,isBuffer:Ks,isFormData:Zs,isArrayBufferView:Vs,isString:Hs,isNumber:Js,isObject:Ut,isPlainObject:be,isUndefined:ve,isDate:zs,isFile:Qs,isBlob:Ys,isFunction:st,isStream:Gs,isURLSearchParams:en,isStandardBrowserEnv:rn,forEach:nt,merge:Ze,extend:sn,trim:tn,stripBOM:nn,inherits:on,toFlatObject:an,kindOf:tt,kindOfTest:U,endsWith:cn,toArray:un,isTypedArray:hn,isFileList:Xs}});var it=f((Bi,Wt)=>{"use strict";var V=v();function $t(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Wt.exports=function(e,t,s){if(!t)return e;var n;if(s)n=s(t);else if(V.isURLSearchParams(t))n=t.toString();else{var i=[];V.forEach(t,function(h,m){h===null||typeof h>"u"||(V.isArray(h)?m=m+"[]":h=[h],V.forEach(h,function(u){V.isDate(u)?u=u.toISOString():V.isObject(u)&&(u=JSON.stringify(u)),i.push($t(m)+"="+$t(u))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}});var Kt=f((Ni,jt)=>{"use strict";var ln=v();function we(){this.handlers=[]}we.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};we.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};we.prototype.forEach=function(e){ln.forEach(this.handlers,function(s){s!==null&&e(s)})};jt.exports=we});var Ht=f((Fi,Vt)=>{"use strict";var fn=v();Vt.exports=function(e,t){fn.forEach(e,function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])})}});var M=f((qi,Yt)=>{"use strict";var Jt=v();function H(r,e,t,s,n){Error.call(this),this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),n&&(this.response=n)}Jt.inherits(H,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var zt=H.prototype,Qt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){Qt[r]={value:r}});Object.defineProperties(H,Qt);Object.defineProperty(zt,"isAxiosError",{value:!0});H.from=function(r,e,t,s,n,i){var o=Object.create(zt);return Jt.toFlatObject(r,o,function(h){return h!==Error.prototype}),H.call(o,r.message,e,t,s,n),o.name=r.name,i&&Object.assign(o,i),o};Yt.exports=H});var ot=f((Li,Xt)=>{"use strict";Xt.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var at=f((Ii,Gt)=>{"use strict";var B=v();function pn(r,e){e=e||new FormData;var t=[];function s(i){return i===null?"":B.isDate(i)?i.toISOString():B.isArrayBuffer(i)||B.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function n(i,o){if(B.isPlainObject(i)||B.isArray(i)){if(t.indexOf(i)!==-1)throw Error("Circular reference detected in "+o);t.push(i),B.forEach(i,function(h,m){if(!B.isUndefined(h)){var a=o?o+"."+m:m,u;if(h&&!o&&typeof h=="object"){if(B.endsWith(m,"{}"))h=JSON.stringify(h);else if(B.endsWith(m,"[]")&&(u=B.toArray(h))){u.forEach(function(l){!B.isUndefined(l)&&e.append(a,s(l))});return}}n(h,a)}}),t.pop()}else e.append(o,s(i))}return n(r),e}Gt.exports=pn});var er=f((Di,Zt)=>{"use strict";var ct=M();Zt.exports=function(e,t,s){var n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new ct("Request failed with status code "+s.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}});var rr=f((Ui,tr)=>{"use strict";var Ce=v();tr.exports=Ce.isStandardBrowserEnv()?function(){return{write:function(t,s,n,i,o,c){var h=[];h.push(t+"="+encodeURIComponent(s)),Ce.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),Ce.isString(i)&&h.push("path="+i),Ce.isString(o)&&h.push("domain="+o),c===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(t){var s=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var nr=f((Mi,sr)=>{"use strict";sr.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}});var or=f(($i,ir)=>{"use strict";ir.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}});var ut=f((Wi,ar)=>{"use strict";var dn=nr(),mn=or();ar.exports=function(e,t){return e&&!dn(t)?mn(e,t):t}});var ur=f((ji,cr)=>{"use strict";var ht=v(),yn=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];cr.exports=function(e){var t={},s,n,i;return e&&ht.forEach(e.split(`
2
- `),function(c){if(i=c.indexOf(":"),s=ht.trim(c.substr(0,i)).toLowerCase(),n=ht.trim(c.substr(i+1)),s){if(t[s]&&yn.indexOf(s)>=0)return;s==="set-cookie"?t[s]=(t[s]?t[s]:[]).concat([n]):t[s]=t[s]?t[s]+", "+n:n}}),t}});var fr=f((Ki,lr)=>{"use strict";var hr=v();lr.exports=hr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),s;function n(i){var o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=n(window.location.href),function(o){var c=hr.isString(o)?n(o):o;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}()});var ie=f((Vi,dr)=>{"use strict";var lt=M(),gn=v();function pr(r){lt.call(this,r==null?"canceled":r,lt.ERR_CANCELED),this.name="CanceledError"}gn.inherits(pr,lt,{__CANCEL__:!0});dr.exports=pr});var yr=f((Hi,mr)=>{"use strict";mr.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}});var ft=f((Ji,gr)=>{"use strict";var oe=v(),bn=er(),vn=rr(),wn=it(),Cn=ut(),En=ur(),xn=fr(),kn=ot(),q=M(),Sn=ie(),Rn=yr();gr.exports=function(e){return new Promise(function(s,n){var i=e.data,o=e.headers,c=e.responseType,h;function m(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}oe.isFormData(i)&&oe.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",l=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+l)}var g=Cn(e.baseURL,e.url);a.open(e.method.toUpperCase(),wn(g,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function re(){if(a){var b="getAllResponseHeaders"in a?En(a.getAllResponseHeaders()):null,P=!c||c==="text"||c==="json"?a.responseText:a.response,F={data:P,status:a.status,statusText:a.statusText,headers:b,config:e,request:a};bn(function(ge){s(ge),m()},function(ge){n(ge),m()},F),a=null}}if("onloadend"in a?a.onloadend=re:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(re)},a.onabort=function(){a&&(n(new q("Request aborted",q.ECONNABORTED,e,a)),a=null)},a.onerror=function(){n(new q("Network Error",q.ERR_NETWORK,e,a,a)),a=null},a.ontimeout=function(){var P=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",F=e.transitional||kn;e.timeoutErrorMessage&&(P=e.timeoutErrorMessage),n(new q(P,F.clarifyTimeoutError?q.ETIMEDOUT:q.ECONNABORTED,e,a)),a=null},oe.isStandardBrowserEnv()){var S=(e.withCredentials||xn(g))&&e.xsrfCookieName?vn.read(e.xsrfCookieName):void 0;S&&(o[e.xsrfHeaderName]=S)}"setRequestHeader"in a&&oe.forEach(o,function(P,F){typeof i>"u"&&F.toLowerCase()==="content-type"?delete o[F]:a.setRequestHeader(F,P)}),oe.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),c&&c!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(b){a&&(n(!b||b&&b.type?new Sn:b),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),i||(i=null);var C=Rn(g);if(C&&["http","https","file"].indexOf(C)===-1){n(new q("Unsupported protocol "+C+":",q.ERR_BAD_REQUEST,e));return}a.send(i)})}});var vr=f((zi,br)=>{br.exports=null});var xe=f((Qi,xr)=>{"use strict";var w=v(),wr=Ht(),Cr=M(),_n=ot(),An=at(),On={"Content-Type":"application/x-www-form-urlencoded"};function Er(r,e){!w.isUndefined(r)&&w.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Tn(){var r;return typeof XMLHttpRequest<"u"?r=ft():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=ft()),r}function Pn(r,e,t){if(w.isString(r))try{return(e||JSON.parse)(r),w.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var Ee={transitional:_n,adapter:Tn(),transformRequest:[function(e,t){if(wr(t,"Accept"),wr(t,"Content-Type"),w.isFormData(e)||w.isArrayBuffer(e)||w.isBuffer(e)||w.isStream(e)||w.isFile(e)||w.isBlob(e))return e;if(w.isArrayBufferView(e))return e.buffer;if(w.isURLSearchParams(e))return Er(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=w.isObject(e),n=t&&t["Content-Type"],i;if((i=w.isFileList(e))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return An(i?{"files[]":e}:e,o&&new o)}else if(s||n==="application/json")return Er(t,"application/json"),Pn(e);return e}],transformResponse:[function(e){var t=this.transitional||Ee.transitional,s=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!s&&this.responseType==="json";if(i||n&&w.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?Cr.from(o,Cr.ERR_BAD_RESPONSE,this,null,this.response):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vr()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};w.forEach(["delete","get","head"],function(e){Ee.headers[e]={}});w.forEach(["post","put","patch"],function(e){Ee.headers[e]=w.merge(On)});xr.exports=Ee});var Sr=f((Yi,kr)=>{"use strict";var Bn=v(),Nn=xe();kr.exports=function(e,t,s){var n=this||Nn;return Bn.forEach(s,function(o){e=o.call(n,e,t)}),e}});var pt=f((Xi,Rr)=>{"use strict";Rr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Or=f((Gi,Ar)=>{"use strict";var _r=v(),dt=Sr(),Fn=pt(),qn=xe(),Ln=ie();function mt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Ln}Ar.exports=function(e){mt(e),e.headers=e.headers||{},e.data=dt.call(e,e.data,e.headers,e.transformRequest),e.headers=_r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),_r.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||qn.adapter;return t(e).then(function(n){return mt(e),n.data=dt.call(e,n.data,n.headers,e.transformResponse),n},function(n){return Fn(n)||(mt(e),n&&n.response&&(n.response.data=dt.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var yt=f((Zi,Tr)=>{"use strict";var R=v();Tr.exports=function(e,t){t=t||{};var s={};function n(a,u){return R.isPlainObject(a)&&R.isPlainObject(u)?R.merge(a,u):R.isPlainObject(u)?R.merge({},u):R.isArray(u)?u.slice():u}function i(a){if(R.isUndefined(t[a])){if(!R.isUndefined(e[a]))return n(void 0,e[a])}else return n(e[a],t[a])}function o(a){if(!R.isUndefined(t[a]))return n(void 0,t[a])}function c(a){if(R.isUndefined(t[a])){if(!R.isUndefined(e[a]))return n(void 0,e[a])}else return n(void 0,t[a])}function h(a){if(a in t)return n(e[a],t[a]);if(a in e)return n(void 0,e[a])}var m={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:h};return R.forEach(Object.keys(e).concat(Object.keys(t)),function(u){var l=m[u]||i,g=l(u);R.isUndefined(g)&&l!==h||(s[u]=g)}),s}});var gt=f((eo,Pr)=>{Pr.exports={version:"0.27.2"}});var Fr=f((to,Nr)=>{"use strict";var In=gt().version,D=M(),bt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){bt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var Br={};bt.transitional=function(e,t,s){function n(i,o){return"[Axios v"+In+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return function(i,o,c){if(e===!1)throw new D(n(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!Br[o]&&(Br[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,c):!0}};function Dn(r,e,t){if(typeof r!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(r),n=s.length;n-- >0;){var i=s[n],o=e[i];if(o){var c=r[i],h=c===void 0||o(c,i,r);if(h!==!0)throw new D("option "+i+" must be "+h,D.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}Nr.exports={assertOptions:Dn,validators:bt}});var Mr=f((ro,Ur)=>{"use strict";var Ir=v(),Un=it(),qr=Kt(),Lr=Or(),ke=yt(),Mn=ut(),Dr=Fr(),J=Dr.validators;function z(r){this.defaults=r,this.interceptors={request:new qr,response:new qr}}z.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ke(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&Dr.assertOptions(s,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(i=i&&g.synchronous,n.unshift(g.fulfilled,g.rejected))});var o=[];this.interceptors.response.forEach(function(g){o.push(g.fulfilled,g.rejected)});var c;if(!i){var h=[Lr,void 0];for(Array.prototype.unshift.apply(h,n),h=h.concat(o),c=Promise.resolve(t);h.length;)c=c.then(h.shift(),h.shift());return c}for(var m=t;n.length;){var a=n.shift(),u=n.shift();try{m=a(m)}catch(l){u(l);break}}try{c=Lr(m)}catch(l){return Promise.reject(l)}for(;o.length;)c=c.then(o.shift(),o.shift());return c};z.prototype.getUri=function(e){e=ke(this.defaults,e);var t=Mn(e.baseURL,e.url);return Un(t,e.params,e.paramsSerializer)};Ir.forEach(["delete","get","head","options"],function(e){z.prototype[e]=function(t,s){return this.request(ke(s||{},{method:e,url:t,data:(s||{}).data}))}});Ir.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,c){return this.request(ke(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}z.prototype[e]=t(),z.prototype[e+"Form"]=t(!0)});Ur.exports=z});var Wr=f((so,$r)=>{"use strict";var $n=ie();function Q(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;this.promise.then(function(s){if(t._listeners){var n,i=t._listeners.length;for(n=0;n<i;n++)t._listeners[n](s);t._listeners=null}}),this.promise.then=function(s){var n,i=new Promise(function(o){t.subscribe(o),n=o}).then(s);return i.cancel=function(){t.unsubscribe(n)},i},r(function(n){t.reason||(t.reason=new $n(n),e(t.reason))})}Q.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Q.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};Q.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};Q.source=function(){var e,t=new Q(function(n){e=n});return{token:t,cancel:e}};$r.exports=Q});var Kr=f((no,jr)=>{"use strict";jr.exports=function(e){return function(s){return e.apply(null,s)}}});var Hr=f((io,Vr)=>{"use strict";var Wn=v();Vr.exports=function(e){return Wn.isObject(e)&&e.isAxiosError===!0}});var Qr=f((oo,vt)=>{"use strict";var Jr=v(),jn=Ge(),Se=Mr(),Kn=yt(),Vn=xe();function zr(r){var e=new Se(r),t=jn(Se.prototype.request,e);return Jr.extend(t,Se.prototype,e),Jr.extend(t,e),t.create=function(n){return zr(Kn(r,n))},t}var k=zr(Vn);k.Axios=Se;k.CanceledError=ie();k.CancelToken=Wr();k.isCancel=pt();k.VERSION=gt().version;k.toFormData=at();k.AxiosError=M();k.Cancel=k.CanceledError;k.all=function(e){return Promise.all(e)};k.spread=Kr();k.isAxiosError=Hr();vt.exports=k;vt.exports.default=k});var Xr=f((ao,Yr)=>{Yr.exports=Qr()});var Zr=f((co,Gr)=>{var Y=1e3,X=Y*60,G=X*60,$=G*24,Hn=$*7,Jn=$*365.25;Gr.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return zn(r);if(t==="number"&&isFinite(r))return e.long?Yn(r):Qn(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function zn(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return t*Jn;case"weeks":case"week":case"w":return t*Hn;case"days":case"day":case"d":return t*$;case"hours":case"hour":case"hrs":case"hr":case"h":return t*G;case"minutes":case"minute":case"mins":case"min":case"m":return t*X;case"seconds":case"second":case"secs":case"sec":case"s":return t*Y;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Qn(r){var e=Math.abs(r);return e>=$?Math.round(r/$)+"d":e>=G?Math.round(r/G)+"h":e>=X?Math.round(r/X)+"m":e>=Y?Math.round(r/Y)+"s":r+"ms"}function Yn(r){var e=Math.abs(r);return e>=$?Re(r,e,$,"day"):e>=G?Re(r,e,G,"hour"):e>=X?Re(r,e,X,"minute"):e>=Y?Re(r,e,Y,"second"):r+" ms"}function Re(r,e,t,s){var n=e>=t*1.5;return Math.round(r/t)+" "+s+(n?"s":"")}});var ts=f((uo,es)=>{function Xn(r){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=o,t.humanize=Zr(),t.destroy=m,Object.keys(r).forEach(a=>{t[a]=r[a]}),t.names=[],t.skips=[],t.formatters={};function e(a){let u=0;for(let l=0;l<a.length;l++)u=(u<<5)-u+a.charCodeAt(l),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(a){let u,l=null,g,re;function S(...C){if(!S.enabled)return;let b=S,P=Number(new Date),F=P-(u||P);b.diff=F,b.prev=u,b.curr=P,u=P,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let K=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(Ye,Ns)=>{if(Ye==="%%")return"%";K++;let Pt=t.formatters[Ns];if(typeof Pt=="function"){let Fs=C[K];Ye=Pt.call(b,Fs),C.splice(K,1),K--}return Ye}),t.formatArgs.call(b,C),(b.log||t.log).apply(b,C)}return S.namespace=a,S.useColors=t.useColors(),S.color=t.selectColor(a),S.extend=s,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==t.namespaces&&(g=t.namespaces,re=t.enabled(a)),re),set:C=>{l=C}}),typeof t.init=="function"&&t.init(S),S}function s(a,u){let l=t(this.namespace+(typeof u>"u"?":":u)+a);return l.log=this.log,l}function n(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let u,l=(typeof a=="string"?a:"").split(/[\s,]+/),g=l.length;for(u=0;u<g;u++)l[u]&&(a=l[u].replace(/\*/g,".*?"),a[0]==="-"?t.skips.push(new RegExp("^"+a.slice(1)+"$")):t.names.push(new RegExp("^"+a+"$")))}function i(){let a=[...t.names.map(c),...t.skips.map(c).map(u=>"-"+u)].join(",");return t.enable(""),a}function o(a){if(a[a.length-1]==="*")return!0;let u,l;for(u=0,l=t.skips.length;u<l;u++)if(t.skips[u].test(a))return!1;for(u=0,l=t.names.length;u<l;u++)if(t.names[u].test(a))return!0;return!1}function c(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function h(a){return a instanceof Error?a.stack||a.message:a}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}es.exports=Xn});var rs=f((_,_e)=>{_.formatArgs=Zn;_.save=ei;_.load=ti;_.useColors=Gn;_.storage=ri();_.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();_.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Gn(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Zn(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+_e.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,s=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(s=t))}),r.splice(s,0,e)}_.log=console.debug||console.log||(()=>{});function ei(r){try{r?_.storage.setItem("debug",r):_.storage.removeItem("debug")}catch(e){}}function ti(){let r;try{r=_.storage.getItem("debug")}catch(e){}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function ri(){try{return localStorage}catch(r){}}_e.exports=ts()(_);var{formatters:si}=_e.exports;si.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ns=f((qo,ss)=>{ss.exports=typeof self=="object"?self.FormData:window.FormData});var Ai={};qt(Ai,{BaseEndpoints:()=>y,Client:()=>Tt,FlowEngineError:()=>L,WebSocketChannel:()=>Ts,WebSocketGateway:()=>ye});var Ps=Xe(Xr()),Bs=Xe(rs());var y=class{constructor(e,t){this.client=e;this.resourcePath=t}get resourceEndpoint(){return`/api/v1/${this.resourcePath}`}list(e){if(e!=null&&e.filter){let t=e.filter;Object.keys(t).forEach(s=>{e[`filter[${s}]`]=t[s]}),delete e.filter}return this.client._get(this.resourceEndpoint,{params:e})}get(e,t={}){return this.client._get(`${this.resourceEndpoint}/${e}`,{params:t})}create(e,t={}){return this.client._post(`${this.resourceEndpoint}`,e,{params:t})}update(e,t,s={}){return this.client._put(`${this.resourceEndpoint}/${e}`,t,{params:s})}delete(e,t={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:t})}getMetadata(e,t,s={}){let n=t?`${this.resourceEndpoint}/${e}/metadata/${t}`:`${this.resourceEndpoint}/${e}/metadata`;return this.client._get(n,{params:s})}setMetadata(e,t,s,n={}){return(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&(s={value:s}),this.client._put(`${this.resourceEndpoint}/${e}/metadata/${t}`,s,{headers:{"Content-Type":"application/json"},params:n})}deleteMetadata(e,t,s={}){return this.client._delete(`${this.resourceEndpoint}/${e}/metadata/${t}`,{headers:{"Content-Type":"application/json"},params:s})}};var Ae=class extends y{constructor(e){super(e,"apikeys")}};var Oe=class{constructor(e){this.client=e}get resourceEndpoint(){return"/api/v1/appconfig"}get(e,t={}){return this.client._get(e?`${this.resourceEndpoint}/${e}`:this.resourceEndpoint,{params:t})}set(e,t,s={}){return(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null||Array.isArray(t))&&(t={value:t}),this.client._put(`${this.resourceEndpoint}/${e}`,t,{headers:{"Content-Type":"application/json"},params:s})}delete(e,t={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:t})}subscribe(e){return this.client._subscribe("appconfig",e)}};var Te=class extends y{constructor(e){super(e,"applications")}};var Pe=class extends y{constructor(e){super(e,"auth/users")}me(e){return this.client._get(`${this.resourceEndpoint}/me`,{headers:{Authorization:`Bearer ${e}`}})}};var Be=class{constructor(e){this.client=e;this.users=new Pe(this.client)}login(e,t,s){return this.client._post("/api/v1/auth/login",{email:e,password:t,applicationId:s})}logout(e,t){return this.client._post("/api/v1/auth/logout",{refreshToken:t},{headers:{Authorization:`Bearer ${e}`}})}refresh(e,t){return this.client._post("/api/v1/auth/refresh",{refreshToken:e,applicationId:t})}changePassword(e,t,s){return this.client._post("/api/v1/auth/changepassword",{password:e,newPassword:t},{headers:{Authorization:`Bearer ${s}`}})}signUp(e,t,s,n,i,o,c){return c||(c=o,o=`${this.client.baseUrl}/api/v1/auth/confirmsignup`),this.client._post("/api/v1/auth/signup",{firstName:e,lastName:t,email:s,password:n,applicationId:i,confirmUrl:o,redirectUrl:c})}confirmSignUp(e,t,s){return this.client._get("/api/v1/auth/confirmsignup",{params:{email:e,token:t,redirect:s}})}requestPasswordReset(e,t,s){return this.client._post("/api/v1/auth/requestpasswordreset",{email:e,applicationId:t,redirectUrl:s})}resetPassword(e,t,s,n){return this.client._post("/api/v1/auth/resetpassword",{email:e,password:t,applicationId:s,token:n})}};var Ne=class extends y{constructor(e){super(e,"databases")}drivers(){return this.client._get("/api/v1/databases/drivers").catch(e=>{if(e.status===404)return["postgis","postgis-mapnik"]})}};var Fe=class extends y{constructor(e){super(e,"datasets")}query(e,t={},s={}){return typeof e=="object"&&(s=ne(x({},e.params),{format:e.format||"json"}),t=e,e=t.datasetId,delete t.datasetId,delete t.format),typeof s=="string"&&(s={format:s}),this.client._post(`/api/v1/datasets/${e}/query`,t,{params:ne(x({},s),{format:s.format||"json",explain:s.explain||!1})}).catch(n=>{throw n.message==="Network Error"?new Error("Query timed out"):n})}ingest(e,t={}){return this.client._post(`/api/v1/datasets/${e.datasetId}/ingest`,e,t)}getExportUrl(e,t){let s=this.client.accessToken?`accesstoken=${this.client.accessToken}`:`apikey=${this.client.apiKey}`;return`${this.client.baseUrl}/api/v1/datasets/${e}/export?format=${t}&${s}`}subscribe(e,t){return this.client._subscribe(`dataset/${e}`,t)}};var L=class extends Error{constructor(t,s=null,n=500){super(t||"Unknown Error");Object.setPrototypeOf(this,L.prototype),this.statusCode=n,this.error=s}};var qe=class extends y{constructor(e){super(e,"jobs")}submit(e){return this.client._post("/api/v1/jobs/submit",e)}getStatus(e){return this.client._get(`/api/v1/jobs/${e}/status`)}setStatus(e,t){return this.client._post(`/api/v1/jobs/${e}/status`,t)}cancel(e){return this.client._post(`/api/v1/jobs/${e}/cancel`,{})}request(e){return this.client._post("/api/v1/jobs/request",{type:e})}};var Le=class{constructor(e){this.client=e}get(e,t={}){return this.client._get(`/maps/${e}.json`,{params:t})}};var Ie=class extends y{constructor(e){super(e,"styles")}};var De=class extends y{constructor(e){super(e,"tilesources")}drivers(){return this.client._get("/api/v1/tilesources/drivers").catch(e=>{if(e.statusCode===404)return["tilelive","dataset"]})}};var Ue=class{constructor(e){this.client=e}getTileSpec(e,t={}){return this.client._get(`/tiles/${e}/index.json`,{params:t})}getPreviewStyle(e,t={}){return this.client._get(`/tiles/${e}/style.json`,{params:t})}};var is=Xe(ns()),Me=class extends y{constructor(e){super(e,"uploads")}async upload(e,t={}){let s=new is.default;return e.datasetName&&s.append("name",e.datasetName),e.datasetDescription&&s.append("description",e.datasetDescription),e.attribution&&s.append("attribution",e.attribution),e.datasetId&&s.append("datasetId",e.datasetId),e.sourceSrid&&s.append("sourceSrid",e.sourceSrid),e.targetSrid&&s.append("targetSrid",e.targetSrid),e.schema&&s.append("schema",e.schema),s.append("file",e.data,e.filename),await this.client._post(this.resourceEndpoint,s,{headers:s.getHeaders(),params:t,onUploadProgress:e.progress})}};var N=Object.create(null);N.open="0";N.close="1";N.ping="2";N.pong="3";N.message="4";N.upgrade="5";N.noop="6";var ae=Object.create(null);Object.keys(N).forEach(r=>{ae[N[r]]=r});var os={type:"error",data:"parser error"};var ni=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ii=typeof ArrayBuffer=="function",oi=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ai=({type:r,data:e},t,s)=>ni&&e instanceof Blob?t?s(e):as(e,s):ii&&(e instanceof ArrayBuffer||oi(e))?t?s(e):as(new Blob([e]),s):s(N[r]+(e||"")),as=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)},$e=ai;var cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<cs.length;r++)ce[cs.charCodeAt(r)]=r;var us=r=>{let e=r.length*.75,t=r.length,s,n=0,i,o,c,h;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),a=new Uint8Array(m);for(s=0;s<t;s+=4)i=ce[r.charCodeAt(s)],o=ce[r.charCodeAt(s+1)],c=ce[r.charCodeAt(s+2)],h=ce[r.charCodeAt(s+3)],a[n++]=i<<2|o>>4,a[n++]=(o&15)<<4|c>>2,a[n++]=(c&3)<<6|h&63;return m};var ci=typeof ArrayBuffer=="function",ui=(r,e)=>{if(typeof r!="string")return{type:"message",data:hs(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:hi(r.substring(1),e)}:ae[t]?r.length>1?{type:ae[t],data:r.substring(1)}:{type:ae[t]}:os},hi=(r,e)=>{if(ci){let t=us(r);return hs(t,e)}else return{base64:!0,data:r}},hs=(r,e)=>{switch(e){case"blob":return r instanceof ArrayBuffer?new Blob([r]):r;case"arraybuffer":default:return r}},We=ui;var ls=String.fromCharCode(30),fs=(r,e)=>{let t=r.length,s=new Array(t),n=0;r.forEach((i,o)=>{$e(i,!1,c=>{s[o]=c,++n===t&&e(s.join(ls))})})},ps=(r,e)=>{let t=r.split(ls),s=[];for(let n=0;n<t.length;n++){let i=We(t[n],e);if(s.push(i),i.type==="error")break}return s},wt=4;function d(r){if(r)return li(r)}function li(r){for(var e in d.prototype)r[e]=d.prototype[e];return r}d.prototype.on=d.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};d.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,n=0;n<t.length;n++)if(s=t[n],s===e||s.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+r],this};d.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,n=t.length;s<n;++s)t[s].apply(this,e)}return this};d.prototype.emitReserved=d.prototype.emit;d.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};d.prototype.hasListeners=function(r){return!!this.listeners(r).length};var E=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function je(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var fi=E.setTimeout,pi=E.clearTimeout;function I(r,e){e.useNativeTimers?(r.setTimeoutFn=fi.bind(E),r.clearTimeoutFn=pi.bind(E)):(r.setTimeoutFn=E.setTimeout.bind(E),r.clearTimeoutFn=E.clearTimeout.bind(E))}var di=1.33;function ds(r){return typeof r=="string"?mi(r):Math.ceil((r.byteLength||r.size)*di)}function mi(r){let e=0,t=0;for(let s=0,n=r.length;s<n;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}var Ct=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},W=class extends d{constructor(e){super(),this.writable=!1,I(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,s){return super.emitReserved("error",new Ct(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=We(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}};var bs="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Et=64,yi={},ms=0,Ke=0,ys;function gs(r){let e="";do e=bs[r%Et]+e,r=Math.floor(r/Et);while(r>0);return e}function Ve(){let r=gs(+new Date);return r!==ys?(ms=0,ys=r):r+"."+gs(ms++)}for(;Ke<Et;Ke++)yi[bs[Ke]]=Ke;function He(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function vs(r){let e={},t=r.split("&");for(let s=0,n=t.length;s<n;s++){let i=t[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}var ws=!1;try{ws=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(r){}var Cs=ws;function xt(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Cs))return new XMLHttpRequest}catch(t){}if(!e)try{return new E[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function gi(){}var bi=function(){return new xt({xdomain:!1}).responseType!=null}(),Je=class extends W{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){let s=location.protocol==="https:",n=location.port;n||(n=s?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==s}let t=e&&e.forceBase64;this.supportsBinary=bi&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let s=0;this.polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};ps(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,fs(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{},t=this.opts.secure?"https":"http",s="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Ve()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(s=":"+this.opts.port);let n=He(e),i=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(n.length?"?"+n:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new T(this.uri(),e)}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(n,i)=>{this.onError("xhr post error",n,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},T=class extends d{constructor(e,t){super(),I(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){let e=je(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;let t=this.xhr=new xt(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&t.setRequestHeader(s,this.opts.extraHeaders[s])}}catch(s){}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{t.setRequestHeader("Accept","*/*")}catch(s){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=T.requestsCount++,T.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=gi,e)try{this.xhr.abort()}catch(t){}typeof document<"u"&&delete T.requests[this.index],this.xhr=null}}onLoad(){let e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};T.requestsCount=0;T.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Es);else if(typeof addEventListener=="function"){let r="onpagehide"in E?"pagehide":"unload";addEventListener(r,Es,!1)}}function Es(){for(let r in T.requests)T.requests.hasOwnProperty(r)&&T.requests[r].abort()}var ue=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),he=E.WebSocket||E.MozWebSocket,ze=!0,xs="arraybuffer";var ks=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Qe=class extends W{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let e=this.uri(),t=this.opts.protocols,s=ks?{}:je(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=ze&&!ks?t?new he(e,t):new he(e):new he(e,t,s)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType||xs,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],n=t===e.length-1;$e(s,this.supportsBinary,i=>{let o={};ze||(s.options&&(o.compress=s.options.compress),this.opts.perMessageDeflate&&(typeof i=="string"?Buffer.byteLength(i):i.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{ze?this.ws.send(i):this.ws.send(i,o)}catch(c){}n&&ue(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{},t=this.opts.secure?"wss":"ws",s="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(s=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Ve()),this.supportsBinary||(e.b64=1);let n=He(e),i=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(n.length?"?"+n:"")}check(){return!!he}};var kt={websocket:Qe,polling:Je};var vi=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Z(r){let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let n=vi.exec(r||""),i={},o=14;for(;o--;)i[wi[o]]=n[o]||"";return t!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ci(i,i.path),i.queryKey=Ei(i,i.query),i}function Ci(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Ei(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,n,i){n&&(t[n]=i)}),t}var A=class extends d{constructor(e,t={}){super(),this.writeBuffer=[],e&&typeof e=="object"&&(t=e,e=null),e?(e=Z(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Z(t.host).host),I(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=vs(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=wt,t.transport=e,this.id&&(t.sid=this.id);let s=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new kt[e](s)}open(){let e;if(this.opts.rememberUpgrade&&A.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch(t){this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),s=!1;A.priorWebsocketSuccess=!1;let n=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!s)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;A.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(a(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let l=new Error("probe error");l.transport=t.name,this.emitReserved("upgradeError",l)}}))};function i(){s||(s=!0,a(),t.close(),t=null)}let o=u=>{let l=new Error("probe error: "+u);l.transport=t.name,i(),this.emitReserved("upgradeError",l)};function c(){o("transport closed")}function h(){o("socket closed")}function m(u){t&&u.name!==t.name&&i()}let a=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",m)};t.once("open",n),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",m),t.open()}onOpen(){if(this.readyState="open",A.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0,t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){let n=this.writeBuffer[s].data;if(n&&(t+=ds(n)),s>0&&t>this.maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}write(e,t,s){return this.sendPacket("message",e,t,s),this}send(e,t,s){return this.sendPacket("message",e,t,s),this}sendPacket(e,t,s,n){if(typeof t=="function"&&(n=t,t=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;let i={type:e,data:t,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}onError(e){A.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){let t=[],s=0,n=e.length;for(;s<n;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}};A.protocol=wt;var Da=A.protocol;function Ss(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=Z(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}var Ot={};qt(Ot,{Decoder:()=>pe,Encoder:()=>_t,PacketType:()=>p,protocol:()=>Os});var xi=typeof ArrayBuffer=="function",ki=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Rs=Object.prototype.toString,Si=typeof Blob=="function"||typeof Blob<"u"&&Rs.call(Blob)==="[object BlobConstructor]",Ri=typeof File=="function"||typeof File<"u"&&Rs.call(File)==="[object FileConstructor]";function fe(r){return xi&&(r instanceof ArrayBuffer||ki(r))||Si&&r instanceof Blob||Ri&&r instanceof File}function le(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(le(r[t]))return!0;return!1}if(fe(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return le(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&le(r[t]))return!0;return!1}function _s(r){let e=[],t=r.data,s=r;return s.data=St(t,e),s.attachments=e.length,{packet:s,buffers:e}}function St(r,e){if(!r)return r;if(fe(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=St(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=St(r[s],e));return t}return r}function As(r,e){return r.data=Rt(r.data,e),delete r.attachments,r}function Rt(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=Rt(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=Rt(r[t],e));return r}var Os=5,p;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(p||(p={}));var _t=class{constructor(e){this.replacer=e}encode(e){return(e.type===p.EVENT||e.type===p.ACK)&&le(e)?this.encodeAsBinary({type:e.type===p.EVENT?p.BINARY_EVENT:p.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===p.BINARY_EVENT||e.type===p.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=_s(e),s=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(s),n}},pe=class extends d{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===p.BINARY_EVENT;s||t.type===p.BINARY_ACK?(t.type=s?p.EVENT:p.ACK,this.reconstructor=new At(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(fe(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(p[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===p.BINARY_EVENT||s.type===p.BINARY_ACK){let i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(i,t)}else s.nsp="/";let n=e.charAt(t+1);if(n!==""&&Number(n)==n){let i=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){let i=this.tryParse(e.substr(t));if(pe.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case p.CONNECT:return typeof t=="object";case p.DISCONNECT:return t===void 0;case p.CONNECT_ERROR:return typeof t=="string"||typeof t=="object";case p.EVENT:case p.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case p.ACK:case p.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},At=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=As(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function O(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var _i=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ee=class extends d{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[O(e,"open",this.onopen.bind(this)),O(e,"packet",this.onpacket.bind(this)),O(e,"error",this.onerror.bind(this)),O(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(_i.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let s={type:p.EVENT,data:t};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let o=this.ids++,c=t.pop();this._registerAckCallback(o,c),s.id=o}let n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!n||!this.connected)||(this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var s;let n=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},n);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...o])}}emitWithAck(e,...t){let s=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((n,i)=>{t.push((o,c)=>s?o?i(o):n(c):n(o)),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...i)=>s!==this._queue[0]?void 0:(n!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(n)):(this._queue.shift(),t&&t(null,...i)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:p.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case p.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case p.EVENT:case p.BINARY_EVENT:this.onevent(e);break;case p.ACK:case p.BINARY_ACK:this.onack(e);break;case p.DISCONNECT:this.ondisconnect();break;case p.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...n){s||(s=!0,t.packet({type:p.ACK,id:e,data:n}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:p.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function j(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}j.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};j.prototype.reset=function(){this.attempts=0};j.prototype.setMin=function(r){this.ms=r};j.prototype.setMax=function(r){this.max=r};j.prototype.setJitter=function(r){this.jitter=r};var te=class extends d{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,I(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new j({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let n=t.parser||Ot;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new A(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let n=O(t,"open",function(){s.onopen(),e&&e()}),i=O(t,"error",o=>{s.cleanup(),s._readyState="closed",this.emitReserved("error",o),e?e(o):s.maybeReconnectOnOpen()});if(this._timeout!==!1){let o=this._timeout;o===0&&n();let c=this.setTimeoutFn(()=>{n(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&c.unref(),this.subs.push(function(){clearTimeout(c)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(O(e,"ping",this.onping.bind(this)),O(e,"data",this.ondata.bind(this)),O(e,"error",this.onerror.bind(this)),O(e,"close",this.onclose.bind(this)),O(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){ue(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new ee(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var de={};function me(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Ss(r,e.path||"/socket.io"),s=t.source,n=t.id,i=t.path,o=de[n]&&i in de[n].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return c?h=new te(s,e):(de[n]||(de[n]=new te(s,e)),h=de[n]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(me,{Manager:te,Socket:ee,io:me,connect:me});var Ts=(s=>(s.System="system",s.AppConfig="appconfig",s.Dataset="dataset/",s))(Ts||{}),ye=class{constructor(e,t){this.client=e;this.options=t;this.connected=!1;this.subscribedChannels=new Set}get isConnected(){return this.connected}connect(){return this.isConnected?Promise.resolve():new Promise((e,t)=>{let s=me(this.client.baseUrl,ne(x({},this.options),{autoConnect:!1,auth:n=>{let i={};this.client.apiKey&&(i["x-api-key"]=this.client.apiKey),this.client.accessToken&&(i["x-socket-token"]=`Bearer ${this.client.accessToken}`),n(i)}}));s.on("connect",()=>{this.client.debug(`Socket connected: ${s.id}`),this.subscribedChannels.size&&this.subscribedChannels.forEach(n=>{s.emit("subscribe",{channel:n},i=>{i.status==="error"?console.error(`Error re-subscribing to channel '${n}`,i):this.client.debug(`Re-subscribed to channel '${n}`)})})}),s.io.on("reconnect_attempt",n=>{this.client.debug(`Socket reconnect attempt: ${n}`)}),s.io.on("reconnect_error",n=>{this.client.debug(`Socket reconnect error: ${n.message}`)}),s.io.on("reconnect_failed",()=>{this.client.debug("Socket reconnect failed")}),s.io.on("reconnect",()=>{this.client.debug("Socket reconnected")}),s.on("disconnect",n=>{this.client.debug(`Socket disconnected: ${n}`)}),s.on("error",n=>{this.client.debug(`Socket error: ${n.messaage}`)}),this.socket=s,this.connected=!0,s.on("connect",()=>{e()}),s.connect()})}disconnect(){return this.isConnected?new Promise(e=>{this.socket.once("disconnect",()=>{this.connected=!1,e()}),this.socket.disconnect()}):Promise.resolve()}subscribe(e,t){if(!this.isConnected)throw new Error("WebSocketGateway is not initialized");this.client.debug(`Subscribing to channel '${e}`);let s=i=>{i.channel===e&&t(null,i)},n=i=>{this.socket.off("message",s),this.unsubscribe(e,i)};return this.socket.emit("subscribe",{channel:e},i=>{if(i.status==="error")return this.client.debug(`Error subscribed to channel '${e}`,i),t(new Error(i.message));this.subscribedChannels.add(e),this.client.debug(`Subscribed to channel '${e}`),this.socket.on("message",s)}),n}unsubscribe(e,t){if(!this.isConnected)throw new Error("WebSocketGateway is not initialized");this.client.debug(`Unsubscribing from channel '${e}`),this.socket.emit("unsubscribe",{channel:e},s=>{s.status==="error"?(this.client.debug(`Error unsubscribing from channel '${e}`,s),t&&t(new Error(s.message))):(this.subscribedChannels.delete(e),this.client.debug(`Unsubscribed from channel '${e}`),t&&t(null))})}};var Tt=class{constructor(e,t=null,s){this.baseUrl=e;this.apiKey=t;this.debug=(0,Bs.debug)("flow-engine-client");this.accessToken=null;this.auth=new Be(this);this.tiles=new Ue(this);this.maps=new Le(this);this.apiKeys=new Ae(this);this.applications=new Te(this);this.appconfig=new Oe(this);this.databases=new Ne(this);this.datasets=new Fe(this);this.styles=new Ie(this);this.tileSources=new De(this);this.uploads=new Me(this);this.jobs=new qe(this);this.axios=Ps.default.create({baseURL:e,maxContentLength:524288e3}),this.webSocketGateway=new ye(this,s)}connect(){return this.webSocketGateway.connect()}disconnect(){return this.webSocketGateway.disconnect()}config(){return this._get("/api/v1/config")}_get(e,t={}){var s;return(s=t.params)!=null&&s.apiKey&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(x(x({method:"get",url:e},t),this.headers(t))).then(n=>n.data).catch(this.handleError)}_post(e,t,s={}){var n;return(n=s.params)!=null&&n.apiKey&&(s.apiKey=s.params.apiKey,delete s.params.apiKey),this.axios(x(x({method:"post",url:e,data:t,maxContentLength:1/0,maxBodyLength:1/0},s),this.headers(s))).then(i=>i.data).catch(this.handleError)}_put(e,t,s={}){var n;return(n=s.params)!=null&&n.apiKey&&(s.apiKey=s.params.apiKey,delete s.params.apiKey),this.axios(x(x({method:"put",url:e,data:t},s),this.headers(s))).then(i=>i.data).catch(this.handleError)}_delete(e,t={}){var s;return(s=t.params)!=null&&s.apiKey&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(x(x({method:"delete",url:e},t),this.headers(t))).then(n=>n.data).catch(this.handleError)}_subscribe(e,t){return this.webSocketGateway.isConnected||this.webSocketGateway.connect(),this.webSocketGateway.subscribe(e,t)}_unsubscribe(e,t){this.webSocketGateway.isConnected||this.webSocketGateway.connect(),this.webSocketGateway.unsubscribe(e,t)}handleError(e){if(e.response&&e.response.data){if(typeof e.response.data=="object"){let s=e.response.data;throw new L(s.message||s.error,s.error,e.response.status)}else if(typeof e.response.data=="string")throw new L(e.response.data,null,e.response.status)}let t=e;throw delete t.config,delete t.request,delete t.response,new L(t.message,t)}headers(e){let t=e.headers||{};return(e.apiKey||this.apiKey)&&(t["X-Api-Key"]=e.apiKey||this.apiKey),this.accessToken&&(t.Authorization=t.Authorization||`Bearer ${this.accessToken}`),{headers:t}}};return Ws(Ai);})();
2
+ `),function(c){if(i=c.indexOf(":"),s=ht.trim(c.substr(0,i)).toLowerCase(),n=ht.trim(c.substr(i+1)),s){if(t[s]&&yn.indexOf(s)>=0)return;s==="set-cookie"?t[s]=(t[s]?t[s]:[]).concat([n]):t[s]=t[s]?t[s]+", "+n:n}}),t}});var fr=f((Ki,lr)=>{"use strict";var hr=v();lr.exports=hr.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),s;function n(i){var o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=n(window.location.href),function(o){var c=hr.isString(o)?n(o):o;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}()});var ie=f((Vi,dr)=>{"use strict";var lt=M(),gn=v();function pr(r){lt.call(this,r==null?"canceled":r,lt.ERR_CANCELED),this.name="CanceledError"}gn.inherits(pr,lt,{__CANCEL__:!0});dr.exports=pr});var yr=f((Hi,mr)=>{"use strict";mr.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}});var ft=f((Ji,gr)=>{"use strict";var oe=v(),bn=er(),vn=rr(),wn=it(),Cn=ut(),En=ur(),xn=fr(),kn=ot(),q=M(),Sn=ie(),Rn=yr();gr.exports=function(e){return new Promise(function(s,n){var i=e.data,o=e.headers,c=e.responseType,h;function m(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}oe.isFormData(i)&&oe.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",l=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+l)}var g=Cn(e.baseURL,e.url);a.open(e.method.toUpperCase(),wn(g,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function re(){if(a){var b="getAllResponseHeaders"in a?En(a.getAllResponseHeaders()):null,P=!c||c==="text"||c==="json"?a.responseText:a.response,F={data:P,status:a.status,statusText:a.statusText,headers:b,config:e,request:a};bn(function(ge){s(ge),m()},function(ge){n(ge),m()},F),a=null}}if("onloadend"in a?a.onloadend=re:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(re)},a.onabort=function(){a&&(n(new q("Request aborted",q.ECONNABORTED,e,a)),a=null)},a.onerror=function(){n(new q("Network Error",q.ERR_NETWORK,e,a,a)),a=null},a.ontimeout=function(){var P=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",F=e.transitional||kn;e.timeoutErrorMessage&&(P=e.timeoutErrorMessage),n(new q(P,F.clarifyTimeoutError?q.ETIMEDOUT:q.ECONNABORTED,e,a)),a=null},oe.isStandardBrowserEnv()){var S=(e.withCredentials||xn(g))&&e.xsrfCookieName?vn.read(e.xsrfCookieName):void 0;S&&(o[e.xsrfHeaderName]=S)}"setRequestHeader"in a&&oe.forEach(o,function(P,F){typeof i>"u"&&F.toLowerCase()==="content-type"?delete o[F]:a.setRequestHeader(F,P)}),oe.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),c&&c!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(b){a&&(n(!b||b&&b.type?new Sn:b),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),i||(i=null);var C=Rn(g);if(C&&["http","https","file"].indexOf(C)===-1){n(new q("Unsupported protocol "+C+":",q.ERR_BAD_REQUEST,e));return}a.send(i)})}});var vr=f((zi,br)=>{br.exports=null});var xe=f((Qi,xr)=>{"use strict";var w=v(),wr=Ht(),Cr=M(),_n=ot(),An=at(),On={"Content-Type":"application/x-www-form-urlencoded"};function Er(r,e){!w.isUndefined(r)&&w.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Tn(){var r;return typeof XMLHttpRequest<"u"?r=ft():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=ft()),r}function Pn(r,e,t){if(w.isString(r))try{return(e||JSON.parse)(r),w.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var Ee={transitional:_n,adapter:Tn(),transformRequest:[function(e,t){if(wr(t,"Accept"),wr(t,"Content-Type"),w.isFormData(e)||w.isArrayBuffer(e)||w.isBuffer(e)||w.isStream(e)||w.isFile(e)||w.isBlob(e))return e;if(w.isArrayBufferView(e))return e.buffer;if(w.isURLSearchParams(e))return Er(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=w.isObject(e),n=t&&t["Content-Type"],i;if((i=w.isFileList(e))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return An(i?{"files[]":e}:e,o&&new o)}else if(s||n==="application/json")return Er(t,"application/json"),Pn(e);return e}],transformResponse:[function(e){var t=this.transitional||Ee.transitional,s=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!s&&this.responseType==="json";if(i||n&&w.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?Cr.from(o,Cr.ERR_BAD_RESPONSE,this,null,this.response):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vr()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};w.forEach(["delete","get","head"],function(e){Ee.headers[e]={}});w.forEach(["post","put","patch"],function(e){Ee.headers[e]=w.merge(On)});xr.exports=Ee});var Sr=f((Yi,kr)=>{"use strict";var Bn=v(),Nn=xe();kr.exports=function(e,t,s){var n=this||Nn;return Bn.forEach(s,function(o){e=o.call(n,e,t)}),e}});var pt=f((Xi,Rr)=>{"use strict";Rr.exports=function(e){return!!(e&&e.__CANCEL__)}});var Or=f((Gi,Ar)=>{"use strict";var _r=v(),dt=Sr(),Fn=pt(),qn=xe(),Ln=ie();function mt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Ln}Ar.exports=function(e){mt(e),e.headers=e.headers||{},e.data=dt.call(e,e.data,e.headers,e.transformRequest),e.headers=_r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),_r.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||qn.adapter;return t(e).then(function(n){return mt(e),n.data=dt.call(e,n.data,n.headers,e.transformResponse),n},function(n){return Fn(n)||(mt(e),n&&n.response&&(n.response.data=dt.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var yt=f((Zi,Tr)=>{"use strict";var R=v();Tr.exports=function(e,t){t=t||{};var s={};function n(a,u){return R.isPlainObject(a)&&R.isPlainObject(u)?R.merge(a,u):R.isPlainObject(u)?R.merge({},u):R.isArray(u)?u.slice():u}function i(a){if(R.isUndefined(t[a])){if(!R.isUndefined(e[a]))return n(void 0,e[a])}else return n(e[a],t[a])}function o(a){if(!R.isUndefined(t[a]))return n(void 0,t[a])}function c(a){if(R.isUndefined(t[a])){if(!R.isUndefined(e[a]))return n(void 0,e[a])}else return n(void 0,t[a])}function h(a){if(a in t)return n(e[a],t[a]);if(a in e)return n(void 0,e[a])}var m={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:h};return R.forEach(Object.keys(e).concat(Object.keys(t)),function(u){var l=m[u]||i,g=l(u);R.isUndefined(g)&&l!==h||(s[u]=g)}),s}});var gt=f((eo,Pr)=>{Pr.exports={version:"0.27.2"}});var Fr=f((to,Nr)=>{"use strict";var In=gt().version,D=M(),bt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){bt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var Br={};bt.transitional=function(e,t,s){function n(i,o){return"[Axios v"+In+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return function(i,o,c){if(e===!1)throw new D(n(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!Br[o]&&(Br[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,c):!0}};function Dn(r,e,t){if(typeof r!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(r),n=s.length;n-- >0;){var i=s[n],o=e[i];if(o){var c=r[i],h=c===void 0||o(c,i,r);if(h!==!0)throw new D("option "+i+" must be "+h,D.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}Nr.exports={assertOptions:Dn,validators:bt}});var Mr=f((ro,Ur)=>{"use strict";var Ir=v(),Un=it(),qr=Kt(),Lr=Or(),ke=yt(),Mn=ut(),Dr=Fr(),J=Dr.validators;function z(r){this.defaults=r,this.interceptors={request:new qr,response:new qr}}z.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ke(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&Dr.assertOptions(s,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(i=i&&g.synchronous,n.unshift(g.fulfilled,g.rejected))});var o=[];this.interceptors.response.forEach(function(g){o.push(g.fulfilled,g.rejected)});var c;if(!i){var h=[Lr,void 0];for(Array.prototype.unshift.apply(h,n),h=h.concat(o),c=Promise.resolve(t);h.length;)c=c.then(h.shift(),h.shift());return c}for(var m=t;n.length;){var a=n.shift(),u=n.shift();try{m=a(m)}catch(l){u(l);break}}try{c=Lr(m)}catch(l){return Promise.reject(l)}for(;o.length;)c=c.then(o.shift(),o.shift());return c};z.prototype.getUri=function(e){e=ke(this.defaults,e);var t=Mn(e.baseURL,e.url);return Un(t,e.params,e.paramsSerializer)};Ir.forEach(["delete","get","head","options"],function(e){z.prototype[e]=function(t,s){return this.request(ke(s||{},{method:e,url:t,data:(s||{}).data}))}});Ir.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,c){return this.request(ke(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}z.prototype[e]=t(),z.prototype[e+"Form"]=t(!0)});Ur.exports=z});var Wr=f((so,$r)=>{"use strict";var $n=ie();function Q(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;this.promise.then(function(s){if(t._listeners){var n,i=t._listeners.length;for(n=0;n<i;n++)t._listeners[n](s);t._listeners=null}}),this.promise.then=function(s){var n,i=new Promise(function(o){t.subscribe(o),n=o}).then(s);return i.cancel=function(){t.unsubscribe(n)},i},r(function(n){t.reason||(t.reason=new $n(n),e(t.reason))})}Q.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Q.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};Q.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};Q.source=function(){var e,t=new Q(function(n){e=n});return{token:t,cancel:e}};$r.exports=Q});var Kr=f((no,jr)=>{"use strict";jr.exports=function(e){return function(s){return e.apply(null,s)}}});var Hr=f((io,Vr)=>{"use strict";var Wn=v();Vr.exports=function(e){return Wn.isObject(e)&&e.isAxiosError===!0}});var Qr=f((oo,vt)=>{"use strict";var Jr=v(),jn=Ge(),Se=Mr(),Kn=yt(),Vn=xe();function zr(r){var e=new Se(r),t=jn(Se.prototype.request,e);return Jr.extend(t,Se.prototype,e),Jr.extend(t,e),t.create=function(n){return zr(Kn(r,n))},t}var k=zr(Vn);k.Axios=Se;k.CanceledError=ie();k.CancelToken=Wr();k.isCancel=pt();k.VERSION=gt().version;k.toFormData=at();k.AxiosError=M();k.Cancel=k.CanceledError;k.all=function(e){return Promise.all(e)};k.spread=Kr();k.isAxiosError=Hr();vt.exports=k;vt.exports.default=k});var Xr=f((ao,Yr)=>{Yr.exports=Qr()});var Zr=f((co,Gr)=>{var Y=1e3,X=Y*60,G=X*60,$=G*24,Hn=$*7,Jn=$*365.25;Gr.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return zn(r);if(t==="number"&&isFinite(r))return e.long?Yn(r):Qn(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function zn(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return t*Jn;case"weeks":case"week":case"w":return t*Hn;case"days":case"day":case"d":return t*$;case"hours":case"hour":case"hrs":case"hr":case"h":return t*G;case"minutes":case"minute":case"mins":case"min":case"m":return t*X;case"seconds":case"second":case"secs":case"sec":case"s":return t*Y;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Qn(r){var e=Math.abs(r);return e>=$?Math.round(r/$)+"d":e>=G?Math.round(r/G)+"h":e>=X?Math.round(r/X)+"m":e>=Y?Math.round(r/Y)+"s":r+"ms"}function Yn(r){var e=Math.abs(r);return e>=$?Re(r,e,$,"day"):e>=G?Re(r,e,G,"hour"):e>=X?Re(r,e,X,"minute"):e>=Y?Re(r,e,Y,"second"):r+" ms"}function Re(r,e,t,s){var n=e>=t*1.5;return Math.round(r/t)+" "+s+(n?"s":"")}});var ts=f((uo,es)=>{function Xn(r){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=o,t.humanize=Zr(),t.destroy=m,Object.keys(r).forEach(a=>{t[a]=r[a]}),t.names=[],t.skips=[],t.formatters={};function e(a){let u=0;for(let l=0;l<a.length;l++)u=(u<<5)-u+a.charCodeAt(l),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(a){let u,l=null,g,re;function S(...C){if(!S.enabled)return;let b=S,P=Number(new Date),F=P-(u||P);b.diff=F,b.prev=u,b.curr=P,u=P,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let K=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(Ye,Ns)=>{if(Ye==="%%")return"%";K++;let Pt=t.formatters[Ns];if(typeof Pt=="function"){let Fs=C[K];Ye=Pt.call(b,Fs),C.splice(K,1),K--}return Ye}),t.formatArgs.call(b,C),(b.log||t.log).apply(b,C)}return S.namespace=a,S.useColors=t.useColors(),S.color=t.selectColor(a),S.extend=s,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(g!==t.namespaces&&(g=t.namespaces,re=t.enabled(a)),re),set:C=>{l=C}}),typeof t.init=="function"&&t.init(S),S}function s(a,u){let l=t(this.namespace+(typeof u>"u"?":":u)+a);return l.log=this.log,l}function n(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let u,l=(typeof a=="string"?a:"").split(/[\s,]+/),g=l.length;for(u=0;u<g;u++)l[u]&&(a=l[u].replace(/\*/g,".*?"),a[0]==="-"?t.skips.push(new RegExp("^"+a.slice(1)+"$")):t.names.push(new RegExp("^"+a+"$")))}function i(){let a=[...t.names.map(c),...t.skips.map(c).map(u=>"-"+u)].join(",");return t.enable(""),a}function o(a){if(a[a.length-1]==="*")return!0;let u,l;for(u=0,l=t.skips.length;u<l;u++)if(t.skips[u].test(a))return!1;for(u=0,l=t.names.length;u<l;u++)if(t.names[u].test(a))return!0;return!1}function c(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function h(a){return a instanceof Error?a.stack||a.message:a}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}es.exports=Xn});var rs=f((_,_e)=>{_.formatArgs=Zn;_.save=ei;_.load=ti;_.useColors=Gn;_.storage=ri();_.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();_.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Gn(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Zn(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+_e.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,s=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(s=t))}),r.splice(s,0,e)}_.log=console.debug||console.log||(()=>{});function ei(r){try{r?_.storage.setItem("debug",r):_.storage.removeItem("debug")}catch(e){}}function ti(){let r;try{r=_.storage.getItem("debug")}catch(e){}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function ri(){try{return localStorage}catch(r){}}_e.exports=ts()(_);var{formatters:si}=_e.exports;si.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ns=f((qo,ss)=>{ss.exports=typeof self=="object"?self.FormData:window.FormData});var Ai={};qt(Ai,{BaseEndpoints:()=>y,Client:()=>Tt,FlowEngineError:()=>L,WebSocketChannel:()=>Ts,WebSocketGateway:()=>ye});var Ps=Xe(Xr()),Bs=Xe(rs());var y=class{constructor(e,t){this.client=e;this.resourcePath=t}get resourceEndpoint(){return`/api/v1/${this.resourcePath}`}list(e){if(e!=null&&e.filter){let t=e.filter;Object.keys(t).forEach(s=>{e[`filter[${s}]`]=t[s]}),delete e.filter}return this.client._get(this.resourceEndpoint,{params:e})}get(e,t={}){return this.client._get(`${this.resourceEndpoint}/${e}`,{params:t})}create(e,t={}){return this.client._post(`${this.resourceEndpoint}`,e,{params:t})}update(e,t,s={}){return this.client._put(`${this.resourceEndpoint}/${e}`,t,{params:s})}delete(e,t={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:t})}getMetadata(e,t,s={}){let n=t?`${this.resourceEndpoint}/${e}/metadata/${t}`:`${this.resourceEndpoint}/${e}/metadata`;return this.client._get(n,{params:s})}setMetadata(e,t,s,n={}){return(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&(s={value:s}),this.client._put(`${this.resourceEndpoint}/${e}/metadata/${t}`,s,{headers:{"Content-Type":"application/json"},params:n})}deleteMetadata(e,t,s={}){return this.client._delete(`${this.resourceEndpoint}/${e}/metadata/${t}`,{headers:{"Content-Type":"application/json"},params:s})}};var Ae=class extends y{constructor(e){super(e,"apikeys")}};var Oe=class{constructor(e){this.client=e}get resourceEndpoint(){return"/api/v1/appconfig"}get(e,t={}){return this.client._get(e?`${this.resourceEndpoint}/${e}`:this.resourceEndpoint,{params:t})}set(e,t,s={}){return(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null||Array.isArray(t))&&(t={value:t}),this.client._put(`${this.resourceEndpoint}/${e}`,t,{headers:{"Content-Type":"application/json"},params:s})}delete(e,t={}){return this.client._delete(`${this.resourceEndpoint}/${e}`,{params:t})}subscribe(e){return this.client._subscribe("appconfig",e)}};var Te=class extends y{constructor(e){super(e,"applications")}};var Pe=class extends y{constructor(e){super(e,"auth/users")}me(e){return this.client._get(`${this.resourceEndpoint}/me`,{headers:{Authorization:`Bearer ${e}`}})}};var Be=class{constructor(e){this.client=e;this.users=new Pe(this.client)}login(e,t,s){return this.client._post("/api/v1/auth/login",{email:e,password:t,applicationId:s})}logout(e,t){return this.client._post("/api/v1/auth/logout",{refreshToken:t},{headers:{Authorization:`Bearer ${e}`}})}refresh(e,t){return this.client._post("/api/v1/auth/refresh",{refreshToken:e,applicationId:t})}changePassword(e,t,s){return this.client._post("/api/v1/auth/changepassword",{password:e,newPassword:t},{headers:{Authorization:`Bearer ${s}`}})}signUp(e,t,s,n,i,o,c){return c||(c=o,o=`${this.client.baseUrl}/api/v1/auth/confirmsignup`),this.client._post("/api/v1/auth/signup",{firstName:e,lastName:t,email:s,password:n,applicationId:i,confirmUrl:o,redirectUrl:c})}confirmSignUp(e,t,s){return this.client._get("/api/v1/auth/confirmsignup",{params:{email:e,token:t,redirect:s}})}requestPasswordReset(e,t,s){return this.client._post("/api/v1/auth/requestpasswordreset",{email:e,applicationId:t,redirectUrl:s})}resetPassword(e,t,s,n){return this.client._post("/api/v1/auth/resetpassword",{email:e,password:t,applicationId:s,token:n})}};var Ne=class extends y{constructor(e){super(e,"databases")}drivers(){return this.client._get("/api/v1/databases/drivers").catch(e=>{if(e.status===404)return["postgis","postgis-mapnik"]})}};var Fe=class extends y{constructor(e){super(e,"datasets")}query(e,t={},s={}){return typeof e=="object"&&(s=ne(x({},e.params),{format:e.format||"json"}),t=e,e=t.datasetId,delete t.datasetId,delete t.format),typeof s=="string"&&(s={format:s}),this.client._post(`/api/v1/datasets/${e}/query`,t,{params:ne(x({},s),{format:s.format||"json",explain:s.explain||!1})}).catch(n=>{throw n.message==="Network Error"?new Error("Query timed out"):n})}ingest(e,t={}){return this.client._post(`/api/v1/datasets/${e.datasetId}/ingest`,e,t)}getExportUrl(e,t){let s=this.client.accessToken?`accesstoken=${this.client.accessToken}`:`apikey=${this.client.apiKey}`;return`${this.client.baseUrl}/api/v1/datasets/${e}/export?format=${t}&${s}`}subscribe(e,t){return this.client._subscribe(`dataset/${e}`,t)}};var L=class extends Error{constructor(t,s=null,n=500){super(t||"Unknown Error");Object.setPrototypeOf(this,L.prototype),this.statusCode=n,this.error=s}};var qe=class extends y{constructor(e){super(e,"jobs")}submit(e){return this.client._post("/api/v1/jobs/submit",e)}getStatus(e){return this.client._get(`/api/v1/jobs/${e}/status`)}setStatus(e,t){return this.client._post(`/api/v1/jobs/${e}/status`,t)}cancel(e){return this.client._post(`/api/v1/jobs/${e}/cancel`,{})}request(e){return this.client._post("/api/v1/jobs/request",{type:e})}};var Le=class{constructor(e){this.client=e}get(e,t={}){return this.client._get(`/maps/${e}.json`,{params:t})}};var Ie=class extends y{constructor(e){super(e,"styles")}};var De=class extends y{constructor(e){super(e,"tilesources")}drivers(){return this.client._get("/api/v1/tilesources/drivers").catch(e=>{if(e.statusCode===404)return["tilelive","dataset"]})}};var Ue=class{constructor(e){this.client=e}getTileSpec(e,t={}){return this.client._get(`/tiles/${e}/index.json`,{params:t})}getPreviewStyle(e,t={}){return this.client._get(`/tiles/${e}/style.json`,{params:t})}};var is=Xe(ns()),Me=class extends y{constructor(e){super(e,"uploads")}async upload(e,t={}){let s=new is.default;return e.datasetName&&s.append("name",e.datasetName),e.datasetDescription&&s.append("description",e.datasetDescription),e.attribution&&s.append("attribution",e.attribution),e.datasetId&&s.append("datasetId",e.datasetId),e.sourceSrid&&s.append("sourceSrid",e.sourceSrid),e.targetSrid&&s.append("targetSrid",e.targetSrid),e.schema&&s.append("schema",e.schema),s.append("file",e.data,e.filename),await this.client._post(this.resourceEndpoint,s,{headers:s.getHeaders(),params:t,onUploadProgress:e.progress})}};var N=Object.create(null);N.open="0";N.close="1";N.ping="2";N.pong="3";N.message="4";N.upgrade="5";N.noop="6";var ae=Object.create(null);Object.keys(N).forEach(r=>{ae[N[r]]=r});var os={type:"error",data:"parser error"};var ni=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ii=typeof ArrayBuffer=="function",oi=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ai=({type:r,data:e},t,s)=>ni&&e instanceof Blob?t?s(e):as(e,s):ii&&(e instanceof ArrayBuffer||oi(e))?t?s(e):as(new Blob([e]),s):s(N[r]+(e||"")),as=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)},$e=ai;var cs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<cs.length;r++)ce[cs.charCodeAt(r)]=r;var us=r=>{let e=r.length*.75,t=r.length,s,n=0,i,o,c,h;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),a=new Uint8Array(m);for(s=0;s<t;s+=4)i=ce[r.charCodeAt(s)],o=ce[r.charCodeAt(s+1)],c=ce[r.charCodeAt(s+2)],h=ce[r.charCodeAt(s+3)],a[n++]=i<<2|o>>4,a[n++]=(o&15)<<4|c>>2,a[n++]=(c&3)<<6|h&63;return m};var ci=typeof ArrayBuffer=="function",ui=(r,e)=>{if(typeof r!="string")return{type:"message",data:hs(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:hi(r.substring(1),e)}:ae[t]?r.length>1?{type:ae[t],data:r.substring(1)}:{type:ae[t]}:os},hi=(r,e)=>{if(ci){let t=us(r);return hs(t,e)}else return{base64:!0,data:r}},hs=(r,e)=>{switch(e){case"blob":return r instanceof ArrayBuffer?new Blob([r]):r;case"arraybuffer":default:return r}},We=ui;var ls=String.fromCharCode(30),fs=(r,e)=>{let t=r.length,s=new Array(t),n=0;r.forEach((i,o)=>{$e(i,!1,c=>{s[o]=c,++n===t&&e(s.join(ls))})})},ps=(r,e)=>{let t=r.split(ls),s=[];for(let n=0;n<t.length;n++){let i=We(t[n],e);if(s.push(i),i.type==="error")break}return s},wt=4;function d(r){if(r)return li(r)}function li(r){for(var e in d.prototype)r[e]=d.prototype[e];return r}d.prototype.on=d.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};d.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,n=0;n<t.length;n++)if(s=t[n],s===e||s.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+r],this};d.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,n=t.length;s<n;++s)t[s].apply(this,e)}return this};d.prototype.emitReserved=d.prototype.emit;d.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};d.prototype.hasListeners=function(r){return!!this.listeners(r).length};var E=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function je(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var fi=E.setTimeout,pi=E.clearTimeout;function I(r,e){e.useNativeTimers?(r.setTimeoutFn=fi.bind(E),r.clearTimeoutFn=pi.bind(E)):(r.setTimeoutFn=E.setTimeout.bind(E),r.clearTimeoutFn=E.clearTimeout.bind(E))}var di=1.33;function ds(r){return typeof r=="string"?mi(r):Math.ceil((r.byteLength||r.size)*di)}function mi(r){let e=0,t=0;for(let s=0,n=r.length;s<n;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}var Ct=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},W=class extends d{constructor(e){super(),this.writable=!1,I(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,s){return super.emitReserved("error",new Ct(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=We(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}};var bs="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Et=64,yi={},ms=0,Ke=0,ys;function gs(r){let e="";do e=bs[r%Et]+e,r=Math.floor(r/Et);while(r>0);return e}function Ve(){let r=gs(+new Date);return r!==ys?(ms=0,ys=r):r+"."+gs(ms++)}for(;Ke<Et;Ke++)yi[bs[Ke]]=Ke;function He(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function vs(r){let e={},t=r.split("&");for(let s=0,n=t.length;s<n;s++){let i=t[s].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}var ws=!1;try{ws=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(r){}var Cs=ws;function xt(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Cs))return new XMLHttpRequest}catch(t){}if(!e)try{return new E[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function gi(){}var bi=function(){return new xt({xdomain:!1}).responseType!=null}(),Je=class extends W{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){let s=location.protocol==="https:",n=location.port;n||(n=s?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==s}let t=e&&e.forceBase64;this.supportsBinary=bi&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let s=0;this.polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};ps(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,fs(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{},t=this.opts.secure?"https":"http",s="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Ve()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(s=":"+this.opts.port);let n=He(e),i=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(n.length?"?"+n:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new T(this.uri(),e)}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(n,i)=>{this.onError("xhr post error",n,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},T=class extends d{constructor(e,t){super(),I(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){let e=je(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;let t=this.xhr=new xt(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&t.setRequestHeader(s,this.opts.extraHeaders[s])}}catch(s){}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{t.setRequestHeader("Accept","*/*")}catch(s){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=T.requestsCount++,T.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=gi,e)try{this.xhr.abort()}catch(t){}typeof document<"u"&&delete T.requests[this.index],this.xhr=null}}onLoad(){let e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};T.requestsCount=0;T.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Es);else if(typeof addEventListener=="function"){let r="onpagehide"in E?"pagehide":"unload";addEventListener(r,Es,!1)}}function Es(){for(let r in T.requests)T.requests.hasOwnProperty(r)&&T.requests[r].abort()}var ue=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),he=E.WebSocket||E.MozWebSocket,ze=!0,xs="arraybuffer";var ks=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Qe=class extends W{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let e=this.uri(),t=this.opts.protocols,s=ks?{}:je(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=ze&&!ks?t?new he(e,t):new he(e):new he(e,t,s)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType||xs,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],n=t===e.length-1;$e(s,this.supportsBinary,i=>{let o={};ze||(s.options&&(o.compress=s.options.compress),this.opts.perMessageDeflate&&(typeof i=="string"?Buffer.byteLength(i):i.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{ze?this.ws.send(i):this.ws.send(i,o)}catch(c){}n&&ue(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{},t=this.opts.secure?"wss":"ws",s="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(s=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Ve()),this.supportsBinary||(e.b64=1);let n=He(e),i=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(n.length?"?"+n:"")}check(){return!!he}};var kt={websocket:Qe,polling:Je};var vi=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,wi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Z(r){let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let n=vi.exec(r||""),i={},o=14;for(;o--;)i[wi[o]]=n[o]||"";return t!=-1&&s!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ci(i,i.path),i.queryKey=Ei(i,i.query),i}function Ci(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Ei(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,n,i){n&&(t[n]=i)}),t}var A=class extends d{constructor(e,t={}){super(),this.writeBuffer=[],e&&typeof e=="object"&&(t=e,e=null),e?(e=Z(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Z(t.host).host),I(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=vs(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=wt,t.transport=e,this.id&&(t.sid=this.id);let s=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new kt[e](s)}open(){let e;if(this.opts.rememberUpgrade&&A.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch(t){this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),s=!1;A.priorWebsocketSuccess=!1;let n=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!s)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;A.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(a(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let l=new Error("probe error");l.transport=t.name,this.emitReserved("upgradeError",l)}}))};function i(){s||(s=!0,a(),t.close(),t=null)}let o=u=>{let l=new Error("probe error: "+u);l.transport=t.name,i(),this.emitReserved("upgradeError",l)};function c(){o("transport closed")}function h(){o("socket closed")}function m(u){t&&u.name!==t.name&&i()}let a=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",m)};t.once("open",n),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",m),t.open()}onOpen(){if(this.readyState="open",A.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0,t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){let n=this.writeBuffer[s].data;if(n&&(t+=ds(n)),s>0&&t>this.maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}write(e,t,s){return this.sendPacket("message",e,t,s),this}send(e,t,s){return this.sendPacket("message",e,t,s),this}sendPacket(e,t,s,n){if(typeof t=="function"&&(n=t,t=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;let i={type:e,data:t,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}onError(e){A.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){let t=[],s=0,n=e.length;for(;s<n;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}};A.protocol=wt;var Da=A.protocol;function Ss(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=Z(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let i=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port+e,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}var Ot={};qt(Ot,{Decoder:()=>pe,Encoder:()=>_t,PacketType:()=>p,protocol:()=>Os});var xi=typeof ArrayBuffer=="function",ki=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Rs=Object.prototype.toString,Si=typeof Blob=="function"||typeof Blob<"u"&&Rs.call(Blob)==="[object BlobConstructor]",Ri=typeof File=="function"||typeof File<"u"&&Rs.call(File)==="[object FileConstructor]";function fe(r){return xi&&(r instanceof ArrayBuffer||ki(r))||Si&&r instanceof Blob||Ri&&r instanceof File}function le(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(le(r[t]))return!0;return!1}if(fe(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return le(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&le(r[t]))return!0;return!1}function _s(r){let e=[],t=r.data,s=r;return s.data=St(t,e),s.attachments=e.length,{packet:s,buffers:e}}function St(r,e){if(!r)return r;if(fe(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=St(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=St(r[s],e));return t}return r}function As(r,e){return r.data=Rt(r.data,e),delete r.attachments,r}function Rt(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=Rt(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=Rt(r[t],e));return r}var Os=5,p;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(p||(p={}));var _t=class{constructor(e){this.replacer=e}encode(e){return(e.type===p.EVENT||e.type===p.ACK)&&le(e)?this.encodeAsBinary({type:e.type===p.EVENT?p.BINARY_EVENT:p.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===p.BINARY_EVENT||e.type===p.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=_s(e),s=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(s),n}},pe=class extends d{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===p.BINARY_EVENT;s||t.type===p.BINARY_ACK?(t.type=s?p.EVENT:p.ACK,this.reconstructor=new At(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(fe(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(p[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===p.BINARY_EVENT||s.type===p.BINARY_ACK){let i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(i,t)}else s.nsp="/";let n=e.charAt(t+1);if(n!==""&&Number(n)==n){let i=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){let i=this.tryParse(e.substr(t));if(pe.isPayloadValid(s.type,i))s.data=i;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}static isPayloadValid(e,t){switch(e){case p.CONNECT:return typeof t=="object";case p.DISCONNECT:return t===void 0;case p.CONNECT_ERROR:return typeof t=="string"||typeof t=="object";case p.EVENT:case p.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case p.ACK:case p.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},At=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=As(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function O(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var _i=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),ee=class extends d{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[O(e,"open",this.onopen.bind(this)),O(e,"packet",this.onpacket.bind(this)),O(e,"error",this.onerror.bind(this)),O(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(_i.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let s={type:p.EVENT,data:t};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let o=this.ids++,c=t.pop();this._registerAckCallback(o,c),s.id=o}let n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!n||!this.connected)||(this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var s;let n=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},n);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...o])}}emitWithAck(e,...t){let s=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((n,i)=>{t.push((o,c)=>s?o?i(o):n(c):n(o)),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...i)=>s!==this._queue[0]?void 0:(n!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(n)):(this._queue.shift(),t&&t(null,...i)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:p.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case p.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case p.EVENT:case p.BINARY_EVENT:this.onevent(e);break;case p.ACK:case p.BINARY_ACK:this.onack(e);break;case p.DISCONNECT:this.ondisconnect();break;case p.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...n){s||(s=!0,t.packet({type:p.ACK,id:e,data:n}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:p.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function j(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}j.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};j.prototype.reset=function(){this.attempts=0};j.prototype.setMin=function(r){this.ms=r};j.prototype.setMax=function(r){this.max=r};j.prototype.setJitter=function(r){this.jitter=r};var te=class extends d{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,I(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new j({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let n=t.parser||Ot;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new A(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let n=O(t,"open",function(){s.onopen(),e&&e()}),i=O(t,"error",o=>{s.cleanup(),s._readyState="closed",this.emitReserved("error",o),e?e(o):s.maybeReconnectOnOpen()});if(this._timeout!==!1){let o=this._timeout;o===0&&n();let c=this.setTimeoutFn(()=>{n(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&c.unref(),this.subs.push(function(){clearTimeout(c)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(O(e,"ping",this.onping.bind(this)),O(e,"data",this.ondata.bind(this)),O(e,"error",this.onerror.bind(this)),O(e,"close",this.onclose.bind(this)),O(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){ue(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new ee(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var de={};function me(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Ss(r,e.path||"/socket.io"),s=t.source,n=t.id,i=t.path,o=de[n]&&i in de[n].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return c?h=new te(s,e):(de[n]||(de[n]=new te(s,e)),h=de[n]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(me,{Manager:te,Socket:ee,io:me,connect:me});var Ts=(s=>(s.System="system",s.AppConfig="appconfig",s.Dataset="dataset/",s))(Ts||{}),ye=class{constructor(e,t){this.client=e;this.options=t;this.connected=!1;this.subscribedChannels=new Set}get isConnected(){return this.connected}connect(){return this.isConnected?Promise.resolve():new Promise((e,t)=>{let s=me(this.client.baseUrl,ne(x({},this.options),{autoConnect:!1,auth:n=>{let i={};this.client.apiKey&&(i["x-api-key"]=this.client.apiKey),this.client.accessToken&&(i["x-socket-token"]=`Bearer ${this.client.accessToken}`),n(i)}}));s.on("connect",()=>{this.client.debug(`Socket connected: ${s.id}`),this.subscribedChannels.size&&this.subscribedChannels.forEach(n=>{s.emit("subscribe",{channel:n},i=>{i.status==="error"?console.error(`Error re-subscribing to channel '${n}`,i):this.client.debug(`Re-subscribed to channel '${n}`)})})}),s.io.on("reconnect_attempt",n=>{this.client.debug(`Socket reconnect attempt: ${n}`)}),s.io.on("reconnect_error",n=>{this.client.debug(`Socket reconnect error: ${n.message}`)}),s.io.on("reconnect_failed",()=>{this.client.debug("Socket reconnect failed")}),s.io.on("reconnect",()=>{this.client.debug("Socket reconnected")}),s.on("disconnect",n=>{this.client.debug(`Socket disconnected: ${n}`)}),s.on("error",n=>{this.client.debug(`Socket error: ${n.messaage}`)}),this.socket=s,this.connected=!0,s.on("connect",()=>{e()}),s.connect()})}disconnect(){return this.isConnected?new Promise(e=>{this.socket.once("disconnect",()=>{this.connected=!1,e()}),this.socket.disconnect()}):Promise.resolve()}subscribe(e,t){if(!this.isConnected)throw new Error("WebSocketGateway is not initialized");this.client.debug(`Subscribing to channel '${e}`);let s=i=>{i.channel===e&&t(null,i)},n=i=>{this.socket.off("message",s),this.unsubscribe(e,i)};return this.socket.emit("subscribe",{channel:e},i=>{if(i.status==="error")return this.client.debug(`Error subscribed to channel '${e}`,i),t(new Error(i.message));this.subscribedChannels.add(e),this.client.debug(`Subscribed to channel '${e}`),this.socket.on("message",s)}),n}unsubscribe(e,t){if(!this.isConnected)throw new Error("WebSocketGateway is not initialized");this.client.debug(`Unsubscribing from channel '${e}`),this.socket.emit("unsubscribe",{channel:e},s=>{s.status==="error"?(this.client.debug(`Error unsubscribing from channel '${e}`,s),t&&t(new Error(s.message))):(this.subscribedChannels.delete(e),this.client.debug(`Unsubscribed from channel '${e}`),t&&t(null))})}};var Tt=class{constructor(e,t=null,s){this.baseUrl=e;this.apiKey=t;this.debug=(0,Bs.debug)("flow-engine-client");this.accessToken=null;this.auth=new Be(this);this.tiles=new Ue(this);this.maps=new Le(this);this.apiKeys=new Ae(this);this.applications=new Te(this);this.appconfig=new Oe(this);this.databases=new Ne(this);this.datasets=new Fe(this);this.styles=new Ie(this);this.tileSources=new De(this);this.uploads=new Me(this);this.jobs=new qe(this);this.axios=Ps.default.create({baseURL:e,maxContentLength:524288e3,transformResponse:[function(i,o){var c;return(c=o==null?void 0:o["content-type"])!=null&&c.startsWith("application/json")?JSON.parse(i):i}]}),this.webSocketGateway=new ye(this,s)}connect(){return this.webSocketGateway.connect()}disconnect(){return this.webSocketGateway.disconnect()}config(){return this._get("/api/v1/config")}_get(e,t={}){var s;return(s=t.params)!=null&&s.apiKey&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(x(x({method:"get",url:e},t),this.headers(t))).then(n=>n.data).catch(this.handleError)}_post(e,t,s={}){var n;return(n=s.params)!=null&&n.apiKey&&(s.apiKey=s.params.apiKey,delete s.params.apiKey),this.axios(x(x({method:"post",url:e,data:t,maxContentLength:1/0,maxBodyLength:1/0},s),this.headers(s))).then(i=>i.data).catch(this.handleError)}_put(e,t,s={}){var n;return(n=s.params)!=null&&n.apiKey&&(s.apiKey=s.params.apiKey,delete s.params.apiKey),this.axios(x(x({method:"put",url:e,data:t},s),this.headers(s))).then(i=>i.data).catch(this.handleError)}_delete(e,t={}){var s;return(s=t.params)!=null&&s.apiKey&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(x(x({method:"delete",url:e},t),this.headers(t))).then(n=>n.data).catch(this.handleError)}_subscribe(e,t){return this.webSocketGateway.isConnected||this.webSocketGateway.connect(),this.webSocketGateway.subscribe(e,t)}_unsubscribe(e,t){this.webSocketGateway.isConnected||this.webSocketGateway.connect(),this.webSocketGateway.unsubscribe(e,t)}handleError(e){if(e.response&&e.response.data){if(typeof e.response.data=="object"){let s=e.response.data;throw new L(s.message||s.error,s.error,e.response.status)}else if(typeof e.response.data=="string")throw new L(e.response.data,null,e.response.status)}let t=e;throw delete t.config,delete t.request,delete t.response,new L(t.message,t)}headers(e){let t=e.headers||{};return(e.apiKey||this.apiKey)&&(t["X-Api-Key"]=e.apiKey||this.apiKey),this.accessToken&&(t.Authorization=t.Authorization||`Bearer ${this.accessToken}`),{headers:t}}};return Ws(Ai);})();
3
3
  //# sourceMappingURL=bundle.js.map