@emuanalytics/flow-engine-client 1.3.127 → 1.3.134
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 +1 -1
- package/dist/bundle.js.map +3 -3
- package/dist/cjs/lib/appconfig.endpoints.js +1 -1
- package/dist/cjs/lib/appconfig.endpoints.js.map +1 -1
- package/dist/cjs/lib/client.js +2 -2
- package/dist/cjs/lib/client.js.map +1 -1
- package/dist/esm/lib/appconfig.endpoints.js +1 -1
- package/dist/esm/lib/appconfig.endpoints.js.map +1 -1
- package/dist/esm/lib/client.js +1 -1
- package/dist/esm/lib/client.js.map +1 -1
- package/dist/types/lib/appconfig.endpoints.d.ts +1 -1
- package/dist/types/lib/appconfig.endpoints.d.ts.map +1 -1
- package/dist/types/lib/client.d.ts +2 -2
- package/dist/types/lib/client.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/bundle.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";var FlowEngineClient=(()=>{var Ls=Object.create;var se=Object.defineProperty,Is=Object.defineProperties,Ds=Object.getOwnPropertyDescriptor,Us=Object.getOwnPropertyDescriptors,Ms=Object.getOwnPropertyNames,Nt=Object.getOwnPropertySymbols,$s=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty,Ws=Object.prototype.propertyIsEnumerable;var Ft=(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={}))qt.call(e,t)&&Ft(r,t,e[t]);if(Nt)for(var t of Nt(e))Ws.call(e,t)&&Ft(r,t,e[t]);return r},ne=(r,e)=>Is(r,Us(e));var f=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Lt=(r,e)=>{for(var t in e)se(r,t,{get:e[t],enumerable:!0})},It=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ms(e))!qt.call(r,n)&&n!==t&&se(r,n,{get:()=>e[n],enumerable:!(s=Ds(e,n))||s.enumerable});return r};var Ge=(r,e,t)=>(t=r!=null?Ls($s(r)):{},It(e||!r||!r.__esModule?se(t,"default",{value:r,enumerable:!0}):t,r)),js=r=>It(se({},"__esModule",{value:!0}),r);var Ze=f((Pi,Dt)=>{"use strict";Dt.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((Bi,$t)=>{"use strict";var Ks=Ze(),tt=Object.prototype.toString,rt=function(r){return function(e){var t=tt.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 rt(t)===r}}function st(r){return Array.isArray(r)}function ve(r){return typeof r>"u"}function Vs(r){return r!==null&&!ve(r)&&r.constructor!==null&&!ve(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Ut=U("ArrayBuffer");function Hs(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Ut(r.buffer),e}function Js(r){return typeof r=="string"}function zs(r){return typeof r=="number"}function Mt(r){return r!==null&&typeof r=="object"}function be(r){if(rt(r)!=="object")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}var Qs=U("Date"),Ys=U("File"),Xs=U("Blob"),Gs=U("FileList");function nt(r){return tt.call(r)==="[object Function]"}function Zs(r){return Mt(r)&&nt(r.pipe)}function en(r){var e="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||tt.call(r)===e||nt(r.toString)&&r.toString()===e)}var tn=U("URLSearchParams");function rn(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function sn(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function it(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),st(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 et(){var r={};function e(n,i){be(r[i])&&be(n)?r[i]=et(r[i],n):be(n)?r[i]=et({},n):st(n)?r[i]=n.slice():r[i]=n}for(var t=0,s=arguments.length;t<s;t++)it(arguments[t],e);return r}function nn(r,e,t){return it(e,function(n,i){t&&typeof n=="function"?r[i]=Ks(n,t):r[i]=n}),r}function on(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function an(r,e,t,s){r.prototype=Object.create(e.prototype,s),r.prototype.constructor=r,t&&Object.assign(r.prototype,t)}function cn(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 un(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 ln(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));$t.exports={isArray:st,isArrayBuffer:Ut,isBuffer:Vs,isFormData:en,isArrayBufferView:Hs,isString:Js,isNumber:zs,isObject:Mt,isPlainObject:be,isUndefined:ve,isDate:Qs,isFile:Ys,isBlob:Xs,isFunction:nt,isStream:Zs,isURLSearchParams:tn,isStandardBrowserEnv:sn,forEach:it,merge:et,extend:nn,trim:rn,stripBOM:on,inherits:an,toFlatObject:cn,kindOf:rt,kindOfTest:U,endsWith:un,toArray:ln,isTypedArray:hn,isFileList:Gs}});var ot=f((Ni,jt)=>{"use strict";var V=v();function Wt(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}jt.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(l,m){l===null||typeof l>"u"||(V.isArray(l)?m=m+"[]":l=[l],V.forEach(l,function(u){V.isDate(u)?u=u.toISOString():V.isObject(u)&&(u=JSON.stringify(u)),i.push(Wt(m)+"="+Wt(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 Vt=f((Fi,Kt)=>{"use strict";var fn=v();function Ce(){this.handlers=[]}Ce.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};Ce.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Ce.prototype.forEach=function(e){fn.forEach(this.handlers,function(s){s!==null&&e(s)})};Kt.exports=Ce});var Jt=f((qi,Ht)=>{"use strict";var pn=v();Ht.exports=function(e,t){pn.forEach(e,function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])})}});var M=f((Li,Xt)=>{"use strict";var zt=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)}zt.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 Qt=H.prototype,Yt={};["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){Yt[r]={value:r}});Object.defineProperties(H,Yt);Object.defineProperty(Qt,"isAxiosError",{value:!0});H.from=function(r,e,t,s,n,i){var o=Object.create(Qt);return zt.toFlatObject(r,o,function(l){return l!==Error.prototype}),H.call(o,r.message,e,t,s,n),o.name=r.name,i&&Object.assign(o,i),o};Xt.exports=H});var at=f((Ii,Gt)=>{"use strict";Gt.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var ct=f((Di,Zt)=>{"use strict";var B=v();function dn(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(l,m){if(!B.isUndefined(l)){var a=o?o+"."+m:m,u;if(l&&!o&&typeof l=="object"){if(B.endsWith(m,"{}"))l=JSON.stringify(l);else if(B.endsWith(m,"[]")&&(u=B.toArray(l))){u.forEach(function(h){!B.isUndefined(h)&&e.append(a,s(h))});return}}n(l,a)}}),t.pop()}else e.append(o,s(i))}return n(r),e}Zt.exports=dn});var tr=f((Ui,er)=>{"use strict";var ut=M();er.exports=function(e,t,s){var n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new ut("Request failed with status code "+s.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}});var sr=f((Mi,rr)=>{"use strict";var we=v();rr.exports=we.isStandardBrowserEnv()?function(){return{write:function(t,s,n,i,o,c){var l=[];l.push(t+"="+encodeURIComponent(s)),we.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),we.isString(i)&&l.push("path="+i),we.isString(o)&&l.push("domain="+o),c===!0&&l.push("secure"),document.cookie=l.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 ir=f(($i,nr)=>{"use strict";nr.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}});var ar=f((Wi,or)=>{"use strict";or.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}});var lt=f((ji,cr)=>{"use strict";var mn=ir(),yn=ar();cr.exports=function(e,t){return e&&!mn(t)?yn(e,t):t}});var lr=f((Ki,ur)=>{"use strict";var ht=v(),gn=["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"];ur.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]&&gn.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 pr=f((Vi,fr)=>{"use strict";var hr=v();fr.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((Hi,mr)=>{"use strict";var ft=M(),bn=v();function dr(r){ft.call(this,r==null?"canceled":r,ft.ERR_CANCELED),this.name="CanceledError"}bn.inherits(dr,ft,{__CANCEL__:!0});mr.exports=dr});var gr=f((Ji,yr)=>{"use strict";yr.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}});var pt=f((zi,br)=>{"use strict";var oe=v(),vn=tr(),Cn=sr(),wn=ot(),En=lt(),xn=lr(),kn=pr(),Sn=at(),q=M(),Rn=ie(),_n=gr();br.exports=function(e){return new Promise(function(s,n){var i=e.data,o=e.headers,c=e.responseType,l;function m(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}oe.isFormData(i)&&oe.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+h)}var g=En(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?xn(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};vn(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||Sn;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||kn(g))&&e.xsrfCookieName?Cn.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)&&(l=function(b){a&&(n(!b||b&&b.type?new Rn:b),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l))),i||(i=null);var w=_n(g);if(w&&["http","https","file"].indexOf(w)===-1){n(new q("Unsupported protocol "+w+":",q.ERR_BAD_REQUEST,e));return}a.send(i)})}});var Cr=f((Qi,vr)=>{vr.exports=null});var xe=f((Yi,kr)=>{"use strict";var C=v(),wr=Jt(),Er=M(),An=at(),On=ct(),Tn={"Content-Type":"application/x-www-form-urlencoded"};function xr(r,e){!C.isUndefined(r)&&C.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Pn(){var r;return typeof XMLHttpRequest<"u"?r=pt():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=pt()),r}function Bn(r,e,t){if(C.isString(r))try{return(e||JSON.parse)(r),C.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var Ee={transitional:An,adapter:Pn(),transformRequest:[function(e,t){if(wr(t,"Accept"),wr(t,"Content-Type"),C.isFormData(e)||C.isArrayBuffer(e)||C.isBuffer(e)||C.isStream(e)||C.isFile(e)||C.isBlob(e))return e;if(C.isArrayBufferView(e))return e.buffer;if(C.isURLSearchParams(e))return xr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=C.isObject(e),n=t&&t["Content-Type"],i;if((i=C.isFileList(e))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return On(i?{"files[]":e}:e,o&&new o)}else if(s||n==="application/json")return xr(t,"application/json"),Bn(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&&C.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?Er.from(o,Er.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:Cr()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};C.forEach(["delete","get","head"],function(e){Ee.headers[e]={}});C.forEach(["post","put","patch"],function(e){Ee.headers[e]=C.merge(Tn)});kr.exports=Ee});var Rr=f((Xi,Sr)=>{"use strict";var Nn=v(),Fn=xe();Sr.exports=function(e,t,s){var n=this||Fn;return Nn.forEach(s,function(o){e=o.call(n,e,t)}),e}});var dt=f((Gi,_r)=>{"use strict";_r.exports=function(e){return!!(e&&e.__CANCEL__)}});var Tr=f((Zi,Or)=>{"use strict";var Ar=v(),mt=Rr(),qn=dt(),Ln=xe(),In=ie();function yt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new In}Or.exports=function(e){yt(e),e.headers=e.headers||{},e.data=mt.call(e,e.data,e.headers,e.transformRequest),e.headers=Ar.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Ar.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||Ln.adapter;return t(e).then(function(n){return yt(e),n.data=mt.call(e,n.data,n.headers,e.transformResponse),n},function(n){return qn(n)||(yt(e),n&&n.response&&(n.response.data=mt.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var gt=f((eo,Pr)=>{"use strict";var R=v();Pr.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 l(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:l};return R.forEach(Object.keys(e).concat(Object.keys(t)),function(u){var h=m[u]||i,g=h(u);R.isUndefined(g)&&h!==l||(s[u]=g)}),s}});var bt=f((to,Br)=>{Br.exports={version:"0.27.2"}});var qr=f((ro,Fr)=>{"use strict";var Dn=bt().version,D=M(),vt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){vt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var Nr={};vt.transitional=function(e,t,s){function n(i,o){return"[Axios v"+Dn+"] 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&&!Nr[o]&&(Nr[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 Un(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],l=c===void 0||o(c,i,r);if(l!==!0)throw new D("option "+i+" must be "+l,D.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}Fr.exports={assertOptions:Un,validators:vt}});var $r=f((so,Mr)=>{"use strict";var Dr=v(),Mn=ot(),Lr=Vt(),Ir=Tr(),ke=gt(),$n=lt(),Ur=qr(),J=Ur.validators;function z(r){this.defaults=r,this.interceptors={request:new Lr,response:new Lr}}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&&Ur.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 l=[Ir,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),c=Promise.resolve(t);l.length;)c=c.then(l.shift(),l.shift());return c}for(var m=t;n.length;){var a=n.shift(),u=n.shift();try{m=a(m)}catch(h){u(h);break}}try{c=Ir(m)}catch(h){return Promise.reject(h)}for(;o.length;)c=c.then(o.shift(),o.shift());return c};z.prototype.getUri=function(e){e=ke(this.defaults,e);var t=$n(e.baseURL,e.url);return Mn(t,e.params,e.paramsSerializer)};Dr.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}))}});Dr.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)});Mr.exports=z});var jr=f((no,Wr)=>{"use strict";var Wn=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 Wn(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}};Wr.exports=Q});var Vr=f((io,Kr)=>{"use strict";Kr.exports=function(e){return function(s){return e.apply(null,s)}}});var Jr=f((oo,Hr)=>{"use strict";var jn=v();Hr.exports=function(e){return jn.isObject(e)&&e.isAxiosError===!0}});var Yr=f((ao,Ct)=>{"use strict";var zr=v(),Kn=Ze(),Se=$r(),Vn=gt(),Hn=xe();function Qr(r){var e=new Se(r),t=Kn(Se.prototype.request,e);return zr.extend(t,Se.prototype,e),zr.extend(t,e),t.create=function(n){return Qr(Vn(r,n))},t}var k=Qr(Hn);k.Axios=Se;k.CanceledError=ie();k.CancelToken=jr();k.isCancel=dt();k.VERSION=bt().version;k.toFormData=ct();k.AxiosError=M();k.Cancel=k.CanceledError;k.all=function(e){return Promise.all(e)};k.spread=Vr();k.isAxiosError=Jr();Ct.exports=k;Ct.exports.default=k});var Gr=f((co,Xr)=>{Xr.exports=Yr()});var es=f((uo,Zr)=>{var Y=1e3,X=Y*60,G=X*60,$=G*24,Jn=$*7,zn=$*365.25;Zr.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Qn(r);if(t==="number"&&isFinite(r))return e.long?Xn(r):Yn(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Qn(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*zn;case"weeks":case"week":case"w":return t*Jn;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 Yn(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 Xn(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 rs=f((lo,ts)=>{function Gn(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=n,t.enabled=o,t.humanize=es(),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 h=0;h<a.length;h++)u=(u<<5)-u+a.charCodeAt(h),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(a){let u,h=null,g,re;function S(...w){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,w[0]=t.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let K=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(Xe,Fs)=>{if(Xe==="%%")return"%";K++;let Bt=t.formatters[Fs];if(typeof Bt=="function"){let qs=w[K];Xe=Bt.call(b,qs),w.splice(K,1),K--}return Xe}),t.formatArgs.call(b,w),(b.log||t.log).apply(b,w)}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:()=>h!==null?h:(g!==t.namespaces&&(g=t.namespaces,re=t.enabled(a)),re),set:w=>{h=w}}),typeof t.init=="function"&&t.init(S),S}function s(a,u){let h=t(this.namespace+(typeof u>"u"?":":u)+a);return h.log=this.log,h}function n(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let u,h=(typeof a=="string"?a:"").split(/[\s,]+/),g=h.length;for(u=0;u<g;u++)h[u]&&(a=h[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,h;for(u=0,h=t.skips.length;u<h;u++)if(t.skips[u].test(a))return!1;for(u=0,h=t.names.length;u<h;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 l(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}ts.exports=Gn});var ss=f((_,_e)=>{_.formatArgs=ei;_.save=ti;_.load=ri;_.useColors=Zn;_.storage=si();_.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 Zn(){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 ei(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 ti(r){try{r?_.storage.setItem("debug",r):_.storage.removeItem("debug")}catch(e){}}function ri(){let r;try{r=_.storage.getItem("debug")}catch(e){}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function si(){try{return localStorage}catch(r){}}_e.exports=rs()(_);var{formatters:ni}=_e.exports;ni.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var is=f((Do,ns)=>{ns.exports=typeof self=="object"?self.FormData:window.FormData});var Oi={};Lt(Oi,{BaseEndpoints:()=>y,Client:()=>Pt,FlowEngineError:()=>L,WebSocketChannel:()=>Ps,WebSocketGateway:()=>ye});var Bs=Ge(Gr()),Ns=Ge(ss());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={}){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});let n=null;return s.abortController&&(n=s.abortController,delete s.abortController),this.client._post(`/api/v1/datasets/${e}/query`,t,{params:ne(x({},s),{format:s.format||"json",explain:s.explain||!1}),signal:n==null?void 0:n.signal}).catch(i=>{throw i.message==="Network Error"?new Error("Query timed out"):i})}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,"maplayers")}subscribe(e){return this.client._subscribe("maplayers",e)}};var De=class extends y{constructor(e){super(e,"styles")}};var Ue=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 Me=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 os=Ge(is());var $e=class extends y{constructor(e){super(e,"uploads")}async upload(e,t={}){var i,o,c;let s=new os.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),e.metadata&&s.append("metadata",JSON.stringify(e.metadata)),s.append("file",e.data,e.filename),await this.client._post(this.resourceEndpoint,s,{headers:(o=(i=s.getHeaders)==null?void 0:i.call(s))!=null?o:{"Content-Type":"multipart/form-data"},signal:(c=e.abortController)==null?void 0:c.signal,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 as={type:"error",data:"parser error"};var ii=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",oi=typeof ArrayBuffer=="function",ai=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ci=({type:r,data:e},t,s)=>ii&&e instanceof Blob?t?s(e):cs(e,s):oi&&(e instanceof ArrayBuffer||ai(e))?t?s(e):cs(new Blob([e]),s):s(N[r]+(e||"")),cs=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)},We=ci;var us="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<us.length;r++)ce[us.charCodeAt(r)]=r;var ls=r=>{let e=r.length*.75,t=r.length,s,n=0,i,o,c,l;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)],l=ce[r.charCodeAt(s+3)],a[n++]=i<<2|o>>4,a[n++]=(o&15)<<4|c>>2,a[n++]=(c&3)<<6|l&63;return m};var ui=typeof ArrayBuffer=="function",li=(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]}:as},hi=(r,e)=>{if(ui){let t=ls(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}},je=li;var fs=String.fromCharCode(30),ps=(r,e)=>{let t=r.length,s=new Array(t),n=0;r.forEach((i,o)=>{We(i,!1,c=>{s[o]=c,++n===t&&e(s.join(fs))})})},ds=(r,e)=>{let t=r.split(fs),s=[];for(let n=0;n<t.length;n++){let i=je(t[n],e);if(s.push(i),i.type==="error")break}return s},wt=4;function d(r){if(r)return fi(r)}function fi(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 Ke(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var pi=E.setTimeout,di=E.clearTimeout;function I(r,e){e.useNativeTimers?(r.setTimeoutFn=pi.bind(E),r.clearTimeoutFn=di.bind(E)):(r.setTimeoutFn=E.setTimeout.bind(E),r.clearTimeoutFn=E.clearTimeout.bind(E))}var mi=1.33;function ms(r){return typeof r=="string"?yi(r):Math.ceil((r.byteLength||r.size)*mi)}function yi(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 Et=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 Et(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=je(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 vs="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),xt=64,gi={},ys=0,Ve=0,gs;function bs(r){let e="";do e=vs[r%xt]+e,r=Math.floor(r/xt);while(r>0);return e}function He(){let r=bs(+new Date);return r!==gs?(ys=0,gs=r):r+"."+bs(ys++)}for(;Ve<xt;Ve++)gi[vs[Ve]]=Ve;function Je(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Cs(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 Es=ws;function kt(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Es))return new XMLHttpRequest}catch(t){}if(!e)try{return new E[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function bi(){}var vi=function(){return new kt({xdomain:!1}).responseType!=null}(),ze=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=vi&&!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)};ds(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,ps(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]=He()),!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=Je(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=Ke(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 kt(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=bi,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",xs);else if(typeof addEventListener=="function"){let r="onpagehide"in E?"pagehide":"unload";addEventListener(r,xs,!1)}}function xs(){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))(),le=E.WebSocket||E.MozWebSocket,Qe=!0,ks="arraybuffer";var Ss=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Ye=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=Ss?{}:Ke(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=Qe&&!Ss?t?new le(e,t):new le(e):new le(e,t,s)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType||ks,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;We(s,this.supportsBinary,i=>{let o={};Qe||(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{Qe?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]=He()),this.supportsBinary||(e.b64=1);let n=Je(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!!le}};var St={websocket:Ye,polling:ze};var Ci=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(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=Ci.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=Ei(i,i.path),i.queryKey=xi(i,i.query),i}function Ei(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 xi(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=Cs(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 St[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 h=new Error("probe error");h.transport=t.name,this.emitReserved("upgradeError",h)}}))};function i(){s||(s=!0,a(),t.close(),t=null)}let o=u=>{let h=new Error("probe error: "+u);h.transport=t.name,i(),this.emitReserved("upgradeError",h)};function c(){o("transport closed")}function l(){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",l),this.off("upgrading",m)};t.once("open",n),t.once("error",o),t.once("close",c),this.once("close",l),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+=ms(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 $a=A.protocol;function Rs(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 Tt={};Lt(Tt,{Decoder:()=>pe,Encoder:()=>At,PacketType:()=>p,protocol:()=>Ts});var ki=typeof ArrayBuffer=="function",Si=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,_s=Object.prototype.toString,Ri=typeof Blob=="function"||typeof Blob<"u"&&_s.call(Blob)==="[object BlobConstructor]",_i=typeof File=="function"||typeof File<"u"&&_s.call(File)==="[object FileConstructor]";function fe(r){return ki&&(r instanceof ArrayBuffer||Si(r))||Ri&&r instanceof Blob||_i&&r instanceof File}function he(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(he(r[t]))return!0;return!1}if(fe(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return he(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&he(r[t]))return!0;return!1}function As(r){let e=[],t=r.data,s=r;return s.data=Rt(t,e),s.attachments=e.length,{packet:s,buffers:e}}function Rt(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]=Rt(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]=Rt(r[s],e));return t}return r}function Os(r,e){return r.data=_t(r.data,e),delete r.attachments,r}function _t(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]=_t(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=_t(r[t],e));return r}var Ts=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 At=class{constructor(e){this.replacer=e}encode(e){return(e.type===p.EVENT||e.type===p.ACK)&&he(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=As(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 Ot(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)}},Ot=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=Os(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 Ai=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(Ai.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||Tt;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=Rs(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,l;return c?l=new te(s,e):(de[n]||(de[n]=new te(s,e)),l=de[n]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(me,{Manager:te,Socket:ee,io:me,connect:me});var Ps=(s=>(s.System="system",s.AppConfig="appconfig",s.Dataset="dataset/",s))(Ps||{}),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 Pt=class{constructor(e,t=null,s){this.baseUrl=e;this.apiKey=t;this.debug=(0,Ns.debug)("flow-engine-client");this.accessToken=null;this.auth=new Be(this);this.tiles=new Me(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 De(this);this.tileSources=new Ue(this);this.uploads=new $e(this);this.jobs=new qe(this);this.maplayers=new Ie(this);this.axios=Bs.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 js(Oi);})();
|
|
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]&&gn.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 pr=f((Vi,fr)=>{"use strict";var hr=v();fr.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((Hi,mr)=>{"use strict";var ft=M(),bn=v();function dr(r){ft.call(this,r==null?"canceled":r,ft.ERR_CANCELED),this.name="CanceledError"}bn.inherits(dr,ft,{__CANCEL__:!0});mr.exports=dr});var gr=f((Ji,yr)=>{"use strict";yr.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}});var pt=f((zi,br)=>{"use strict";var oe=v(),vn=tr(),Cn=sr(),wn=ot(),En=lt(),xn=lr(),kn=pr(),Sn=at(),q=M(),Rn=ie(),_n=gr();br.exports=function(e){return new Promise(function(s,n){var i=e.data,o=e.headers,c=e.responseType,l;function m(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}oe.isFormData(i)&&oe.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+h)}var g=En(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?xn(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};vn(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||Sn;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||kn(g))&&e.xsrfCookieName?Cn.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)&&(l=function(b){a&&(n(!b||b&&b.type?new Rn:b),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l))),i||(i=null);var w=_n(g);if(w&&["http","https","file"].indexOf(w)===-1){n(new q("Unsupported protocol "+w+":",q.ERR_BAD_REQUEST,e));return}a.send(i)})}});var Cr=f((Qi,vr)=>{vr.exports=null});var xe=f((Yi,kr)=>{"use strict";var C=v(),wr=Jt(),Er=M(),An=at(),On=ct(),Tn={"Content-Type":"application/x-www-form-urlencoded"};function xr(r,e){!C.isUndefined(r)&&C.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Pn(){var r;return typeof XMLHttpRequest<"u"?r=pt():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=pt()),r}function Bn(r,e,t){if(C.isString(r))try{return(e||JSON.parse)(r),C.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}var Ee={transitional:An,adapter:Pn(),transformRequest:[function(e,t){if(wr(t,"Accept"),wr(t,"Content-Type"),C.isFormData(e)||C.isArrayBuffer(e)||C.isBuffer(e)||C.isStream(e)||C.isFile(e)||C.isBlob(e))return e;if(C.isArrayBufferView(e))return e.buffer;if(C.isURLSearchParams(e))return xr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var s=C.isObject(e),n=t&&t["Content-Type"],i;if((i=C.isFileList(e))||s&&n==="multipart/form-data"){var o=this.env&&this.env.FormData;return On(i?{"files[]":e}:e,o&&new o)}else if(s||n==="application/json")return xr(t,"application/json"),Bn(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&&C.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?Er.from(o,Er.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:Cr()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};C.forEach(["delete","get","head"],function(e){Ee.headers[e]={}});C.forEach(["post","put","patch"],function(e){Ee.headers[e]=C.merge(Tn)});kr.exports=Ee});var Rr=f((Xi,Sr)=>{"use strict";var Nn=v(),Fn=xe();Sr.exports=function(e,t,s){var n=this||Fn;return Nn.forEach(s,function(o){e=o.call(n,e,t)}),e}});var dt=f((Gi,_r)=>{"use strict";_r.exports=function(e){return!!(e&&e.__CANCEL__)}});var Tr=f((Zi,Or)=>{"use strict";var Ar=v(),mt=Rr(),qn=dt(),Ln=xe(),In=ie();function yt(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new In}Or.exports=function(e){yt(e),e.headers=e.headers||{},e.data=mt.call(e,e.data,e.headers,e.transformRequest),e.headers=Ar.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Ar.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||Ln.adapter;return t(e).then(function(n){return yt(e),n.data=mt.call(e,n.data,n.headers,e.transformResponse),n},function(n){return qn(n)||(yt(e),n&&n.response&&(n.response.data=mt.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var gt=f((eo,Pr)=>{"use strict";var R=v();Pr.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 l(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:l};return R.forEach(Object.keys(e).concat(Object.keys(t)),function(u){var h=m[u]||i,g=h(u);R.isUndefined(g)&&h!==l||(s[u]=g)}),s}});var bt=f((to,Br)=>{Br.exports={version:"0.27.2"}});var qr=f((ro,Fr)=>{"use strict";var Dn=bt().version,D=M(),vt={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){vt[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});var Nr={};vt.transitional=function(e,t,s){function n(i,o){return"[Axios v"+Dn+"] 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&&!Nr[o]&&(Nr[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 Un(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],l=c===void 0||o(c,i,r);if(l!==!0)throw new D("option "+i+" must be "+l,D.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}}Fr.exports={assertOptions:Un,validators:vt}});var $r=f((so,Mr)=>{"use strict";var Dr=v(),Mn=ot(),Lr=Vt(),Ir=Tr(),ke=gt(),$n=lt(),Ur=qr(),J=Ur.validators;function z(r){this.defaults=r,this.interceptors={request:new Lr,response:new Lr}}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&&Ur.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 l=[Ir,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),c=Promise.resolve(t);l.length;)c=c.then(l.shift(),l.shift());return c}for(var m=t;n.length;){var a=n.shift(),u=n.shift();try{m=a(m)}catch(h){u(h);break}}try{c=Ir(m)}catch(h){return Promise.reject(h)}for(;o.length;)c=c.then(o.shift(),o.shift());return c};z.prototype.getUri=function(e){e=ke(this.defaults,e);var t=$n(e.baseURL,e.url);return Mn(t,e.params,e.paramsSerializer)};Dr.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}))}});Dr.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)});Mr.exports=z});var jr=f((no,Wr)=>{"use strict";var Wn=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 Wn(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}};Wr.exports=Q});var Vr=f((io,Kr)=>{"use strict";Kr.exports=function(e){return function(s){return e.apply(null,s)}}});var Jr=f((oo,Hr)=>{"use strict";var jn=v();Hr.exports=function(e){return jn.isObject(e)&&e.isAxiosError===!0}});var Yr=f((ao,Ct)=>{"use strict";var zr=v(),Kn=Ze(),Se=$r(),Vn=gt(),Hn=xe();function Qr(r){var e=new Se(r),t=Kn(Se.prototype.request,e);return zr.extend(t,Se.prototype,e),zr.extend(t,e),t.create=function(n){return Qr(Vn(r,n))},t}var k=Qr(Hn);k.Axios=Se;k.CanceledError=ie();k.CancelToken=jr();k.isCancel=dt();k.VERSION=bt().version;k.toFormData=ct();k.AxiosError=M();k.Cancel=k.CanceledError;k.all=function(e){return Promise.all(e)};k.spread=Vr();k.isAxiosError=Jr();Ct.exports=k;Ct.exports.default=k});var Gr=f((co,Xr)=>{Xr.exports=Yr()});var es=f((uo,Zr)=>{var Y=1e3,X=Y*60,G=X*60,$=G*24,Jn=$*7,zn=$*365.25;Zr.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Qn(r);if(t==="number"&&isFinite(r))return e.long?Xn(r):Yn(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Qn(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*zn;case"weeks":case"week":case"w":return t*Jn;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 Yn(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 Xn(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 rs=f((lo,ts)=>{function Gn(r){t.debug=t,t.default=t,t.coerce=l,t.disable=i,t.enable=n,t.enabled=o,t.humanize=es(),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 h=0;h<a.length;h++)u=(u<<5)-u+a.charCodeAt(h),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(a){let u,h=null,g,re;function S(...w){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,w[0]=t.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let K=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(Xe,Fs)=>{if(Xe==="%%")return"%";K++;let Bt=t.formatters[Fs];if(typeof Bt=="function"){let qs=w[K];Xe=Bt.call(b,qs),w.splice(K,1),K--}return Xe}),t.formatArgs.call(b,w),(b.log||t.log).apply(b,w)}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:()=>h!==null?h:(g!==t.namespaces&&(g=t.namespaces,re=t.enabled(a)),re),set:w=>{h=w}}),typeof t.init=="function"&&t.init(S),S}function s(a,u){let h=t(this.namespace+(typeof u>"u"?":":u)+a);return h.log=this.log,h}function n(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let u,h=(typeof a=="string"?a:"").split(/[\s,]+/),g=h.length;for(u=0;u<g;u++)h[u]&&(a=h[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,h;for(u=0,h=t.skips.length;u<h;u++)if(t.skips[u].test(a))return!1;for(u=0,h=t.names.length;u<h;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 l(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}ts.exports=Gn});var ss=f((_,_e)=>{_.formatArgs=ei;_.save=ti;_.load=ri;_.useColors=Zn;_.storage=si();_.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 Zn(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return 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&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ei(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 ti(r){try{r?_.storage.setItem("debug",r):_.storage.removeItem("debug")}catch(e){}}function ri(){let r;try{r=_.storage.getItem("debug")}catch(e){}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function si(){try{return localStorage}catch(r){}}_e.exports=rs()(_);var{formatters:ni}=_e.exports;ni.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var is=f((Do,ns)=>{ns.exports=typeof self=="object"?self.FormData:window.FormData});var Oi={};Lt(Oi,{BaseEndpoints:()=>y,Client:()=>Pt,FlowEngineError:()=>L,WebSocketChannel:()=>Ps,WebSocketGateway:()=>ye});var Bs=Ge(Gr()),Ns=Ge(ss());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(e?`${this.resourceEndpoint}/${e}`:this.resourceEndpoint,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={}){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});let n=null;return s.abortController&&(n=s.abortController,delete s.abortController),this.client._post(`/api/v1/datasets/${e}/query`,t,{params:ne(x({},s),{format:s.format||"json",explain:s.explain||!1}),signal:n==null?void 0:n.signal}).catch(i=>{throw i.message==="Network Error"?new Error("Query timed out"):i})}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,"maplayers")}subscribe(e){return this.client._subscribe("maplayers",e)}};var De=class extends y{constructor(e){super(e,"styles")}};var Ue=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 Me=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 os=Ge(is());var $e=class extends y{constructor(e){super(e,"uploads")}async upload(e,t={}){var i,o,c;let s=new os.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),e.metadata&&s.append("metadata",JSON.stringify(e.metadata)),s.append("file",e.data,e.filename),await this.client._post(this.resourceEndpoint,s,{headers:(o=(i=s.getHeaders)==null?void 0:i.call(s))!=null?o:{"Content-Type":"multipart/form-data"},signal:(c=e.abortController)==null?void 0:c.signal,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 as={type:"error",data:"parser error"};var ii=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",oi=typeof ArrayBuffer=="function",ai=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ci=({type:r,data:e},t,s)=>ii&&e instanceof Blob?t?s(e):cs(e,s):oi&&(e instanceof ArrayBuffer||ai(e))?t?s(e):cs(new Blob([e]),s):s(N[r]+(e||"")),cs=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)},We=ci;var us="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<us.length;r++)ce[us.charCodeAt(r)]=r;var ls=r=>{let e=r.length*.75,t=r.length,s,n=0,i,o,c,l;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)],l=ce[r.charCodeAt(s+3)],a[n++]=i<<2|o>>4,a[n++]=(o&15)<<4|c>>2,a[n++]=(c&3)<<6|l&63;return m};var ui=typeof ArrayBuffer=="function",li=(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]}:as},hi=(r,e)=>{if(ui){let t=ls(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}},je=li;var fs=String.fromCharCode(30),ps=(r,e)=>{let t=r.length,s=new Array(t),n=0;r.forEach((i,o)=>{We(i,!1,c=>{s[o]=c,++n===t&&e(s.join(fs))})})},ds=(r,e)=>{let t=r.split(fs),s=[];for(let n=0;n<t.length;n++){let i=je(t[n],e);if(s.push(i),i.type==="error")break}return s},wt=4;function d(r){if(r)return fi(r)}function fi(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 Ke(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var pi=E.setTimeout,di=E.clearTimeout;function I(r,e){e.useNativeTimers?(r.setTimeoutFn=pi.bind(E),r.clearTimeoutFn=di.bind(E)):(r.setTimeoutFn=E.setTimeout.bind(E),r.clearTimeoutFn=E.clearTimeout.bind(E))}var mi=1.33;function ms(r){return typeof r=="string"?yi(r):Math.ceil((r.byteLength||r.size)*mi)}function yi(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 Et=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 Et(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=je(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 vs="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),xt=64,gi={},ys=0,Ve=0,gs;function bs(r){let e="";do e=vs[r%xt]+e,r=Math.floor(r/xt);while(r>0);return e}function He(){let r=bs(+new Date);return r!==gs?(ys=0,gs=r):r+"."+bs(ys++)}for(;Ve<xt;Ve++)gi[vs[Ve]]=Ve;function Je(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Cs(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 Es=ws;function kt(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Es))return new XMLHttpRequest}catch(t){}if(!e)try{return new E[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function bi(){}var vi=function(){return new kt({xdomain:!1}).responseType!=null}(),ze=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=vi&&!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)};ds(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,ps(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]=He()),!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=Je(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=Ke(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 kt(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=bi,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",xs);else if(typeof addEventListener=="function"){let r="onpagehide"in E?"pagehide":"unload";addEventListener(r,xs,!1)}}function xs(){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))(),le=E.WebSocket||E.MozWebSocket,Qe=!0,ks="arraybuffer";var Ss=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Ye=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=Ss?{}:Ke(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=Qe&&!Ss?t?new le(e,t):new le(e):new le(e,t,s)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType||ks,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;We(s,this.supportsBinary,i=>{let o={};Qe||(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{Qe?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]=He()),this.supportsBinary||(e.b64=1);let n=Je(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!!le}};var St={websocket:Ye,polling:ze};var Ci=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(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=Ci.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=Ei(i,i.path),i.queryKey=xi(i,i.query),i}function Ei(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 xi(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=Cs(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 St[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 h=new Error("probe error");h.transport=t.name,this.emitReserved("upgradeError",h)}}))};function i(){s||(s=!0,a(),t.close(),t=null)}let o=u=>{let h=new Error("probe error: "+u);h.transport=t.name,i(),this.emitReserved("upgradeError",h)};function c(){o("transport closed")}function l(){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",l),this.off("upgrading",m)};t.once("open",n),t.once("error",o),t.once("close",c),this.once("close",l),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+=ms(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 $a=A.protocol;function Rs(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 Tt={};Lt(Tt,{Decoder:()=>pe,Encoder:()=>At,PacketType:()=>p,protocol:()=>Ts});var ki=typeof ArrayBuffer=="function",Si=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,_s=Object.prototype.toString,Ri=typeof Blob=="function"||typeof Blob<"u"&&_s.call(Blob)==="[object BlobConstructor]",_i=typeof File=="function"||typeof File<"u"&&_s.call(File)==="[object FileConstructor]";function fe(r){return ki&&(r instanceof ArrayBuffer||Si(r))||Ri&&r instanceof Blob||_i&&r instanceof File}function he(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(he(r[t]))return!0;return!1}if(fe(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return he(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&he(r[t]))return!0;return!1}function As(r){let e=[],t=r.data,s=r;return s.data=Rt(t,e),s.attachments=e.length,{packet:s,buffers:e}}function Rt(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]=Rt(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]=Rt(r[s],e));return t}return r}function Os(r,e){return r.data=_t(r.data,e),delete r.attachments,r}function _t(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]=_t(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=_t(r[t],e));return r}var Ts=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 At=class{constructor(e){this.replacer=e}encode(e){return(e.type===p.EVENT||e.type===p.ACK)&&he(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=As(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 Ot(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)}},Ot=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=Os(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 Ai=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(Ai.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||Tt;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=Rs(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,l;return c?l=new te(s,e):(de[n]||(de[n]=new te(s,e)),l=de[n]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(me,{Manager:te,Socket:ee,io:me,connect:me});var Ps=(s=>(s.System="system",s.AppConfig="appconfig",s.Dataset="dataset/",s))(Ps||{}),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 Pt=class{constructor(e,t=null,s){this.baseUrl=e;this.apiKey=t;this.debug=(0,Ns.default)("flow-engine-client");this.accessToken=null;this.auth=new Be(this);this.tiles=new Me(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 De(this);this.tileSources=new Ue(this);this.uploads=new $e(this);this.jobs=new qe(this);this.maplayers=new Ie(this);this.axios=Bs.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 js(Oi);})();
|
|
3
3
|
//# sourceMappingURL=bundle.js.map
|