@emuanalytics/flow-engine-client 1.3.71 → 1.3.72

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