@ezpaarse-project/ezreeport-sdk-js 1.0.0-beta.6 → 1.0.0-beta.7

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.
Files changed (32) hide show
  1. package/dist/browser/ezreeport-sdk-js.mjs +489 -464
  2. package/dist/browser/ezreeport-sdk-js.mjs.map +1 -1
  3. package/dist/browser/ezreeport-sdk-js.umd.js +3 -3
  4. package/dist/browser/ezreeport-sdk-js.umd.js.map +1 -1
  5. package/dist/node/package.json +10 -6
  6. package/dist/node/src/index.js +3 -2
  7. package/dist/node/src/index.js.map +1 -1
  8. package/dist/node/src/lib/axios.js +5 -1
  9. package/dist/node/src/lib/axios.js.map +1 -1
  10. package/dist/node/src/lib/utils.js.map +1 -1
  11. package/dist/node/src/modules/crons.js +23 -4
  12. package/dist/node/src/modules/crons.js.map +1 -1
  13. package/dist/node/src/modules/crons.public.js +2 -1
  14. package/dist/node/src/modules/crons.public.js.map +1 -1
  15. package/dist/node/src/modules/queues.js +33 -1
  16. package/dist/node/src/modules/queues.js.map +1 -1
  17. package/dist/node/src/modules/queues.public.js +3 -1
  18. package/dist/node/src/modules/queues.public.js.map +1 -1
  19. package/dist/node/src/modules/reports.js +2 -2
  20. package/dist/node/src/modules/tasks.js.map +1 -1
  21. package/dist/node/src/modules/templates.js.map +1 -1
  22. package/dist/types/src/index.d.ts +2 -1
  23. package/dist/types/src/lib/axios.d.ts +1 -1
  24. package/dist/types/src/lib/utils.d.ts +0 -5
  25. package/dist/types/src/modules/crons.d.ts +24 -0
  26. package/dist/types/src/modules/crons.public.d.ts +1 -1
  27. package/dist/types/src/modules/queues.d.ts +29 -0
  28. package/dist/types/src/modules/queues.public.d.ts +1 -1
  29. package/dist/types/src/modules/reports.d.ts +2 -2
  30. package/dist/types/src/modules/tasks.d.ts +5 -2
  31. package/dist/types/src/modules/templates.d.ts +27 -6
  32. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- (function(T,U){typeof exports=="object"&&typeof module<"u"?U(exports):typeof define=="function"&&define.amd?define(["exports"],U):(T=typeof globalThis<"u"?globalThis:T||self,U(T.ezReeportSDK={}))})(this,function(T){"use strict";function U(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Lt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}var Se=6e4,_e=36e5;function b(e,t){var n;Lt(1,arguments);var r=U((n=t==null?void 0:t.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var s=Pt(e),o;if(s.date){var i=Dt(s.date,r);o=$t(i.restDateString,i.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var c=o.getTime(),f=0,u;if(s.time&&(f=kt(s.time),isNaN(f)))return new Date(NaN);if(s.timezone){if(u=Ft(s.timezone),isNaN(u))return new Date(NaN)}else{var l=new Date(c+f),p=new Date(0);return p.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),p.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),p}return new Date(c+f+u)}var q={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Nt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ct=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,xt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Pt(e){var t={},n=e.split(q.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],q.timeZoneDelimiter.test(t.date)&&(t.date=e.split(q.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var s=q.timezone.exec(r);s?(t.time=r.replace(s[1],""),t.timezone=s[1]):t.time=r}return t}function Dt(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var s=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((r[1]||r[2]).length)}}function $t(e,t){if(t===null)return new Date(NaN);var n=e.match(Nt);if(!n)return new Date(NaN);var r=!!n[4],s=j(n[1]),o=j(n[2])-1,i=j(n[3]),c=j(n[4]),f=j(n[5])-1;if(r)return zt(t,c,f)?Ut(t,c,f):new Date(NaN);var u=new Date(0);return!Bt(t,o,i)||!Mt(t,s)?new Date(NaN):(u.setUTCFullYear(t,o,Math.max(s,i)),u)}function j(e){return e?parseInt(e):1}function kt(e){var t=e.match(Ct);if(!t)return NaN;var n=ie(t[1]),r=ie(t[2]),s=ie(t[3]);return Ht(n,r,s)?n*_e+r*Se+s*1e3:NaN}function ie(e){return e&&parseFloat(e.replace(",","."))||0}function Ft(e){if(e==="Z")return 0;var t=e.match(xt);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return It(r,s)?n*(r*_e+s*Se):NaN}function Ut(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var s=r.getUTCDay()||7,o=(t-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+o),r}var jt=[31,null,31,30,31,30,31,31,30,31,30,31];function Oe(e){return e%400===0||e%4===0&&e%100!==0}function Bt(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(jt[t]||(Oe(e)?29:28))}function Mt(e,t){return t>=1&&t<=(Oe(e)?366:365)}function zt(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Ht(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function It(e,t){return t>=0&&t<=59}function Le(e,t){return function(){return e.apply(t,arguments)}}const{toString:Jt}=Object.prototype,{getPrototypeOf:ae}=Object,W=(e=>t=>{const n=Jt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),S=e=>(e=e.toLowerCase(),t=>W(t)===e),K=e=>t=>typeof t===e,{isArray:x}=Array,B=K("undefined");function qt(e){return e!==null&&!B(e)&&e.constructor!==null&&!B(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ne=S("ArrayBuffer");function Wt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ne(e.buffer),t}const Kt=K("string"),A=K("function"),Ce=K("number"),V=e=>e!==null&&typeof e=="object",Vt=e=>e===!0||e===!1,Y=e=>{if(W(e)!=="object")return!1;const t=ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Yt=S("Date"),Gt=S("File"),Qt=S("Blob"),Xt=S("FileList"),Zt=e=>V(e)&&A(e.pipe),en=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=W(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},tn=S("URLSearchParams"),nn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function M(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),x(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function xe(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Pe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),De=e=>!B(e)&&e!==Pe;function ce(){const{caseless:e}=De(this)&&this||{},t={},n=(r,s)=>{const o=e&&xe(t,s)||s;Y(t[o])&&Y(r)?t[o]=ce(t[o],r):Y(r)?t[o]=ce({},r):x(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&M(arguments[r],n);return t}const rn=(e,t,n,{allOwnKeys:r}={})=>(M(t,(s,o)=>{n&&A(s)?e[o]=Le(s,n):e[o]=s},{allOwnKeys:r}),e),sn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),on=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},an=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ae(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},cn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},un=e=>{if(!e)return null;if(x(e))return e;let t=e.length;if(!Ce(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ln=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ae(Uint8Array)),fn=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},pn=S("HTMLFormElement"),hn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$e=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),mn=S("RegExp"),ke=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};M(n,(s,o)=>{t(s,o,e)!==!1&&(r[o]=s)}),Object.defineProperties(e,r)},yn=e=>{ke(e,(t,n)=>{if(A(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(A(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},gn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return x(e)?r(e):r(String(e).split(t)),n},wn=()=>{},bn=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ue="abcdefghijklmnopqrstuvwxyz",Fe="0123456789",Ue={DIGIT:Fe,ALPHA:ue,ALPHA_DIGIT:ue+ue.toUpperCase()+Fe},En=(e=16,t=Ue.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function vn(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Tn=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=x(r)?[]:{};return M(r,(i,c)=>{const f=n(i,s+1);!B(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},An=S("AsyncFunction"),a={isArray:x,isArrayBuffer:Ne,isBuffer:qt,isFormData:en,isArrayBufferView:Wt,isString:Kt,isNumber:Ce,isBoolean:Vt,isObject:V,isPlainObject:Y,isUndefined:B,isDate:Yt,isFile:Gt,isBlob:Qt,isRegExp:mn,isFunction:A,isStream:Zt,isURLSearchParams:tn,isTypedArray:ln,isFileList:Xt,forEach:M,merge:ce,extend:rn,trim:nn,stripBOM:sn,inherits:on,toFlatObject:an,kindOf:W,kindOfTest:S,endsWith:cn,toArray:un,forEachEntry:fn,matchAll:dn,isHTMLForm:pn,hasOwnProperty:$e,hasOwnProp:$e,reduceDescriptors:ke,freezeMethods:yn,toObjectSet:gn,toCamelCase:hn,noop:wn,toFiniteNumber:bn,findKey:xe,global:Pe,isContextDefined:De,ALPHABET:Ue,generateString:En,isSpecCompliantForm:vn,toJSONObject:Tn,isAsyncFn:An,isThenable:e=>e&&(V(e)||A(e))&&A(e.then)&&A(e.catch)};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(y,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:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const je=y.prototype,Be={};["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Be[e]={value:e}}),Object.defineProperties(y,Be),Object.defineProperty(je,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,o)=>{const i=Object.create(je);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Rn=null;function le(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ze(e,t,n){return e?e.concat(t).map(function(s,o){return s=Me(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Sn(e){return a.isArray(e)&&!e.some(le)}const _n=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function G(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,N){return!a.isUndefined(N[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,m,N){let R=d;if(d&&!N&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&Sn(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(R=a.toArray(d)))return m=Me(m),R.forEach(function(oe,Wr){!(a.isUndefined(oe)||oe===null)&&t.append(i===!0?ze([m],Wr,o):i===null?m:m+"[]",u(oe))}),!1}return le(d)?!0:(t.append(ze(N,m,o),u(d)),!1)}const p=[],v=Object.assign(_n,{defaultVisitor:l,convertValue:u,isVisitable:le});function w(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(R,F){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(F)?F.trim():F,m,v))===!0&&w(R,m?m.concat(F):[F])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function fe(e,t){this._pairs=[],e&&G(e,this,t)}const Ie=fe.prototype;Ie.append=function(t,n){this._pairs.push([t,n])},Ie.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function On(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Je(e,t,n){if(!t)return e;const r=n&&n.encode||On,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new fe(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ln{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const qe=Ln,We={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nn=typeof URLSearchParams<"u"?URLSearchParams:fe,Cn=typeof FormData<"u"?FormData:null,xn=typeof Blob<"u"?Blob:null,Pn=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Dn=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),_={isBrowser:!0,classes:{URLSearchParams:Nn,FormData:Cn,Blob:xn},isStandardBrowserEnv:Pn,isStandardBrowserWebWorkerEnv:Dn,protocols:["http","https","file","blob","url","data"]};function $n(e,t){return G(e,new _.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return _.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function kn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Fn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Ke(e){function t(n,r,s,o){let i=n[o++];const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Fn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(kn(r),s,n,0)}),n}return null}const Un={"Content-Type":void 0};function jn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Q={transitional:We,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(Ke(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $n(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return G(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),jn(t)):t}],transformResponse:[function(t){const n=this.transitional||Q.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_.classes.FormData,Blob:_.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){Q.headers[t]={}}),a.forEach(["post","put","patch"],function(t){Q.headers[t]=a.merge(Un)});const de=Q,Bn=a.toObjectSet(["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"]),Mn=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Bn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function z(e){return e&&String(e).trim().toLowerCase()}function X(e){return e===!1||e==null?e:a.isArray(e)?e.map(X):String(e)}function zn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Hn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function In(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Jn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let Z=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=z(f);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||f]=X(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!Hn(t)?i(Mn(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=z(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return zn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=z(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=z(i),i){const c=a.findKey(r,i);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||pe(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=X(s),delete n[o];return}const c=t?In(o):String(o).trim();c!==o&&delete n[o],n[c]=X(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=z(i);r[c]||(Jn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.freezeMethods(Z.prototype),a.freezeMethods(Z);const O=Z;function he(e,t){const n=this||de,r=t||n,s=O.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ye(e){return!!(e&&e.__CANCEL__)}function H(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(H,y,{__CANCEL__:!0});function qn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Wn=_.isStandardBrowserEnv?function(){return{write:function(n,r,s,o,i,c){const f=[];f.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&f.push("expires="+new Date(s).toGMTString()),a.isString(o)&&f.push("path="+o),a.isString(i)&&f.push("domain="+i),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Kn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ge(e,t){return e&&!Kn(t)?Vn(e,t):t}const Yn=_.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function Gn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Qn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let p=o,v=0;for(;p!==s;)v+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const w=l&&u-l;return w?Math.round(v*1e3/w):void 0}}function Qe(e,t){let n=0;const r=Qn(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,c=o-n,f=r(c),u=o<=i;n=o;const l={loaded:o,total:i,progress:i?o/i:void 0,bytes:c,rate:f||void 0,estimated:f&&i&&u?(i-o)/f:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const ee={http:Rn,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const o=O.from(e.headers).normalize(),i=e.responseType;let c;function f(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}a.isFormData(s)&&(_.isStandardBrowserEnv||_.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const w=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(w+":"+d))}const l=Ge(e.baseURL,e.url);u.open(e.method.toUpperCase(),Je(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function p(){if(!u)return;const w=O.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:w,config:e,request:u};qn(function(R){n(R),f()},function(R){r(R),f()},m),u=null}if("onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(p)},u.onabort=function(){u&&(r(new y("Request aborted",y.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let d=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||We;e.timeoutErrorMessage&&(d=e.timeoutErrorMessage),r(new y(d,m.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,u)),u=null},_.isStandardBrowserEnv){const w=(e.withCredentials||Yn(l))&&e.xsrfCookieName&&Wn.read(e.xsrfCookieName);w&&o.set(e.xsrfHeaderName,w)}s===void 0&&o.setContentType(null),"setRequestHeader"in u&&a.forEach(o.toJSON(),function(d,m){u.setRequestHeader(m,d)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&i!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Qe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Qe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=w=>{u&&(r(!w||w.type?new H(null,e,u):w),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const v=Gn(l);if(v&&_.protocols.indexOf(v)===-1){r(new y("Unsupported protocol "+v+":",y.ERR_BAD_REQUEST,e));return}u.send(s||null)})}};a.forEach(ee,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xn={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=a.isString(n)?ee[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new y(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(ee,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:ee};function me(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function Xe(e){return me(e),e.headers=O.from(e.headers),e.data=he.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xn.getAdapter(e.adapter||de.adapter)(e).then(function(r){return me(e),r.data=he.call(e,e.transformResponse,r),r.headers=O.from(r.headers),r},function(r){return Ye(r)||(me(e),r&&r.response&&(r.response.data=he.call(e,e.transformResponse,r.response),r.response.headers=O.from(r.response.headers))),Promise.reject(r)})}const Ze=e=>e instanceof O?e.toJSON():e;function P(e,t){t=t||{};const n={};function r(u,l,p){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:p},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p)}else return r(u,l,p)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l)=>s(Ze(u),Ze(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const p=f[l]||s,v=p(e[l],t[l],l);a.isUndefined(v)&&p!==c||(n[l]=v)}),n}const et="1.4.0",ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const tt={};ye.transitional=function(t,n,r){function s(o,i){return"[Axios v"+et+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!tt[i]&&(tt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Zn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ge={assertOptions:Zn,validators:ye},C=ge.validators;let te=class{constructor(t){this.defaults=t,this.interceptors={request:new qe,response:new qe}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=P(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ge.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:C.function,serialize:C.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i;i=o&&a.merge(o.common,o[n.method]),i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=O.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,v;if(!f){const d=[Xe.bind(this),void 0];for(d.unshift.apply(d,c),d.push.apply(d,u),v=d.length,l=Promise.resolve(n);p<v;)l=l.then(d[p++],d[p++]);return l}v=c.length;let w=n;for(p=0;p<v;){const d=c[p++],m=c[p++];try{w=d(w)}catch(N){m.call(this,N);break}}try{l=Xe.call(this,w)}catch(d){return Promise.reject(d)}for(p=0,v=u.length;p<v;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=P(this.defaults,t);const n=Ge(t.baseURL,t.url);return Je(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(n,r){return this.request(P(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(P(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}te.prototype[t]=n(),te.prototype[t+"Form"]=n(!0)});const ne=te,er=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new H(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function tr(e){return function(n){return e.apply(null,n)}}function nr(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(we).forEach(([e,t])=>{we[t]=e});const rr=we;function nt(e){const t=new ne(e),n=Le(ne.prototype.request,t);return a.extend(n,ne.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return nt(P(e,s))},n}const E=nt(de);E.Axios=ne,E.CanceledError=H,E.CancelToken=er,E.isCancel=Ye,E.VERSION=et,E.toFormData=G,E.AxiosError=y,E.Cancel=E.CanceledError,E.all=function(t){return Promise.all(t)},E.spread=tr,E.isAxiosError=nr,E.mergeConfig=P,E.AxiosHeaders=O,E.formToJSON=e=>Ke(a.isHTMLForm(e)?new FormData(e):e),E.HttpStatusCode=rr,E.default=E;const rt=E,{Axios:Qr,AxiosError:sr,CanceledError:Xr,isCancel:Zr,CancelToken:es,VERSION:ts,all:ns,Cancel:rs,isAxiosError:ss,spread:os,toFormData:is,AxiosHeaders:as,HttpStatusCode:cs,formToJSON:us,mergeConfig:ls}=rt,st=rt.create({}),L=async(e,...t)=>{try{return await st[e](...t)}catch(n){if(!(n instanceof sr)||!n.response)throw n;const r=n.response;let s="";switch(r.status){case 400:s="Check parameters or API token";break;case 401:s="You must be logged before using this function, use `auth.login(token)`";break;case 403:s="You dont have enough permissions";break;case 404:s="Check parameters";break;case 409:s="Request conflit with current state";break;case 500:s="Something went wrong with server";break}throw s=`${n.code} (${r.status}) - ${s}: ${r.data.content.message}`,new Error(s)}},h=Object.assign(st,{$get:async(...e)=>(await L("get",...e)).data,$post:async(...e)=>(await L("post",...e)).data,$put:async(...e)=>(await L("put",...e)).data,$patch:async(...e)=>(await L("patch",...e)).data,$delete:async(...e)=>(await L("delete",...e)).data}),ot=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),or=e=>({...e,namespace:ot(e.namespace),createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),ir=e=>({...e,memberships:e.memberships.map(or),createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),it=e=>{h.defaults.headers.common.authorization=`Bearer ${e}`},at=()=>{h.defaults.headers.common.authorization=void 0},ct=()=>{const e=h.defaults.headers.common.authorization;if(!e||typeof e!="string")return!1;const[,t]=e.split("Bearer ");return!!t},ar=Object.freeze(Object.defineProperty({__proto__:null,getCurrentNamespaces:()=>h.$get("/me/namespaces"),getCurrentPermissions:()=>h.$get("/me/permissions"),getCurrentUser:async()=>{const{content:e,...t}=await h.$get("/me");return{...t,content:ir(e)}},isLogged:ct,login:it,logout:at},Symbol.toStringTag,{value:"Module"})),I=e=>({...e,nextRun:e.nextRun?b(e.nextRun):void 0,lastRun:e.lastRun?b(e.lastRun):void 0}),cr=Object.freeze(Object.defineProperty({__proto__:null,forceCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$post(`/crons/${t}/force`);return{...r,content:I(n)}},getAllCrons:async()=>{const{content:e,...t}=await h.$get("/crons");return{...t,content:e.map(I)}},getCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$get(`/crons/${t}`);return{...r,content:I(n)}},startCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$put(`/crons/${t}/start`);return{...r,content:I(n)}},stopCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$put(`/crons/${t}/stop`);return{...r,content:I(n)}}},Symbol.toStringTag,{value:"Module"})),ut=()=>h.$get("/health"),ur=()=>h.$get("/health/all"),lt=e=>h.$get(`/health/${e}`),lr=Object.freeze(Object.defineProperty({__proto__:null,checkAllConnectedService:ur,checkConnectedService:lt,checkCurrentService:async()=>{const{content:{current:e}}=await ut();return lt(e)},getAllConnectedServices:ut},Symbol.toStringTag,{value:"Module"}));var ft=(e=>(e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.BIENNIAL="BIENNIAL",e.YEARLY="YEARLY",e))(ft||{});const be=e=>({...e,nextRun:b(e.nextRun),lastRun:e.lastRun?b(e.lastRun):void 0,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),dt=e=>{const{namespace:t,...n}=e,{namespaceId:r,...s}=be({namespaceId:t.id,...n});return{...s,namespace:ot(t)}},fr=e=>({...e,createdAt:b(e.createdAt)}),dr=e=>({...e,task:dt(e.task),createdAt:b(e.createdAt)}),pt=Object.freeze(Object.defineProperty({__proto__:null,getAllEntries:async(e,t)=>{const{data:{content:n,...r}}=await L("get","/tasks-activity",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(dr)}}},Symbol.toStringTag,{value:"Module"})),pr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ee=e=>({...e,added:b(e.added),started:e.started?b(e.started):void 0,ended:e.ended?b(e.ended):void 0}),hr=()=>h.$get("/queues"),mr=async e=>{const t=typeof e=="string"?e:e.name;return h.$put(`/queues/${t}/pause`)},yr=async e=>{const t=typeof e=="string"?e:e.name;return h.$put(`/queues/${t}/resume`)},gr=async(e,t)=>{const n=typeof e=="string"?e:e.name,{data:{content:r,...s}}=await L("get",`/queues/${n}/jobs`,{params:t});return{...s,content:r.map(Ee)}},J=async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await h.$get(`/queues/${r}/jobs/${s}`,{params:{namespaces:n}});return{...i,content:Ee(o)}},wr=Object.freeze(Object.defineProperty({__proto__:null,getAllQueues:hr,getJob:J,getQueueJobs:gr,pauseQueue:mr,resumeQueue:yr,retryJob:async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await h.$post(`/queues/${r}/jobs/${s}/retry`,{params:{namespaces:n}});return{...i,content:Ee(o)}}},Symbol.toStringTag,{value:"Module"}));function br(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve={exports:{}},D=typeof Reflect=="object"?Reflect:null,ht=D&&typeof D.apply=="function"?D.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},re;D&&typeof D.ownKeys=="function"?re=D.ownKeys:Object.getOwnPropertySymbols?re=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:re=function(t){return Object.getOwnPropertyNames(t)};function Er(e){console&&console.warn&&console.warn(e)}var mt=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}ve.exports=g,ve.exports.once=Rr,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var yt=10;function se(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return yt},set:function(e){if(typeof e!="number"||e<0||mt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");yt=e}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||mt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function gt(e){return e._maxListeners===void 0?g.defaultMaxListeners:e._maxListeners}g.prototype.getMaxListeners=function(){return gt(this)},g.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var s=t==="error",o=this._events;if(o!==void 0)s=s&&o.error===void 0;else if(!s)return!1;if(s){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=o[t];if(f===void 0)return!1;if(typeof f=="function")ht(f,this,n);else for(var u=f.length,l=Tt(f,u),r=0;r<u;++r)ht(l[r],this,n);return!0};function wt(e,t,n,r){var s,o,i;if(se(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),i===void 0)i=o[t]=n,++e._eventsCount;else if(typeof i=="function"?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=gt(e),s>0&&i.length>s&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,Er(c)}return e}g.prototype.addListener=function(t,n){return wt(this,t,n,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(t,n){return wt(this,t,n,!0)};function vr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function bt(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=vr.bind(r);return s.listener=n,r.wrapFn=s,s}g.prototype.once=function(t,n){return se(n),this.on(t,bt(this,t,n)),this},g.prototype.prependOnceListener=function(t,n){return se(n),this.prependListener(t,bt(this,t,n)),this},g.prototype.removeListener=function(t,n){var r,s,o,i,c;if(se(n),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===n||r[i].listener===n){c=r[i].listener,o=i;break}if(o<0)return this;o===0?r.shift():Tr(r,o),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,c||n)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(t){var n,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),i;for(s=0;s<o.length;++s)i=o[s],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this};function Et(e,t,n){var r=e._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?Ar(s):Tt(s,s.length)}g.prototype.listeners=function(t){return Et(this,t,!0)},g.prototype.rawListeners=function(t){return Et(this,t,!1)},g.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):vt.call(e,t)},g.prototype.listenerCount=vt;function vt(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?re(this._events):[]};function Tt(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Tr(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Ar(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Rr(e,t){return new Promise(function(n,r){function s(i){e.removeListener(t,o),r(i)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}At(e,t,o,{once:!0}),t!=="error"&&Sr(e,s,{once:!0})})}function Sr(e,t,n){typeof e.on=="function"&&At(e,"error",t,n)}function At(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){r.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var _r=ve.exports;const Or=br(_r),Lr=(e,t=new Or)=>{const n={emit:(o,...i)=>(t.emit(o.toString(),...i),n)},r=e(n),s=Object.assign(r,{on:(o,i)=>(t.on(o.toString(),(...c)=>i(...c)),s),once:(o,i)=>(t.once(o.toString(),(...c)=>i(...c)),s),off:(o,i)=>(t.off(o.toString(),(...c)=>i(...c)),s)});return s},Nr=e=>new Promise(t=>{setTimeout(t,e)}),Cr=e=>({start:b(e.start),end:b(e.end)}),xr=e=>({...e,createdAt:b(e.createdAt),destroyAt:b(e.destroyAt),period:e.period?Cr(e.period):void 0}),Te=e=>({...e,detail:xr(e.detail)}),Rt=(e,t,n)=>{var s,o;const r=typeof e=="string"?e:e.id;return h.$post(`/tasks/${r}/run`,null,{params:{test_emails:t==null?void 0:t.testEmails,period_start:(s=t==null?void 0:t.period)==null?void 0:s.start,period_end:(o=t==null?void 0:t.period)==null?void 0:o.end,namespaces:n}})},Pr=(...e)=>Lr(async t=>{const{content:{id:n,queue:r}}=await Rt(...e);t.emit("started",{id:n,queue:r});let s;do{const{content:{progress:o,status:i,result:c}}=await J(r,n,e[2]);s={progress:o,status:i,result:c},t.emit("progress",{progress:o,status:i});let f=1e3;s.status==="active"&&(f=250),await Nr(f)}while(["completed","failed","stuck"].includes(s.status)===!1);if(!s.result)throw new Error("Generation failed with weird error");return Te(s.result)}),$=async(e,t,n)=>(await L("get",`/reports/${e}`,{responseType:n,params:{namespaces:t}})).data,Dr=Object.freeze(Object.defineProperty({__proto__:null,getReportDebugByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await J(e,t,n);if(!s)throw new Error("Job have no result");return $(((o=s.detail)==null?void 0:o.files.debug)??"",n,r)},getReportDebugByName:(e,t,n)=>$(`${e}.deb.json`,t,n),getReportDetailByJob:async(e,t,n,r)=>{var i;const{content:{result:s}}=await J(e,t,n);if(!s)throw new Error("Job have no result");const o=await $(((i=s.detail)==null?void 0:i.files.detail)??"",n,r);return!r||r==="json"?Te(o):o},getReportDetailByName:async(e,t,n)=>{const r=await $(`${e}.det.json`,t,n);return!n||n==="json"?Te(r):r},getReportFileByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await J(e,t,n);if(!s)throw new Error("Job have no result");return $(((o=s.detail)==null?void 0:o.files.report)??"",n,r)},getReportFileByName:(e,t,n,r="pdf")=>$(`${e}.rep.${r}`,t,n),startAndListenGeneration:Pr,startGeneration:Rt},Symbol.toStringTag,{value:"Module"})),$r=Object.freeze(Object.defineProperty({__proto__:null,isLogged:ct,isURLset:()=>!!h.defaults.baseURL,login:it,logout:at,setURL:e=>{h.defaults.baseURL=e},unsetURL:()=>{h.defaults.baseURL=void 0}},Symbol.toStringTag,{value:"Module"})),Ae=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),Re=e=>{const{body:t,tasks:n,...r}=e;return{...Ae(r),tasks:n.map(be),body:t}},kr=async()=>{const{content:e,...t}=await h.$get("/templates");return{...t,content:e.map(Ae)}},Fr=async e=>{const t=typeof e=="string"?e:e.id,{content:n,...r}=await h.$get(`/templates/${t}`);return{...r,content:Re(n)}},Ur=async e=>{const{content:t,...n}=await h.$post("/templates",e);return{...n,content:Re(t)}},St=async e=>{const{id:t,...n}=e,{content:r,...s}=await h.$put(`/templates/${t}`,n);return{...s,content:Re(r)}},jr=St,Br=async e=>{const t=typeof e=="string"?e:e.id;await h.$delete(`/templates/${t}`)},k=e=>{const{activity:t,template:n,targets:r,extends:s,...o}=e;return{...dt(o),extends:Ae(s),activity:t.map(fr),template:n,targets:r}},Mr=async(e,t)=>{const{data:{content:n,...r}}=await L("get","/tasks",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(({tags:s,...o})=>({tags:s,...be(o)}))}},zr=async(e,t)=>{const{content:n,...r}=await h.$post("/tasks",e,{params:{namespaces:t}});return{...r,content:k(n)}},Hr=async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await h.$get(`/tasks/${n}`,{params:{namespaces:t}});return{...s,content:k(r)}},_t=async(e,t)=>{const{id:n,...r}=e,{content:s,...o}=await h.$put(`/tasks/${n}`,r,{params:{namespaces:t}});return{...o,content:k(s)}},Ir=Object.freeze(Object.defineProperty({__proto__:null,Recurrence:ft,createTask:zr,deleteTask:async(e,t)=>{const n=typeof e=="string"?e:e.id;await h.$delete(`/tasks/${n}`,{params:{namespaces:t}})},disableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await h.$put(`/tasks/${n}/disable`,void 0,{params:{namespaces:t}});return{...s,content:k(r)}},enableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await h.$put(`/tasks/${n}/enable`,void 0,{params:{namespaces:t}});return{...s,content:k(r)}},getAllTasks:Mr,getTask:Hr,linkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id,{content:o,...i}=await h.$put(`/tasks/${r}/link/${s}`,void 0,{params:{namespaces:n}});return{...i,content:k(o)}},unlinkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id;await h.$delete(`/tasks/${r}/link/${s}`,{params:{namespaces:n}})},updateTask:_t,upsertTask:_t},Symbol.toStringTag,{value:"Module"})),Jr=Object.freeze(Object.defineProperty({__proto__:null,createTemplate:Ur,deleteTemplate:Br,getAllTemplates:kr,getTemplate:Fr,updateTemplate:jr,upsertTemplate:St},Symbol.toStringTag,{value:"Module"})),qr="1.0.0-beta.5";T.auth=ar,T.crons=cr,T.health=lr,T.history=pt,T.namespaces=pr,T.queues=wr,T.reports=Dr,T.setup=$r,T.tasks=Ir,T.tasksActivity=pt,T.templates=Jr,T.version=qr,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
1
+ (function(A,j){typeof exports=="object"&&typeof module<"u"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(A=typeof globalThis<"u"?globalThis:A||self,j(A.ezReeportSDK={}))})(this,function(A){"use strict";function j(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Lt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}var Se=6e4,_e=36e5;function b(e,t){var n;Lt(1,arguments);var r=j((n=t==null?void 0:t.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var s=$t(e),o;if(s.date){var i=Dt(s.date,r);o=kt(i.restDateString,i.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var c=o.getTime(),f=0,u;if(s.time&&(f=Ft(s.time),isNaN(f)))return new Date(NaN);if(s.timezone){if(u=Ut(s.timezone),isNaN(u))return new Date(NaN)}else{var l=new Date(c+f),p=new Date(0);return p.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),p.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),p}return new Date(c+f+u)}var q={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Nt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,xt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Pt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $t(e){var t={},n=e.split(q.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],q.timeZoneDelimiter.test(t.date)&&(t.date=e.split(q.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var s=q.timezone.exec(r);s?(t.time=r.replace(s[1],""),t.timezone=s[1]):t.time=r}return t}function Dt(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var s=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((r[1]||r[2]).length)}}function kt(e,t){if(t===null)return new Date(NaN);var n=e.match(Nt);if(!n)return new Date(NaN);var r=!!n[4],s=B(n[1]),o=B(n[2])-1,i=B(n[3]),c=B(n[4]),f=B(n[5])-1;if(r)return zt(t,c,f)?jt(t,c,f):new Date(NaN);var u=new Date(0);return!Mt(t,o,i)||!Ht(t,s)?new Date(NaN):(u.setUTCFullYear(t,o,Math.max(s,i)),u)}function B(e){return e?parseInt(e):1}function Ft(e){var t=e.match(xt);if(!t)return NaN;var n=oe(t[1]),r=oe(t[2]),s=oe(t[3]);return It(n,r,s)?n*_e+r*Se+s*1e3:NaN}function oe(e){return e&&parseFloat(e.replace(",","."))||0}function Ut(e){if(e==="Z")return 0;var t=e.match(Pt);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Jt(r,s)?n*(r*_e+s*Se):NaN}function jt(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var s=r.getUTCDay()||7,o=(t-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+o),r}var Bt=[31,null,31,30,31,30,31,31,30,31,30,31];function Ce(e){return e%400===0||e%4===0&&e%100!==0}function Mt(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Bt[t]||(Ce(e)?29:28))}function Ht(e,t){return t>=1&&t<=(Ce(e)?366:365)}function zt(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function It(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Jt(e,t){return t>=0&&t<=59}function Oe(e,t){return function(){return e.apply(t,arguments)}}const{toString:qt}=Object.prototype,{getPrototypeOf:ie}=Object,W=(e=>t=>{const n=qt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),_=e=>(e=e.toLowerCase(),t=>W(t)===e),K=e=>t=>typeof t===e,{isArray:x}=Array,M=K("undefined");function Wt(e){return e!==null&&!M(e)&&e.constructor!==null&&!M(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Le=_("ArrayBuffer");function Kt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Le(e.buffer),t}const Vt=K("string"),T=K("function"),Ne=K("number"),V=e=>e!==null&&typeof e=="object",Yt=e=>e===!0||e===!1,Y=e=>{if(W(e)!=="object")return!1;const t=ie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Gt=_("Date"),Qt=_("File"),Xt=_("Blob"),Zt=_("FileList"),en=e=>V(e)&&T(e.pipe),tn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||T(e.append)&&((t=W(e))==="formdata"||t==="object"&&T(e.toString)&&e.toString()==="[object FormData]"))},nn=_("URLSearchParams"),rn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function H(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),x(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function xe(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Pe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),$e=e=>!M(e)&&e!==Pe;function ae(){const{caseless:e}=$e(this)&&this||{},t={},n=(r,s)=>{const o=e&&xe(t,s)||s;Y(t[o])&&Y(r)?t[o]=ae(t[o],r):Y(r)?t[o]=ae({},r):x(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&H(arguments[r],n);return t}const sn=(e,t,n,{allOwnKeys:r}={})=>(H(t,(s,o)=>{n&&T(s)?e[o]=Oe(s,n):e[o]=s},{allOwnKeys:r}),e),on=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),an=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},cn=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},un=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},ln=e=>{if(!e)return null;if(x(e))return e;let t=e.length;if(!Ne(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},fn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ie(Uint8Array)),dn=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},pn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},hn=_("HTMLFormElement"),mn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),De=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yn=_("RegExp"),ke=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};H(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},gn=e=>{ke(e,(t,n)=>{if(T(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(T(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return x(e)?r(e):r(String(e).split(t)),n},bn=()=>{},En=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ce="abcdefghijklmnopqrstuvwxyz",Fe="0123456789",Ue={DIGIT:Fe,ALPHA:ce,ALPHA_DIGIT:ce+ce.toUpperCase()+Fe},vn=(e=16,t=Ue.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function An(e){return!!(e&&T(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Tn=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=x(r)?[]:{};return H(r,(i,c)=>{const f=n(i,s+1);!M(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Rn=_("AsyncFunction"),a={isArray:x,isArrayBuffer:Le,isBuffer:Wt,isFormData:tn,isArrayBufferView:Kt,isString:Vt,isNumber:Ne,isBoolean:Yt,isObject:V,isPlainObject:Y,isUndefined:M,isDate:Gt,isFile:Qt,isBlob:Xt,isRegExp:yn,isFunction:T,isStream:en,isURLSearchParams:nn,isTypedArray:fn,isFileList:Zt,forEach:H,merge:ae,extend:sn,trim:rn,stripBOM:on,inherits:an,toFlatObject:cn,kindOf:W,kindOfTest:_,endsWith:un,toArray:ln,forEachEntry:dn,matchAll:pn,isHTMLForm:hn,hasOwnProperty:De,hasOwnProp:De,reduceDescriptors:ke,freezeMethods:gn,toObjectSet:wn,toCamelCase:mn,noop:bn,toFiniteNumber:En,findKey:xe,global:Pe,isContextDefined:$e,ALPHABET:Ue,generateString:vn,isSpecCompliantForm:An,toJSONObject:Tn,isAsyncFn:Rn,isThenable:e=>e&&(V(e)||T(e))&&T(e.then)&&T(e.catch)};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(y,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:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const je=y.prototype,Be={};["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Be[e]={value:e}}),Object.defineProperties(y,Be),Object.defineProperty(je,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,o)=>{const i=Object.create(je);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Sn=null;function ue(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function He(e,t,n){return e?e.concat(t).map(function(s,o){return s=Me(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function _n(e){return a.isArray(e)&&!e.some(ue)}const Cn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function G(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,L){return!a.isUndefined(L[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,m,L){let S=d;if(d&&!L&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&_n(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(S=a.toArray(d)))return m=Me(m),S.forEach(function(se,Kr){!(a.isUndefined(se)||se===null)&&t.append(i===!0?He([m],Kr,o):i===null?m:m+"[]",u(se))}),!1}return ue(d)?!0:(t.append(He(L,m,o),u(d)),!1)}const p=[],v=Object.assign(Cn,{defaultVisitor:l,convertValue:u,isVisitable:ue});function w(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(S,U){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(U)?U.trim():U,m,v))===!0&&w(S,m?m.concat(U):[U])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function ze(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function le(e,t){this._pairs=[],e&&G(e,this,t)}const Ie=le.prototype;Ie.append=function(t,n){this._pairs.push([t,n])},Ie.toString=function(t){const n=t?function(r){return t.call(this,r,ze)}:ze;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function On(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Je(e,t,n){if(!t)return e;const r=n&&n.encode||On,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new le(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ln{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const qe=Ln,We={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nn=typeof URLSearchParams<"u"?URLSearchParams:le,xn=typeof FormData<"u"?FormData:null,Pn=typeof Blob<"u"?Blob:null,$n=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Dn=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),R={isBrowser:!0,classes:{URLSearchParams:Nn,FormData:xn,Blob:Pn},isStandardBrowserEnv:$n,isStandardBrowserWebWorkerEnv:Dn,protocols:["http","https","file","blob","url","data"]};function kn(e,t){return G(e,new R.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Fn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Un(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Ke(e){function t(n,r,s,o){let i=n[o++];const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Un(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Fn(r),s,n,0)}),n}return null}function jn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fe={transitional:We,adapter:R.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(Ke(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return G(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),jn(t)):t}],transformResponse:[function(t){const n=this.transitional||fe.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{fe.headers[e]={}});const de=fe,Bn=a.toObjectSet(["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"]),Mn=e=>{const t={};let n,r,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Bn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function z(e){return e&&String(e).trim().toLowerCase()}function Q(e){return e===!1||e==null?e:a.isArray(e)?e.map(Q):String(e)}function Hn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const zn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function In(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Jn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let X=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=z(f);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||f]=Q(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!zn(t)?i(Mn(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=z(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Hn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=z(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=z(i),i){const c=a.findKey(r,i);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||pe(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=Q(s),delete n[o];return}const c=t?In(o):String(o).trim();c!==o&&delete n[o],n[c]=Q(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=z(i);r[c]||(Jn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(X.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(X);const C=X;function he(e,t){const n=this||de,r=t||n,s=C.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ye(e){return!!(e&&e.__CANCEL__)}function I(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(I,y,{__CANCEL__:!0});function qn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Wn=R.isStandardBrowserEnv?function(){return{write:function(n,r,s,o,i,c){const f=[];f.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&f.push("expires="+new Date(s).toGMTString()),a.isString(o)&&f.push("path="+o),a.isString(i)&&f.push("domain="+i),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Kn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ge(e,t){return e&&!Kn(t)?Vn(e,t):t}const Yn=R.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function Gn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Qn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let p=o,v=0;for(;p!==s;)v+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const w=l&&u-l;return w?Math.round(v*1e3/w):void 0}}function Qe(e,t){let n=0;const r=Qn(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,c=o-n,f=r(c),u=o<=i;n=o;const l={loaded:o,total:i,progress:i?o/i:void 0,bytes:c,rate:f||void 0,estimated:f&&i&&u?(i-o)/f:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const Z={http:Sn,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const o=C.from(e.headers).normalize(),i=e.responseType;let c;function f(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}a.isFormData(s)&&(R.isStandardBrowserEnv||R.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const w=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(w+":"+d))}const l=Ge(e.baseURL,e.url);u.open(e.method.toUpperCase(),Je(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function p(){if(!u)return;const w=C.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:w,config:e,request:u};qn(function(S){n(S),f()},function(S){r(S),f()},m),u=null}if("onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(p)},u.onabort=function(){u&&(r(new y("Request aborted",y.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let d=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||We;e.timeoutErrorMessage&&(d=e.timeoutErrorMessage),r(new y(d,m.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,u)),u=null},R.isStandardBrowserEnv){const w=(e.withCredentials||Yn(l))&&e.xsrfCookieName&&Wn.read(e.xsrfCookieName);w&&o.set(e.xsrfHeaderName,w)}s===void 0&&o.setContentType(null),"setRequestHeader"in u&&a.forEach(o.toJSON(),function(d,m){u.setRequestHeader(m,d)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&i!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Qe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Qe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=w=>{u&&(r(!w||w.type?new I(null,e,u):w),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const v=Gn(l);if(v&&R.protocols.indexOf(v)===-1){r(new y("Unsupported protocol "+v+":",y.ERR_BAD_REQUEST,e));return}u.send(s||null)})}};a.forEach(Z,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xe={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=a.isString(n)?Z[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new y(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(Z,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Z};function me(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new I(null,e)}function Ze(e){return me(e),e.headers=C.from(e.headers),e.data=he.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xe.getAdapter(e.adapter||de.adapter)(e).then(function(r){return me(e),r.data=he.call(e,e.transformResponse,r),r.headers=C.from(r.headers),r},function(r){return Ye(r)||(me(e),r&&r.response&&(r.response.data=he.call(e,e.transformResponse,r.response),r.response.headers=C.from(r.response.headers))),Promise.reject(r)})}const et=e=>e instanceof C?e.toJSON():e;function P(e,t){t=t||{};const n={};function r(u,l,p){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:p},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p)}else return r(u,l,p)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l)=>s(et(u),et(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const p=f[l]||s,v=p(e[l],t[l],l);a.isUndefined(v)&&p!==c||(n[l]=v)}),n}const tt="1.5.0",ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const nt={};ye.transitional=function(t,n,r){function s(o,i){return"[Axios v"+tt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!nt[i]&&(nt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Xn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ge={assertOptions:Xn,validators:ye},N=ge.validators;let ee=class{constructor(t){this.defaults=t,this.interceptors={request:new qe,response:new qe}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=P(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ge.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=C.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,v;if(!f){const d=[Ze.bind(this),void 0];for(d.unshift.apply(d,c),d.push.apply(d,u),v=d.length,l=Promise.resolve(n);p<v;)l=l.then(d[p++],d[p++]);return l}v=c.length;let w=n;for(p=0;p<v;){const d=c[p++],m=c[p++];try{w=d(w)}catch(L){m.call(this,L);break}}try{l=Ze.call(this,w)}catch(d){return Promise.reject(d)}for(p=0,v=u.length;p<v;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=P(this.defaults,t);const n=Ge(t.baseURL,t.url);return Je(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){ee.prototype[t]=function(n,r){return this.request(P(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(P(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ee.prototype[t]=n(),ee.prototype[t+"Form"]=n(!0)});const te=ee,Zn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new I(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function er(e){return function(n){return e.apply(null,n)}}function tr(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(we).forEach(([e,t])=>{we[t]=e});const nr=we;function rt(e){const t=new te(e),n=Oe(te.prototype.request,t);return a.extend(n,te.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return rt(P(e,s))},n}const E=rt(de);E.Axios=te,E.CanceledError=I,E.CancelToken=Zn,E.isCancel=Ye,E.VERSION=tt,E.toFormData=G,E.AxiosError=y,E.Cancel=E.CanceledError,E.all=function(t){return Promise.all(t)},E.spread=er,E.isAxiosError=tr,E.mergeConfig=P,E.AxiosHeaders=C,E.formToJSON=e=>Ke(a.isHTMLForm(e)?new FormData(e):e),E.getAdapter=Xe.getAdapter,E.HttpStatusCode=nr,E.default=E;const st=E,{Axios:Xr,AxiosError:rr,CanceledError:Zr,isCancel:es,CancelToken:ts,VERSION:ns,all:rs,Cancel:ss,isAxiosError:os,spread:is,toFormData:as,AxiosHeaders:cs,HttpStatusCode:us,formToJSON:ls,getAdapter:fs,mergeConfig:ds}=st,ot=st.create({headers:{"Content-Type":"application/json"}}),O=async(e,...t)=>{try{return await ot[e](...t)}catch(n){if(!(n instanceof rr)||!n.response)throw n;const r=n.response;let s="";switch(r.status){case 400:s="Check parameters or API token";break;case 401:s="You must be logged before using this function, use `auth.login(token)`";break;case 403:s="You dont have enough permissions";break;case 404:s="Check parameters";break;case 409:s="Request conflit with current state";break;case 500:s="Something went wrong with server";break}throw s=`${n.code} (${r.status}) - ${s}: ${r.data.content.message}`,new Error(s)}},h=Object.assign(ot,{$get:async(...e)=>(await O("get",...e)).data,$post:async(...e)=>(await O("post",...e)).data,$put:async(...e)=>(await O("put",...e)).data,$patch:async(...e)=>(await O("patch",...e)).data,$delete:async(...e)=>(await O("delete",...e)).data}),it=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),sr=e=>({...e,namespace:it(e.namespace),createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),or=e=>({...e,memberships:e.memberships.map(sr),createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),at=e=>{h.defaults.headers.common.authorization=`Bearer ${e}`},ct=()=>{h.defaults.headers.common.authorization=void 0},ut=()=>{const e=h.defaults.headers.common.authorization;if(!e||typeof e!="string")return!1;const[,t]=e.split("Bearer ");return!!t},ir=Object.freeze(Object.defineProperty({__proto__:null,getCurrentNamespaces:()=>h.$get("/me/namespaces"),getCurrentPermissions:()=>h.$get("/me/permissions"),getCurrentUser:async()=>{const{content:e,...t}=await h.$get("/me");return{...t,content:or(e)}},isLogged:ut,login:at,logout:ct},Symbol.toStringTag,{value:"Module"})),$=e=>({...e,nextRun:e.nextRun?b(e.nextRun):void 0,lastRun:e.lastRun?b(e.lastRun):void 0}),ar=Object.freeze(Object.defineProperty({__proto__:null,forceCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$post(`/crons/${t}/force`,{});return{...r,content:$(n)}},getAllCrons:async()=>{const{content:e,...t}=await h.$get("/crons");return{...t,content:e.map($)}},getCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$get(`/crons/${t}`);return{...r,content:$(n)}},startCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$put(`/crons/${t}/start`,{});return{...r,content:$(n)}},stopCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await h.$put(`/crons/${t}/stop`,{});return{...r,content:$(n)}},updateCron:async e=>{const{name:t,...n}=e,{content:r,...s}=await h.$patch(`/crons/${t}`,n);return{...s,content:$(r)}}},Symbol.toStringTag,{value:"Module"})),lt=()=>h.$get("/health"),cr=()=>h.$get("/health/all"),ft=e=>h.$get(`/health/${e}`),ur=Object.freeze(Object.defineProperty({__proto__:null,checkAllConnectedService:cr,checkConnectedService:ft,checkCurrentService:async()=>{const{content:{current:e}}=await lt();return ft(e)},getAllConnectedServices:lt},Symbol.toStringTag,{value:"Module"}));var dt=(e=>(e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.BIENNIAL="BIENNIAL",e.YEARLY="YEARLY",e))(dt||{});const be=e=>({...e,nextRun:b(e.nextRun),lastRun:e.lastRun?b(e.lastRun):void 0,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),pt=e=>{const{namespace:t,...n}=e,{namespaceId:r,...s}=be({namespaceId:t.id,...n});return{...s,namespace:it(t)}},lr=e=>({...e,createdAt:b(e.createdAt)}),fr=e=>({...e,task:pt(e.task),createdAt:b(e.createdAt)}),ht=Object.freeze(Object.defineProperty({__proto__:null,getAllEntries:async(e,t)=>{const{data:{content:n,...r}}=await O("get","/tasks-activity",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(fr)}}},Symbol.toStringTag,{value:"Module"})),dr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ee=e=>({...e,added:b(e.added),started:e.started?b(e.started):void 0,ended:e.ended?b(e.ended):void 0}),pr=()=>h.$get("/queues"),hr=async e=>{const t=typeof e=="string"?e:e.name;return h.$get(`/queues/${t}`)},mr=async e=>{const{name:t,...n}=e;return h.$patch(`/queues/${t}`,n)},yr=async e=>{const t=typeof e=="string"?e:e.name;return h.$put(`/queues/${t}/pause`)},gr=async e=>{const t=typeof e=="string"?e:e.name;return h.$put(`/queues/${t}/resume`)},wr=async(e,t)=>{const n=typeof e=="string"?e:e.name,{data:{content:r,...s}}=await O("get",`/queues/${n}/jobs`,{params:t});return{...s,content:r.map(Ee)}},J=async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await h.$get(`/queues/${r}/jobs/${s}`,{params:{namespaces:n}});return{...i,content:Ee(o)}},br=Object.freeze(Object.defineProperty({__proto__:null,getAllQueues:pr,getJob:J,getQueue:hr,getQueueJobs:wr,pauseQueue:yr,resumeQueue:gr,retryJob:async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await h.$post(`/queues/${r}/jobs/${s}/retry`,{params:{namespaces:n}});return{...i,content:Ee(o)}},updateQueue:mr},Symbol.toStringTag,{value:"Module"}));function Er(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve={exports:{}},D=typeof Reflect=="object"?Reflect:null,mt=D&&typeof D.apply=="function"?D.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},ne;D&&typeof D.ownKeys=="function"?ne=D.ownKeys:Object.getOwnPropertySymbols?ne=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:ne=function(t){return Object.getOwnPropertyNames(t)};function vr(e){console&&console.warn&&console.warn(e)}var yt=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}ve.exports=g,ve.exports.once=Sr,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var gt=10;function re(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return gt},set:function(e){if(typeof e!="number"||e<0||yt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");gt=e}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||yt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function wt(e){return e._maxListeners===void 0?g.defaultMaxListeners:e._maxListeners}g.prototype.getMaxListeners=function(){return wt(this)},g.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var s=t==="error",o=this._events;if(o!==void 0)s=s&&o.error===void 0;else if(!s)return!1;if(s){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=o[t];if(f===void 0)return!1;if(typeof f=="function")mt(f,this,n);else for(var u=f.length,l=Tt(f,u),r=0;r<u;++r)mt(l[r],this,n);return!0};function bt(e,t,n,r){var s,o,i;if(re(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),i===void 0)i=o[t]=n,++e._eventsCount;else if(typeof i=="function"?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=wt(e),s>0&&i.length>s&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,vr(c)}return e}g.prototype.addListener=function(t,n){return bt(this,t,n,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(t,n){return bt(this,t,n,!0)};function Ar(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Et(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=Ar.bind(r);return s.listener=n,r.wrapFn=s,s}g.prototype.once=function(t,n){return re(n),this.on(t,Et(this,t,n)),this},g.prototype.prependOnceListener=function(t,n){return re(n),this.prependListener(t,Et(this,t,n)),this},g.prototype.removeListener=function(t,n){var r,s,o,i,c;if(re(n),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===n||r[i].listener===n){c=r[i].listener,o=i;break}if(o<0)return this;o===0?r.shift():Tr(r,o),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,c||n)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(t){var n,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),i;for(s=0;s<o.length;++s)i=o[s],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this};function vt(e,t,n){var r=e._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?Rr(s):Tt(s,s.length)}g.prototype.listeners=function(t){return vt(this,t,!0)},g.prototype.rawListeners=function(t){return vt(this,t,!1)},g.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):At.call(e,t)},g.prototype.listenerCount=At;function At(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?ne(this._events):[]};function Tt(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Tr(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Rr(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Sr(e,t){return new Promise(function(n,r){function s(i){e.removeListener(t,o),r(i)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}Rt(e,t,o,{once:!0}),t!=="error"&&_r(e,s,{once:!0})})}function _r(e,t,n){typeof e.on=="function"&&Rt(e,"error",t,n)}function Rt(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){r.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var Cr=ve.exports;const Or=Er(Cr),Lr=(e,t=new Or)=>{const n={emit:(o,...i)=>(t.emit(o.toString(),...i),n)},r=e(n),s=Object.assign(r,{on:(o,i)=>(t.on(o.toString(),(...c)=>i(...c)),s),once:(o,i)=>(t.once(o.toString(),(...c)=>i(...c)),s),off:(o,i)=>(t.off(o.toString(),(...c)=>i(...c)),s)});return s},Nr=e=>new Promise(t=>{setTimeout(t,e)}),xr=e=>({start:b(e.start),end:b(e.end)}),Pr=e=>({...e,createdAt:b(e.createdAt),destroyAt:b(e.destroyAt),period:e.period?xr(e.period):void 0}),Ae=e=>({...e,detail:Pr(e.detail)}),St=(e,t,n)=>{var s,o;const r=typeof e=="string"?e:e.id;return h.$post(`/tasks/${r}/run`,null,{params:{test_emails:t==null?void 0:t.testEmails,period_start:(s=t==null?void 0:t.period)==null?void 0:s.start,period_end:(o=t==null?void 0:t.period)==null?void 0:o.end,namespaces:n}})},$r=(...e)=>Lr(async t=>{const{content:{id:n,queue:r}}=await St(...e);t.emit("started",{id:n,queue:r});let s;do{const{content:{progress:o,status:i,result:c}}=await J(r,n,e[2]);s={progress:o,status:i,result:c},t.emit("progress",{progress:o,status:i});let f=1e3;s.status==="active"&&(f=250),await Nr(f)}while(["completed","failed","stuck"].includes(s.status)===!1);if(!s.result)throw new Error("Generation failed with weird error");return Ae(s.result)}),k=async(e,t,n)=>(await O("get",`/reports/${e}`,{responseType:n,params:{namespaces:t}})).data,Dr=Object.freeze(Object.defineProperty({__proto__:null,getReportDebugByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await J(e,t,n);if(!s)throw new Error("Job have no result");return k(((o=s.detail)==null?void 0:o.files.debug)??"",n,r)},getReportDebugByName:(e,t,n)=>k(`${e}.deb.json`,t,n),getReportDetailByJob:async(e,t,n,r)=>{var i;const{content:{result:s}}=await J(e,t,n);if(!s)throw new Error("Job have no result");const o=await k(((i=s.detail)==null?void 0:i.files.detail)??"",n,r);return!r||r==="json"?Ae(o):o},getReportDetailByName:async(e,t,n)=>{const r=await k(`${e}.det.json`,t,n);return!n||n==="json"?Ae(r):r},getReportFileByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await J(e,t,n);if(!s)throw new Error("Job have no result");return k(((o=s.detail)==null?void 0:o.files.report)??"",n,r)},getReportFileByName:(e,t,n,r="pdf")=>k(`${e}.rep.${r}`,t,n),startAndListenGeneration:$r,startGeneration:St},Symbol.toStringTag,{value:"Module"})),kr=Object.freeze(Object.defineProperty({__proto__:null,isLogged:ut,isURLset:()=>!!h.defaults.baseURL,login:at,logout:ct,setURL:e=>{h.defaults.baseURL=e},unsetURL:()=>{h.defaults.baseURL=void 0}},Symbol.toStringTag,{value:"Module"})),Te=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),Re=e=>{const{body:t,tasks:n,...r}=e;return{...Te(r),tasks:n.map(be),body:t}},Fr=async()=>{const{content:e,...t}=await h.$get("/templates");return{...t,content:e.map(Te)}},Ur=async e=>{const t=typeof e=="string"?e:e.id,{content:n,...r}=await h.$get(`/templates/${t}`);return{...r,content:Re(n)}},jr=async e=>{const{content:t,...n}=await h.$post("/templates",e);return{...n,content:Re(t)}},_t=async e=>{const{id:t,...n}=e,{content:r,...s}=await h.$put(`/templates/${t}`,n);return{...s,content:Re(r)}},Br=_t,Mr=async e=>{const t=typeof e=="string"?e:e.id;await h.$delete(`/templates/${t}`)},F=e=>{const{activity:t,template:n,targets:r,extends:s,...o}=e;return{...pt(o),extends:Te(s),activity:t.map(lr),template:n,targets:r}},Hr=async(e,t)=>{const{data:{content:n,...r}}=await O("get","/tasks",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(({tags:s,...o})=>({tags:s,...be(o)}))}},zr=async(e,t)=>{const{content:n,...r}=await h.$post("/tasks",e,{params:{namespaces:t}});return{...r,content:F(n)}},Ir=async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await h.$get(`/tasks/${n}`,{params:{namespaces:t}});return{...s,content:F(r)}},Ct=async(e,t)=>{const{id:n,...r}=e,{content:s,...o}=await h.$put(`/tasks/${n}`,r,{params:{namespaces:t}});return{...o,content:F(s)}},Jr=Object.freeze(Object.defineProperty({__proto__:null,Recurrence:dt,createTask:zr,deleteTask:async(e,t)=>{const n=typeof e=="string"?e:e.id;await h.$delete(`/tasks/${n}`,{params:{namespaces:t}})},disableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await h.$put(`/tasks/${n}/disable`,void 0,{params:{namespaces:t}});return{...s,content:F(r)}},enableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await h.$put(`/tasks/${n}/enable`,void 0,{params:{namespaces:t}});return{...s,content:F(r)}},getAllTasks:Hr,getTask:Ir,linkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id,{content:o,...i}=await h.$put(`/tasks/${r}/link/${s}`,void 0,{params:{namespaces:n}});return{...i,content:F(o)}},unlinkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id;await h.$delete(`/tasks/${r}/link/${s}`,{params:{namespaces:n}})},updateTask:Ct,upsertTask:Ct},Symbol.toStringTag,{value:"Module"})),qr=Object.freeze(Object.defineProperty({__proto__:null,createTemplate:jr,deleteTemplate:Mr,getAllTemplates:Fr,getTemplate:Ur,updateTemplate:Br,upsertTemplate:_t},Symbol.toStringTag,{value:"Module"})),Wr="1.0.0-beta.7";A.auth=ir,A.crons=ar,A.health=ur,A.history=ht,A.namespaces=dr,A.queues=br,A.reports=Dr,A.setup=kr,A.tasks=Jr,A.tasksActivity=ht,A.templates=qr,A.version=Wr,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
4
4
  //# sourceMappingURL=ezreeport-sdk-js.umd.js.map