@enviabybus/react-utility-belt 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services.cjs.js +6 -6
- package/dist/services.es.js +45 -44
- package/dist/src/services/graphql.service.d.ts +1 -1
- package/dist/src/services/graphql.service.d.ts.map +1 -1
- package/dist/src/services/services.d.ts +9 -9
- package/dist/src/services/services.d.ts.map +1 -1
- package/dist/src/types/helpers.d.ts +3 -0
- package/dist/src/types/helpers.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/services.cjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./chunks/services.helper.DolZWkEs.js"),z=require("react"),Xe=require("react/jsx-runtime"),Ze=require("@tanstack/react-query"),R=require("./errors.cjs.js"),Nt=e=>({...t})=>e(t),Ft=({useAdapter:e,LoggerService:t})=>W("ERROR_SERVICE",Nt(e),[t.ServiceProvider]),Ut=()=>({LoggerService:e})=>{const t=I(e),r=z.useRef({}),n=(c,p)=>{const u=r.current;r.current={...u,[c]:[...u[c]||[],p]}},s=(c,p)=>{const u=r.current;r.current={...u,[c]:u[c].filter(a=>a!==p)}};return{raiseError:c=>{var p;t.error(c),(p=r.current[c.code])==null||p.forEach(u=>u(c))},useErrorHandler:(c,p)=>{const u=P.compilerRuntimeExports.c(4);let a,f;u[0]!==p||u[1]!==c?(a=()=>(n(c,p),()=>{s(c,p)}),f=[c,p],u[0]=p,u[1]=c,u[2]=a,u[3]=f):(a=u[2],f=u[3]),z.useEffect(a,f)}}},Bt=({HttpService:e,ErrorService:t})=>()=>{const r=I(t),n=I(e),s=u=>{const{details:a,message:f}=u,m=a!=null&&a.body&&typeof a.body=="object"&&"errors"in a.body&&a.body.errors instanceof Array?a.body.errors:[];if(m.length===0)return r.raiseError(u),u;if(m.find(h=>{var y;return((y=h.extensions)==null?void 0:y.code)===R.GraphQLErrors.AuthenticationError||h.message.toLowerCase().includes("authorization")})){const h=new R.HttpServiceError({code:R.HttpServiceErrorCode.Unauthorized,details:a,message:f});return r.raiseError(h),h}const d=typeof m[0]=="string"?m[0]:null,E=new R.HttpServiceError({code:R.HttpServiceErrorCode.Generic,details:a,message:f+(d?` (${d})`:"")});return r.raiseError(E),E},o=u=>{const{details:a,message:f}=u,m=new R.HttpServiceError({code:R.HttpServiceErrorCode.Unauthorized,details:a,message:f});return r.raiseError(m),m},i=u=>{const a=u.find(g=>{var d;return((d=g==null?void 0:g.extensions)==null?void 0:d.code)===R.GraphQLErrors.AuthenticationError});if(a)return o(a);const f=typeof u[0]=="string"?u[0]:"Unknown error.",m=new R.GraphQLServiceError({code:R.GraphQLServiceErrorCode.Generic,message:f});return r.raiseError(m),m},c=u=>{if("errors"in u&&u.errors instanceof Array&&u.errors.length>0)return i(u.errors);if(!u.data){const f=new R.GraphQLServiceError({code:R.GraphQLServiceErrorCode.Generic,message:"Response is missing 'data' attribute."});return r.raiseError(f),f}return u.data};return{execute:async u=>{const a=Array.isArray(u.url)?P.buildUrl(u.url):u.url;try{const f=await n.post({body:{query:u.query,variables:u.variables},headers:u.headers,url:a});if(!f)return{};const m=c(f.body);if(m instanceof R.BaseError)throw m;return m}catch(f){throw f instanceof R.HttpServiceError?s(f):f instanceof R.BaseError?f:new Error("Could not handle error")}}}},kt=({HttpService:e,ErrorService:t})=>W("GRAPHQL_SERVICE",Bt({ErrorService:t,HttpService:e}),[e.ServiceProvider,t.ServiceProvider]),Dt=e=>({ErrorService:t,LoggerService:r})=>{const n=e(),s=I(r),o=I(t),i=y=>{const b=P.lodashExports.omitBy(y,P.lodashExports.isNil);s.info(`HTTP request: ${JSON.stringify(b)}`)},c=y=>{const{body:b,status:S}=y;s.info(`HTTP response: ${JSON.stringify({body:b,status:S})}`)},p=y=>y>=400&&y<600,u=y=>{const{details:b,message:S}=y;return o.raiseError(new R.HttpServiceError({code:R.HttpServiceErrorCode.Unauthorized,details:b,message:S}))},a=y=>{const{status:b}=y.details||{};if(!b||b>=500){const S=JSON.stringify(y);s.error(S)}else{if(b===401)return u(y);s.warn(y)}return o.raiseError(y)},f=async(y,b,S={})=>{i({method:y,...b});let O,A;const N=v=>{if(v instanceof R.HttpServiceError){A=v;return}O=v};switch(y){case"GET":{N(await n.get(b,S));break}case"DELETE":{N(await n.delete(b,S));break}case"PATCH":{N(await n.patch(b,S));break}case"POST":{N(await n.post(b,S));break}case"PUT":{N(await n.put(b,S));break}default:throw Error(`Unknown method HTTP method '${y}'`)}if(A)throw a(A),A;return O?(c(O),p(O.status)&&a(new R.HttpServiceError({details:{body:JSON.stringify(O.body),method:y,status:O.status,url:b.url}})),O):void 0};return{delete:(y,b={})=>f("DELETE",y,b),get:(y,b={})=>f("GET",y,b),patch:(y,b={})=>f("PATCH",y,b),post:async(y,b={})=>await f("POST",y,b),put:(y,b={})=>f("PUT",y,b)}},_t=({useAdapter:e,ErrorService:t,LoggerService:r})=>W("HTTP_SERVICE",Dt(e),[t.ServiceProvider,r.ServiceProvider]);function Ye(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ht}=Object.prototype,{getPrototypeOf:Te}=Object,{iterator:ue,toStringTag:et}=Symbol,le=(e=>t=>{const r=Ht.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),F=e=>(e=e.toLowerCase(),t=>le(t)===e),fe=e=>t=>typeof t===e,{isArray:K}=Array,J=fe("undefined");function X(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tt=F("ArrayBuffer");function Mt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tt(e.buffer),t}const qt=fe("string"),x=fe("function"),rt=fe("number"),Z=e=>e!==null&&typeof e=="object",jt=e=>e===!0||e===!1,oe=e=>{if(le(e)!=="object")return!1;const t=Te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(et in e)&&!(ue in e)},It=e=>{if(!Z(e)||X(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$t=F("Date"),zt=F("File"),Jt=F("Blob"),Kt=F("FileList"),Vt=e=>Z(e)&&x(e.pipe),Wt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=le(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},Gt=F("URLSearchParams"),[Qt,Xt,Zt,Yt]=["ReadableStream","Request","Response","Headers"].map(F),er=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Y(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),K(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(X(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(n=0;n<i;n++)c=o[n],t.call(null,e[c],c,e)}}function nt(e,t){if(X(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,st=e=>!J(e)&&e!==H;function we(){const{caseless:e,skipUndefined:t}=st(this)&&this||{},r={},n=(s,o)=>{const i=e&&nt(r,o)||o;oe(r[i])&&oe(s)?r[i]=we(r[i],s):oe(s)?r[i]=we({},s):K(s)?r[i]=s.slice():(!t||!J(s))&&(r[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Y(arguments[s],n);return r}const tr=(e,t,r,{allOwnKeys:n}={})=>(Y(t,(s,o)=>{r&&x(s)?e[o]=Ye(s,r):e[o]=s},{allOwnKeys:n}),e),rr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},sr=(e,t,r,n)=>{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],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Te(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},or=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},ir=e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!rt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ar=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Te(Uint8Array)),cr=(e,t)=>{const n=(e&&e[ue]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},ur=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},lr=F("HTMLFormElement"),fr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),ke=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),dr=F("RegExp"),ot=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Y(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},pr=e=>{ot(e,(t,r)=>{if(x(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(x(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},hr=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return K(e)?n(e):n(String(e).split(t)),r},mr=()=>{},Er=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function yr(e){return!!(e&&x(e.append)&&e[et]==="FormData"&&e[ue])}const gr=e=>{const t=new Array(10),r=(n,s)=>{if(Z(n)){if(t.indexOf(n)>=0)return;if(X(n))return n;if(!("toJSON"in n)){t[s]=n;const o=K(n)?[]:{};return Y(n,(i,c)=>{const p=r(i,s+1);!J(p)&&(o[c]=p)}),t[s]=void 0,o}}return n};return r(e,0)},wr=F("AsyncFunction"),br=e=>e&&(Z(e)||x(e))&&x(e.then)&&x(e.catch),it=((e,t)=>e?setImmediate:t?((r,n)=>(H.addEventListener("message",({source:s,data:o})=>{s===H&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),H.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x(H.postMessage)),Sr=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||it,Rr=e=>e!=null&&x(e[ue]),l={isArray:K,isArrayBuffer:tt,isBuffer:X,isFormData:Wt,isArrayBufferView:Mt,isString:qt,isNumber:rt,isBoolean:jt,isObject:Z,isPlainObject:oe,isEmptyObject:It,isReadableStream:Qt,isRequest:Xt,isResponse:Zt,isHeaders:Yt,isUndefined:J,isDate:$t,isFile:zt,isBlob:Jt,isRegExp:dr,isFunction:x,isStream:Vt,isURLSearchParams:Gt,isTypedArray:ar,isFileList:Kt,forEach:Y,merge:we,extend:tr,trim:er,stripBOM:rr,inherits:nr,toFlatObject:sr,kindOf:le,kindOfTest:F,endsWith:or,toArray:ir,forEachEntry:cr,matchAll:ur,isHTMLForm:lr,hasOwnProperty:ke,hasOwnProp:ke,reduceDescriptors:ot,freezeMethods:pr,toObjectSet:hr,toCamelCase:fr,noop:mr,toFiniteNumber:Er,findKey:nt,global:H,isContextDefined:st,isSpecCompliantForm:yr,toJSONObject:gr,isAsyncFn:wr,isThenable:br,setImmediate:it,asap:Sr,isIterable:Rr};function w(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}l.inherits(w,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:l.toJSONObject(this.config),code:this.code,status:this.status}}});const at=w.prototype,ct={};["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=>{ct[e]={value:e}});Object.defineProperties(w,ct);Object.defineProperty(at,"isAxiosError",{value:!0});w.from=(e,t,r,n,s,o)=>{const i=Object.create(at);l.toFlatObject(e,i,function(a){return a!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return w.call(i,c,p,r,n,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const Tr=null;function be(e){return l.isPlainObject(e)||l.isArray(e)}function ut(e){return l.endsWith(e,"[]")?e.slice(0,-2):e}function De(e,t,r){return e?e.concat(t).map(function(s,o){return s=ut(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function Or(e){return l.isArray(e)&&!e.some(be)}const Ar=l.toFlatObject(l,{},null,function(t){return/^is[A-Z]/.test(t)});function de(e,t,r){if(!l.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=l.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,h){return!l.isUndefined(h[E])});const n=r.metaTokens,s=r.visitor||a,o=r.dots,i=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(t);if(!l.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(l.isDate(d))return d.toISOString();if(l.isBoolean(d))return d.toString();if(!p&&l.isBlob(d))throw new w("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(d)||l.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function a(d,E,h){let y=d;if(d&&!h&&typeof d=="object"){if(l.endsWith(E,"{}"))E=n?E:E.slice(0,-2),d=JSON.stringify(d);else if(l.isArray(d)&&Or(d)||(l.isFileList(d)||l.endsWith(E,"[]"))&&(y=l.toArray(d)))return E=ut(E),y.forEach(function(S,O){!(l.isUndefined(S)||S===null)&&t.append(i===!0?De([E],O,o):i===null?E:E+"[]",u(S))}),!1}return be(d)?!0:(t.append(De(h,E,o),u(d)),!1)}const f=[],m=Object.assign(Ar,{defaultVisitor:a,convertValue:u,isVisitable:be});function g(d,E){if(!l.isUndefined(d)){if(f.indexOf(d)!==-1)throw Error("Circular reference detected in "+E.join("."));f.push(d),l.forEach(d,function(y,b){(!(l.isUndefined(y)||y===null)&&s.call(t,y,l.isString(b)?b.trim():b,E,m))===!0&&g(y,E?E.concat(b):[b])}),f.pop()}}if(!l.isObject(e))throw new TypeError("data must be an object");return g(e),t}function _e(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Oe(e,t){this._pairs=[],e&&de(e,this,t)}const lt=Oe.prototype;lt.append=function(t,r){this._pairs.push([t,r])};lt.toString=function(t){const r=t?function(n){return t.call(this,n,_e)}:_e;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function vr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ft(e,t,r){if(!t)return e;const n=r&&r.encode||vr;l.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(s?o=s(t,r):o=l.isURLSearchParams(t)?t.toString():new Oe(t,r).toString(n),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class He{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){l.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cr=typeof URLSearchParams<"u"?URLSearchParams:Oe,xr=typeof FormData<"u"?FormData:null,Lr=typeof Blob<"u"?Blob:null,Pr={isBrowser:!0,classes:{URLSearchParams:Cr,FormData:xr,Blob:Lr},protocols:["http","https","file","blob","url","data"]},Ae=typeof window<"u"&&typeof document<"u",Se=typeof navigator=="object"&&navigator||void 0,Nr=Ae&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),Fr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ur=Ae&&window.location.href||"http://localhost",Br=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ae,hasStandardBrowserEnv:Nr,hasStandardBrowserWebWorkerEnv:Fr,navigator:Se,origin:Ur},Symbol.toStringTag,{value:"Module"})),C={...Br,...Pr};function kr(e,t){return de(e,new C.classes.URLSearchParams,{visitor:function(r,n,s,o){return C.isNode&&l.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Dr(e){return l.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _r(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function pt(e){function t(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),p=o>=r.length;return i=!i&&l.isArray(s)?s.length:i,p?(l.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!c):((!s[i]||!l.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&l.isArray(s[i])&&(s[i]=_r(s[i])),!c)}if(l.isFormData(e)&&l.isFunction(e.entries)){const r={};return l.forEachEntry(e,(n,s)=>{t(Dr(n),s,r,0)}),r}return null}function Hr(e,t,r){if(l.isString(e))try{return(t||JSON.parse)(e),l.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ee={transitional:dt,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=l.isObject(t);if(o&&l.isHTMLForm(t)&&(t=new FormData(t)),l.isFormData(t))return s?JSON.stringify(pt(t)):t;if(l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t)||l.isReadableStream(t))return t;if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return kr(t,this.formSerializer).toString();if((c=l.isFileList(t))||n.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return de(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),Hr(t)):t}],transformResponse:[function(t){const r=this.transitional||ee.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(l.isResponse(t)||l.isReadableStream(t))return t;if(t&&l.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?w.from(c,w.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:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const Mr=l.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"]),qr=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&Mr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Me=Symbol("internals");function Q(e){return e&&String(e).trim().toLowerCase()}function ie(e){return e===!1||e==null?e:l.isArray(e)?e.map(ie):String(e)}function jr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Ir=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ee(e,t,r,n,s){if(l.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!l.isString(t)){if(l.isString(n))return t.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(t)}}function $r(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function zr(e,t){const r=l.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}let L=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(c,
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Me]=this[Me]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=Q(i);n[c]||(zr(s,i),n[c]=!0)}return l.isArray(t)?t.forEach(o):o(t),this}};L.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);l.reduceDescriptors(L.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});l.freezeMethods(L);function ye(e,t){const r=this||ee,n=t||r,s=L.from(n.headers);let o=n.data;return l.forEach(e,function(c){o=c.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ht(e){return!!(e&&e.__CANCEL__)}function V(e,t,r){w.call(this,e??"canceled",w.ERR_CANCELED,t,r),this.name="CanceledError"}l.inherits(V,w,{__CANCEL__:!0});function mt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new w("Request failed with status code "+r.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Jr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const u=Date.now(),a=n[o];i||(i=u),r[s]=p,n[s]=u;let f=o,m=0;for(;f!==s;)m+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const g=a&&u-a;return g?Math.round(m*1e3/g):void 0}}function Vr(e,t){let r=0,n=1e3/t,s,o;const i=(u,a=Date.now())=>{r=a,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const a=Date.now(),f=a-r;f>=n?i(u,a):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},n-f)))},()=>s&&i(s)]}const ce=(e,t,r=3)=>{let n=0;const s=Kr(50,250);return Vr(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,p=i-n,u=s(p),a=i<=c;n=i;const f={loaded:i,total:c,progress:c?i/c:void 0,bytes:p,rate:u||void 0,estimated:u&&c&&a?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(f)},r)},qe=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},je=e=>(...t)=>l.asap(()=>e(...t)),Wr=C.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,C.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Gr=C.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];l.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),l.isString(n)&&c.push(`path=${n}`),l.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),l.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Qr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Xr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Et(e,t,r){let n=!Qr(t);return e&&(n||r==!1)?Xr(e,t):t}const Ie=e=>e instanceof L?{...e}:e;function q(e,t){t=t||{};const r={};function n(u,a,f,m){return l.isPlainObject(u)&&l.isPlainObject(a)?l.merge.call({caseless:m},u,a):l.isPlainObject(a)?l.merge({},a):l.isArray(a)?a.slice():a}function s(u,a,f,m){if(l.isUndefined(a)){if(!l.isUndefined(u))return n(void 0,u,f,m)}else return n(u,a,f,m)}function o(u,a){if(!l.isUndefined(a))return n(void 0,a)}function i(u,a){if(l.isUndefined(a)){if(!l.isUndefined(u))return n(void 0,u)}else return n(void 0,a)}function c(u,a,f){if(f in t)return n(u,a);if(f in e)return n(void 0,u)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken: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,a,f)=>s(Ie(u),Ie(a),f,!0)};return l.forEach(Object.keys({...e,...t}),function(a){const f=p[a]||s,m=f(e[a],t[a],a);l.isUndefined(m)&&f!==c||(r[a]=m)}),r}const yt=e=>{const t=q({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=L.from(i),t.url=ft(Et(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),l.isFormData(r)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(l.isFunction(r.getHeaders)){const p=r.getHeaders(),u=["content-type","content-length"];Object.entries(p).forEach(([a,f])=>{u.includes(a.toLowerCase())&&i.set(a,f)})}}if(C.hasStandardBrowserEnv&&(n&&l.isFunction(n)&&(n=n(t)),n||n!==!1&&Wr(t.url))){const p=s&&o&&Gr.read(o);p&&i.set(s,p)}return t},Zr=typeof XMLHttpRequest<"u",Yr=Zr&&function(e){return new Promise(function(r,n){const s=yt(e);let o=s.data;const i=L.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:u}=s,a,f,m,g,d;function E(){g&&g(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(a),s.signal&&s.signal.removeEventListener("abort",a)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function y(){if(!h)return;const S=L.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:S,config:e,request:h};mt(function(v){r(v),E()},function(v){n(v),E()},A),h=null}"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(y)},h.onabort=function(){h&&(n(new w("Request aborted",w.ECONNABORTED,e,h)),h=null)},h.onerror=function(O){const A=O&&O.message?O.message:"Network Error",N=new w(A,w.ERR_NETWORK,e,h);N.event=O||null,n(N),h=null},h.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||dt;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),n(new w(O,A.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&l.forEach(i.toJSON(),function(O,A){h.setRequestHeader(A,O)}),l.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([m,d]=ce(u,!0),h.addEventListener("progress",m)),p&&h.upload&&([f,g]=ce(p),h.upload.addEventListener("progress",f),h.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(a=S=>{h&&(n(!S||S.type?new V(null,e,h):S),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(a),s.signal&&(s.signal.aborted?a():s.signal.addEventListener("abort",a)));const b=Jr(s.url);if(b&&C.protocols.indexOf(b)===-1){n(new w("Unsupported protocol "+b+":",w.ERR_BAD_REQUEST,e));return}h.send(o||null)})},en=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(u){if(!s){s=!0,c();const a=u instanceof Error?u:this.reason;n.abort(a instanceof w?a:new V(a instanceof Error?a.message:a))}};let i=t&&setTimeout(()=>{i=null,o(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:p}=n;return p.unsubscribe=()=>l.asap(c),p}},tn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},rn=async function*(e,t){for await(const r of nn(e))yield*tn(r,t)},nn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$e=(e,t,r,n)=>{const s=rn(e,t);let o=0,i,c=p=>{i||(i=!0,n&&n(p))};return new ReadableStream({async pull(p){try{const{done:u,value:a}=await s.next();if(u){c(),p.close();return}let f=a.byteLength;if(r){let m=o+=f;r(m)}p.enqueue(new Uint8Array(a))}catch(u){throw c(u),u}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},ze=64*1024,{isFunction:se}=l,sn=(({Request:e,Response:t})=>({Request:e,Response:t}))(l.global),{ReadableStream:Je,TextEncoder:Ke}=l.global,Ve=(e,...t)=>{try{return!!e(...t)}catch{return!1}},on=e=>{e=l.merge.call({skipUndefined:!0},sn,e);const{fetch:t,Request:r,Response:n}=e,s=t?se(t):typeof fetch=="function",o=se(r),i=se(n);if(!s)return!1;const c=s&&se(Je),p=s&&(typeof Ke=="function"?(d=>E=>d.encode(E))(new Ke):async d=>new Uint8Array(await new r(d).arrayBuffer())),u=o&&c&&Ve(()=>{let d=!1;const E=new r(C.origin,{body:new Je,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!E}),a=i&&c&&Ve(()=>l.isReadableStream(new n("").body)),f={stream:a&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(E,h)=>{let y=E&&E[d];if(y)return y.call(E);throw new w(`Response type '${d}' is not supported`,w.ERR_NOT_SUPPORT,h)})});const m=async d=>{if(d==null)return 0;if(l.isBlob(d))return d.size;if(l.isSpecCompliantForm(d))return(await new r(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(l.isArrayBufferView(d)||l.isArrayBuffer(d))return d.byteLength;if(l.isURLSearchParams(d)&&(d=d+""),l.isString(d))return(await p(d)).byteLength},g=async(d,E)=>{const h=l.toFiniteNumber(d.getContentLength());return h??m(E)};return async d=>{let{url:E,method:h,data:y,signal:b,cancelToken:S,timeout:O,onDownloadProgress:A,onUploadProgress:N,responseType:v,headers:he,withCredentials:te="same-origin",fetchOptions:Le}=yt(d),Pe=t||fetch;v=v?(v+"").toLowerCase():"text";let re=en([b,S&&S.toAbortSignal()],O),G=null;const _=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let Ne;try{if(N&&u&&h!=="get"&&h!=="head"&&(Ne=await g(he,y))!==0){let D=new r(E,{method:"POST",body:y,duplex:"half"}),$;if(l.isFormData(y)&&($=D.headers.get("content-type"))&&he.setContentType($),D.body){const[me,ne]=qe(Ne,ce(je(N)));y=$e(D.body,ze,me,ne)}}l.isString(te)||(te=te?"include":"omit");const U=o&&"credentials"in r.prototype,Fe={...Le,signal:re,method:h.toUpperCase(),headers:he.normalize().toJSON(),body:y,duplex:"half",credentials:U?te:void 0};G=o&&new r(E,Fe);let k=await(o?Pe(G,Le):Pe(E,Fe));const Ue=a&&(v==="stream"||v==="response");if(a&&(A||Ue&&_)){const D={};["status","statusText","headers"].forEach(Be=>{D[Be]=k[Be]});const $=l.toFiniteNumber(k.headers.get("content-length")),[me,ne]=A&&qe($,ce(je(A),!0))||[];k=new n($e(k.body,ze,me,()=>{ne&&ne(),_&&_()}),D)}v=v||"text";let Pt=await f[l.findKey(f,v)||"text"](k,d);return!Ue&&_&&_(),await new Promise((D,$)=>{mt(D,$,{data:Pt,headers:L.from(k.headers),status:k.status,statusText:k.statusText,config:d,request:G})})}catch(U){throw _&&_(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,d,G),{cause:U.cause||U}):w.from(U,U&&U.code,d,G)}}},an=new Map,gt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,c=i,p,u,a=an;for(;c--;)p=o[c],u=a.get(p),u===void 0&&a.set(p,u=c?new Map:on(t)),a=u;return u};gt();const ve={http:Tr,xhr:Yr,fetch:{get:gt}};l.forEach(ve,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const We=e=>`- ${e}`,cn=e=>l.isFunction(e)||e===null||e===!1;function un(e,t){e=l.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let c;if(s=n,!cn(n)&&(s=ve[(c=String(n)).toLowerCase()],s===void 0))throw new w(`Unknown adapter '${c}'`);if(s&&(l.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([p,u])=>`adapter ${p} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since :
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./chunks/services.helper.DolZWkEs.js"),z=require("react"),Xe=require("react/jsx-runtime"),Ze=require("@tanstack/react-query"),R=require("./errors.cjs.js"),Nt=e=>({...t})=>e(t),Ft=({useAdapter:e,LoggerService:t})=>W("ERROR_SERVICE",Nt(e),[t.ServiceProvider]),Ut=()=>({LoggerService:e})=>{const t=I(e),r=z.useRef({}),n=(c,h)=>{const u=r.current;r.current={...u,[c]:[...u[c]||[],h]}},s=(c,h)=>{const u=r.current;r.current={...u,[c]:u[c].filter(a=>a!==h)}};return{raiseError:c=>{var h;t.error(c),(h=r.current[c.code])==null||h.forEach(u=>u(c))},useErrorHandler:(c,h)=>{const u=P.compilerRuntimeExports.c(4);let a,f;u[0]!==h||u[1]!==c?(a=()=>(n(c,h),()=>{s(c,h)}),f=[c,h],u[0]=h,u[1]=c,u[2]=a,u[3]=f):(a=u[2],f=u[3]),z.useEffect(a,f)}}},Bt=({HttpService:e,ErrorService:t})=>()=>{const r=I(t),n=I(e),s=u=>{const{details:a,message:f}=u,m=a!=null&&a.body&&typeof a.body=="object"&&"errors"in a.body&&a.body.errors instanceof Array?a.body.errors:[];if(m.length===0)return r.raiseError(u),u;if(m.find(p=>{var y;return((y=p.extensions)==null?void 0:y.code)===R.GraphQLErrors.AuthenticationError||p.message.toLowerCase().includes("authorization")})){const p=new R.HttpServiceError({code:R.HttpServiceErrorCode.Unauthorized,details:a,message:f});return r.raiseError(p),p}const d=typeof m[0]=="string"?m[0]:null,E=new R.HttpServiceError({code:R.HttpServiceErrorCode.Generic,details:a,message:f+(d?` (${d})`:"")});return r.raiseError(E),E},o=u=>{const{details:a,message:f}=u,m=new R.HttpServiceError({code:R.HttpServiceErrorCode.Unauthorized,details:a,message:f});return r.raiseError(m),m},i=u=>{const a=u.find(g=>{var d;return((d=g==null?void 0:g.extensions)==null?void 0:d.code)===R.GraphQLErrors.AuthenticationError});if(a)return o(a);const f=typeof u[0]=="string"?u[0]:"Unknown error.",m=new R.GraphQLServiceError({code:R.GraphQLServiceErrorCode.Generic,message:f});return r.raiseError(m),m},c=u=>{if("errors"in u&&u.errors instanceof Array&&u.errors.length>0)return i(u.errors);if(!u.data){const f=new R.GraphQLServiceError({code:R.GraphQLServiceErrorCode.Generic,message:"Response is missing 'data' attribute."});return r.raiseError(f),f}return u.data};return{execute:async u=>{const a=Array.isArray(u.url)?P.buildUrl(u.url):u.url;try{const f=await n.post({body:{query:u.query,variables:u.variables},headers:u.headers,url:a});if(!f)return{};const m=c(f.body);if(m instanceof R.BaseError)throw m;return m}catch(f){throw f instanceof R.HttpServiceError?s(f):f instanceof R.BaseError?f:new Error("Could not handle error")}}}},kt=({HttpService:e,ErrorService:t})=>W("GRAPHQL_SERVICE",Bt({ErrorService:t,HttpService:e}),[e.ServiceProvider,t.ServiceProvider]),Dt=e=>({ErrorService:t,LoggerService:r})=>{const n=e(),s=I(r),o=I(t),i=y=>{const w=P.lodashExports.omitBy(y,P.lodashExports.isNil);s.info(`HTTP request: ${JSON.stringify(w)}`)},c=y=>{const{body:w,status:S}=y;s.info(`HTTP response: ${JSON.stringify({body:w,status:S})}`)},h=y=>y>=400&&y<600,u=y=>{const{details:w,message:S}=y;return o.raiseError(new R.HttpServiceError({code:R.HttpServiceErrorCode.Unauthorized,details:w,message:S}))},a=y=>{const{status:w}=y.details||{};if(!w||w>=500){const S=JSON.stringify(y);s.error(S)}else{if(w===401)return u(y);s.warn(y)}return o.raiseError(y)},f=async(y,w,S={})=>{i({method:y,...w});let O,A;const N=v=>{if(v instanceof R.HttpServiceError){A=v;return}O=v};switch(y){case"GET":{N(await n.get(w,S));break}case"DELETE":{N(await n.delete(w,S));break}case"PATCH":{N(await n.patch(w,S));break}case"POST":{N(await n.post(w,S));break}case"PUT":{N(await n.put(w,S));break}default:throw Error(`Unknown method HTTP method '${y}'`)}if(A)throw a(A),A;return O?(c(O),h(O.status)&&a(new R.HttpServiceError({details:{body:JSON.stringify(O.body),method:y,status:O.status,url:w.url}})),O):void 0};return{delete:(y,w={})=>f("DELETE",y,w),get:(y,w={})=>f("GET",y,w),patch:(y,w={})=>f("PATCH",y,w),post:async(y,w={})=>await f("POST",y,w),put:(y,w={})=>f("PUT",y,w)}},_t=({useAdapter:e,ErrorService:t,LoggerService:r})=>W("HTTP_SERVICE",Dt(e),[t.ServiceProvider,r.ServiceProvider]);function Ye(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ht}=Object.prototype,{getPrototypeOf:Te}=Object,{iterator:ue,toStringTag:et}=Symbol,le=(e=>t=>{const r=Ht.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),F=e=>(e=e.toLowerCase(),t=>le(t)===e),fe=e=>t=>typeof t===e,{isArray:V}=Array,J=fe("undefined");function X(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tt=F("ArrayBuffer");function Mt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tt(e.buffer),t}const qt=fe("string"),x=fe("function"),rt=fe("number"),Z=e=>e!==null&&typeof e=="object",jt=e=>e===!0||e===!1,oe=e=>{if(le(e)!=="object")return!1;const t=Te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(et in e)&&!(ue in e)},It=e=>{if(!Z(e)||X(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$t=F("Date"),zt=F("File"),Jt=F("Blob"),Vt=F("FileList"),Kt=e=>Z(e)&&x(e.pipe),Wt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=le(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},Gt=F("URLSearchParams"),[Qt,Xt,Zt,Yt]=["ReadableStream","Request","Response","Headers"].map(F),er=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Y(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),V(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(X(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(n=0;n<i;n++)c=o[n],t.call(null,e[c],c,e)}}function nt(e,t){if(X(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,st=e=>!J(e)&&e!==H;function be(){const{caseless:e,skipUndefined:t}=st(this)&&this||{},r={},n=(s,o)=>{const i=e&&nt(r,o)||o;oe(r[i])&&oe(s)?r[i]=be(r[i],s):oe(s)?r[i]=be({},s):V(s)?r[i]=s.slice():(!t||!J(s))&&(r[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Y(arguments[s],n);return r}const tr=(e,t,r,{allOwnKeys:n}={})=>(Y(t,(s,o)=>{r&&x(s)?e[o]=Ye(s,r):e[o]=s},{allOwnKeys:n}),e),rr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},sr=(e,t,r,n)=>{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],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&Te(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},or=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},ir=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!rt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ar=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Te(Uint8Array)),cr=(e,t)=>{const n=(e&&e[ue]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},ur=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},lr=F("HTMLFormElement"),fr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),ke=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),dr=F("RegExp"),ot=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Y(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},hr=e=>{ot(e,(t,r)=>{if(x(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(x(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},pr=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return V(e)?n(e):n(String(e).split(t)),r},mr=()=>{},Er=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function yr(e){return!!(e&&x(e.append)&&e[et]==="FormData"&&e[ue])}const gr=e=>{const t=new Array(10),r=(n,s)=>{if(Z(n)){if(t.indexOf(n)>=0)return;if(X(n))return n;if(!("toJSON"in n)){t[s]=n;const o=V(n)?[]:{};return Y(n,(i,c)=>{const h=r(i,s+1);!J(h)&&(o[c]=h)}),t[s]=void 0,o}}return n};return r(e,0)},br=F("AsyncFunction"),wr=e=>e&&(Z(e)||x(e))&&x(e.then)&&x(e.catch),it=((e,t)=>e?setImmediate:t?((r,n)=>(H.addEventListener("message",({source:s,data:o})=>{s===H&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),H.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x(H.postMessage)),Sr=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||it,Rr=e=>e!=null&&x(e[ue]),l={isArray:V,isArrayBuffer:tt,isBuffer:X,isFormData:Wt,isArrayBufferView:Mt,isString:qt,isNumber:rt,isBoolean:jt,isObject:Z,isPlainObject:oe,isEmptyObject:It,isReadableStream:Qt,isRequest:Xt,isResponse:Zt,isHeaders:Yt,isUndefined:J,isDate:$t,isFile:zt,isBlob:Jt,isRegExp:dr,isFunction:x,isStream:Kt,isURLSearchParams:Gt,isTypedArray:ar,isFileList:Vt,forEach:Y,merge:be,extend:tr,trim:er,stripBOM:rr,inherits:nr,toFlatObject:sr,kindOf:le,kindOfTest:F,endsWith:or,toArray:ir,forEachEntry:cr,matchAll:ur,isHTMLForm:lr,hasOwnProperty:ke,hasOwnProp:ke,reduceDescriptors:ot,freezeMethods:hr,toObjectSet:pr,toCamelCase:fr,noop:mr,toFiniteNumber:Er,findKey:nt,global:H,isContextDefined:st,isSpecCompliantForm:yr,toJSONObject:gr,isAsyncFn:br,isThenable:wr,setImmediate:it,asap:Sr,isIterable:Rr};function b(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}l.inherits(b,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:l.toJSONObject(this.config),code:this.code,status:this.status}}});const at=b.prototype,ct={};["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=>{ct[e]={value:e}});Object.defineProperties(b,ct);Object.defineProperty(at,"isAxiosError",{value:!0});b.from=(e,t,r,n,s,o)=>{const i=Object.create(at);l.toFlatObject(e,i,function(a){return a!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return b.call(i,c,h,r,n,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const Tr=null;function we(e){return l.isPlainObject(e)||l.isArray(e)}function ut(e){return l.endsWith(e,"[]")?e.slice(0,-2):e}function De(e,t,r){return e?e.concat(t).map(function(s,o){return s=ut(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function Or(e){return l.isArray(e)&&!e.some(we)}const Ar=l.toFlatObject(l,{},null,function(t){return/^is[A-Z]/.test(t)});function de(e,t,r){if(!l.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=l.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,p){return!l.isUndefined(p[E])});const n=r.metaTokens,s=r.visitor||a,o=r.dots,i=r.indexes,h=(r.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(t);if(!l.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(l.isDate(d))return d.toISOString();if(l.isBoolean(d))return d.toString();if(!h&&l.isBlob(d))throw new b("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(d)||l.isTypedArray(d)?h&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function a(d,E,p){let y=d;if(d&&!p&&typeof d=="object"){if(l.endsWith(E,"{}"))E=n?E:E.slice(0,-2),d=JSON.stringify(d);else if(l.isArray(d)&&Or(d)||(l.isFileList(d)||l.endsWith(E,"[]"))&&(y=l.toArray(d)))return E=ut(E),y.forEach(function(S,O){!(l.isUndefined(S)||S===null)&&t.append(i===!0?De([E],O,o):i===null?E:E+"[]",u(S))}),!1}return we(d)?!0:(t.append(De(p,E,o),u(d)),!1)}const f=[],m=Object.assign(Ar,{defaultVisitor:a,convertValue:u,isVisitable:we});function g(d,E){if(!l.isUndefined(d)){if(f.indexOf(d)!==-1)throw Error("Circular reference detected in "+E.join("."));f.push(d),l.forEach(d,function(y,w){(!(l.isUndefined(y)||y===null)&&s.call(t,y,l.isString(w)?w.trim():w,E,m))===!0&&g(y,E?E.concat(w):[w])}),f.pop()}}if(!l.isObject(e))throw new TypeError("data must be an object");return g(e),t}function _e(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Oe(e,t){this._pairs=[],e&&de(e,this,t)}const lt=Oe.prototype;lt.append=function(t,r){this._pairs.push([t,r])};lt.toString=function(t){const r=t?function(n){return t.call(this,n,_e)}:_e;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function vr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ft(e,t,r){if(!t)return e;const n=r&&r.encode||vr;l.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(s?o=s(t,r):o=l.isURLSearchParams(t)?t.toString():new Oe(t,r).toString(n),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class He{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){l.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cr=typeof URLSearchParams<"u"?URLSearchParams:Oe,xr=typeof FormData<"u"?FormData:null,Lr=typeof Blob<"u"?Blob:null,Pr={isBrowser:!0,classes:{URLSearchParams:Cr,FormData:xr,Blob:Lr},protocols:["http","https","file","blob","url","data"]},Ae=typeof window<"u"&&typeof document<"u",Se=typeof navigator=="object"&&navigator||void 0,Nr=Ae&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),Fr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ur=Ae&&window.location.href||"http://localhost",Br=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ae,hasStandardBrowserEnv:Nr,hasStandardBrowserWebWorkerEnv:Fr,navigator:Se,origin:Ur},Symbol.toStringTag,{value:"Module"})),C={...Br,...Pr};function kr(e,t){return de(e,new C.classes.URLSearchParams,{visitor:function(r,n,s,o){return C.isNode&&l.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Dr(e){return l.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _r(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function ht(e){function t(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),h=o>=r.length;return i=!i&&l.isArray(s)?s.length:i,h?(l.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!c):((!s[i]||!l.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&l.isArray(s[i])&&(s[i]=_r(s[i])),!c)}if(l.isFormData(e)&&l.isFunction(e.entries)){const r={};return l.forEachEntry(e,(n,s)=>{t(Dr(n),s,r,0)}),r}return null}function Hr(e,t,r){if(l.isString(e))try{return(t||JSON.parse)(e),l.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ee={transitional:dt,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=l.isObject(t);if(o&&l.isHTMLForm(t)&&(t=new FormData(t)),l.isFormData(t))return s?JSON.stringify(ht(t)):t;if(l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t)||l.isReadableStream(t))return t;if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return kr(t,this.formSerializer).toString();if((c=l.isFileList(t))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return de(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),Hr(t)):t}],transformResponse:[function(t){const r=this.transitional||ee.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(l.isResponse(t)||l.isReadableStream(t))return t;if(t&&l.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?b.from(c,b.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:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const Mr=l.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"]),qr=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&Mr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Me=Symbol("internals");function Q(e){return e&&String(e).trim().toLowerCase()}function ie(e){return e===!1||e==null?e:l.isArray(e)?e.map(ie):String(e)}function jr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Ir=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ee(e,t,r,n,s){if(l.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!l.isString(t)){if(l.isString(n))return t.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(t)}}function $r(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function zr(e,t){const r=l.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}let L=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(c,h,u){const a=Q(h);if(!a)throw new Error("header name must be a non-empty string");const f=l.findKey(s,a);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||h]=ie(c))}const i=(c,h)=>l.forEach(c,(u,a)=>o(u,a,h));if(l.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(l.isString(t)&&(t=t.trim())&&!Ir(t))i(qr(t),r);else if(l.isObject(t)&&l.isIterable(t)){let c={},h,u;for(const a of t){if(!l.isArray(a))throw TypeError("Object iterator must return a key-value pair");c[u=a[0]]=(h=c[u])?l.isArray(h)?[...h,a[1]]:[h,a[1]]:a[1]}i(c,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=Q(t),t){const n=l.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return jr(s);if(l.isFunction(r))return r.call(this,s,n);if(l.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Q(t),t){const n=l.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ee(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(i){if(i=Q(i),i){const c=l.findKey(n,i);c&&(!r||Ee(n,n[c],c,r))&&(delete n[c],s=!0)}}return l.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||Ee(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return l.forEach(this,(s,o)=>{const i=l.findKey(n,o);if(i){r[i]=ie(s),delete r[o];return}const c=t?$r(o):String(o).trim();c!==o&&delete r[o],r[c]=ie(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return l.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&l.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Me]=this[Me]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=Q(i);n[c]||(zr(s,i),n[c]=!0)}return l.isArray(t)?t.forEach(o):o(t),this}};L.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);l.reduceDescriptors(L.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});l.freezeMethods(L);function ye(e,t){const r=this||ee,n=t||r,s=L.from(n.headers);let o=n.data;return l.forEach(e,function(c){o=c.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function pt(e){return!!(e&&e.__CANCEL__)}function K(e,t,r){b.call(this,e??"canceled",b.ERR_CANCELED,t,r),this.name="CanceledError"}l.inherits(K,b,{__CANCEL__:!0});function mt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new b("Request failed with status code "+r.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Jr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(h){const u=Date.now(),a=n[o];i||(i=u),r[s]=h,n[s]=u;let f=o,m=0;for(;f!==s;)m+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const g=a&&u-a;return g?Math.round(m*1e3/g):void 0}}function Kr(e,t){let r=0,n=1e3/t,s,o;const i=(u,a=Date.now())=>{r=a,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const a=Date.now(),f=a-r;f>=n?i(u,a):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},n-f)))},()=>s&&i(s)]}const ce=(e,t,r=3)=>{let n=0;const s=Vr(50,250);return Kr(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,h=i-n,u=s(h),a=i<=c;n=i;const f={loaded:i,total:c,progress:c?i/c:void 0,bytes:h,rate:u||void 0,estimated:u&&c&&a?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(f)},r)},qe=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},je=e=>(...t)=>l.asap(()=>e(...t)),Wr=C.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,C.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Gr=C.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];l.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),l.isString(n)&&c.push(`path=${n}`),l.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),l.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Qr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Xr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Et(e,t,r){let n=!Qr(t);return e&&(n||r==!1)?Xr(e,t):t}const Ie=e=>e instanceof L?{...e}:e;function q(e,t){t=t||{};const r={};function n(u,a,f,m){return l.isPlainObject(u)&&l.isPlainObject(a)?l.merge.call({caseless:m},u,a):l.isPlainObject(a)?l.merge({},a):l.isArray(a)?a.slice():a}function s(u,a,f,m){if(l.isUndefined(a)){if(!l.isUndefined(u))return n(void 0,u,f,m)}else return n(u,a,f,m)}function o(u,a){if(!l.isUndefined(a))return n(void 0,a)}function i(u,a){if(l.isUndefined(a)){if(!l.isUndefined(u))return n(void 0,u)}else return n(void 0,a)}function c(u,a,f){if(f in t)return n(u,a);if(f in e)return n(void 0,u)}const h={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken: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,a,f)=>s(Ie(u),Ie(a),f,!0)};return l.forEach(Object.keys({...e,...t}),function(a){const f=h[a]||s,m=f(e[a],t[a],a);l.isUndefined(m)&&f!==c||(r[a]=m)}),r}const yt=e=>{const t=q({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=L.from(i),t.url=ft(Et(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),l.isFormData(r)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(l.isFunction(r.getHeaders)){const h=r.getHeaders(),u=["content-type","content-length"];Object.entries(h).forEach(([a,f])=>{u.includes(a.toLowerCase())&&i.set(a,f)})}}if(C.hasStandardBrowserEnv&&(n&&l.isFunction(n)&&(n=n(t)),n||n!==!1&&Wr(t.url))){const h=s&&o&&Gr.read(o);h&&i.set(s,h)}return t},Zr=typeof XMLHttpRequest<"u",Yr=Zr&&function(e){return new Promise(function(r,n){const s=yt(e);let o=s.data;const i=L.from(s.headers).normalize();let{responseType:c,onUploadProgress:h,onDownloadProgress:u}=s,a,f,m,g,d;function E(){g&&g(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(a),s.signal&&s.signal.removeEventListener("abort",a)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function y(){if(!p)return;const S=L.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};mt(function(v){r(v),E()},function(v){n(v),E()},A),p=null}"onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(y)},p.onabort=function(){p&&(n(new b("Request aborted",b.ECONNABORTED,e,p)),p=null)},p.onerror=function(O){const A=O&&O.message?O.message:"Network Error",N=new b(A,b.ERR_NETWORK,e,p);N.event=O||null,n(N),p=null},p.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||dt;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),n(new b(O,A.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&l.forEach(i.toJSON(),function(O,A){p.setRequestHeader(A,O)}),l.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([m,d]=ce(u,!0),p.addEventListener("progress",m)),h&&p.upload&&([f,g]=ce(h),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(a=S=>{p&&(n(!S||S.type?new K(null,e,p):S),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(a),s.signal&&(s.signal.aborted?a():s.signal.addEventListener("abort",a)));const w=Jr(s.url);if(w&&C.protocols.indexOf(w)===-1){n(new b("Unsupported protocol "+w+":",b.ERR_BAD_REQUEST,e));return}p.send(o||null)})},en=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(u){if(!s){s=!0,c();const a=u instanceof Error?u:this.reason;n.abort(a instanceof b?a:new K(a instanceof Error?a.message:a))}};let i=t&&setTimeout(()=>{i=null,o(new b(`timeout ${t} of ms exceeded`,b.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:h}=n;return h.unsubscribe=()=>l.asap(c),h}},tn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},rn=async function*(e,t){for await(const r of nn(e))yield*tn(r,t)},nn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$e=(e,t,r,n)=>{const s=rn(e,t);let o=0,i,c=h=>{i||(i=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:u,value:a}=await s.next();if(u){c(),h.close();return}let f=a.byteLength;if(r){let m=o+=f;r(m)}h.enqueue(new Uint8Array(a))}catch(u){throw c(u),u}},cancel(h){return c(h),s.return()}},{highWaterMark:2})},ze=64*1024,{isFunction:se}=l,sn=(({Request:e,Response:t})=>({Request:e,Response:t}))(l.global),{ReadableStream:Je,TextEncoder:Ve}=l.global,Ke=(e,...t)=>{try{return!!e(...t)}catch{return!1}},on=e=>{e=l.merge.call({skipUndefined:!0},sn,e);const{fetch:t,Request:r,Response:n}=e,s=t?se(t):typeof fetch=="function",o=se(r),i=se(n);if(!s)return!1;const c=s&&se(Je),h=s&&(typeof Ve=="function"?(d=>E=>d.encode(E))(new Ve):async d=>new Uint8Array(await new r(d).arrayBuffer())),u=o&&c&&Ke(()=>{let d=!1;const E=new r(C.origin,{body:new Je,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!E}),a=i&&c&&Ke(()=>l.isReadableStream(new n("").body)),f={stream:a&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(E,p)=>{let y=E&&E[d];if(y)return y.call(E);throw new b(`Response type '${d}' is not supported`,b.ERR_NOT_SUPPORT,p)})});const m=async d=>{if(d==null)return 0;if(l.isBlob(d))return d.size;if(l.isSpecCompliantForm(d))return(await new r(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(l.isArrayBufferView(d)||l.isArrayBuffer(d))return d.byteLength;if(l.isURLSearchParams(d)&&(d=d+""),l.isString(d))return(await h(d)).byteLength},g=async(d,E)=>{const p=l.toFiniteNumber(d.getContentLength());return p??m(E)};return async d=>{let{url:E,method:p,data:y,signal:w,cancelToken:S,timeout:O,onDownloadProgress:A,onUploadProgress:N,responseType:v,headers:pe,withCredentials:te="same-origin",fetchOptions:Le}=yt(d),Pe=t||fetch;v=v?(v+"").toLowerCase():"text";let re=en([w,S&&S.toAbortSignal()],O),G=null;const _=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let Ne;try{if(N&&u&&p!=="get"&&p!=="head"&&(Ne=await g(pe,y))!==0){let D=new r(E,{method:"POST",body:y,duplex:"half"}),$;if(l.isFormData(y)&&($=D.headers.get("content-type"))&&pe.setContentType($),D.body){const[me,ne]=qe(Ne,ce(je(N)));y=$e(D.body,ze,me,ne)}}l.isString(te)||(te=te?"include":"omit");const U=o&&"credentials"in r.prototype,Fe={...Le,signal:re,method:p.toUpperCase(),headers:pe.normalize().toJSON(),body:y,duplex:"half",credentials:U?te:void 0};G=o&&new r(E,Fe);let k=await(o?Pe(G,Le):Pe(E,Fe));const Ue=a&&(v==="stream"||v==="response");if(a&&(A||Ue&&_)){const D={};["status","statusText","headers"].forEach(Be=>{D[Be]=k[Be]});const $=l.toFiniteNumber(k.headers.get("content-length")),[me,ne]=A&&qe($,ce(je(A),!0))||[];k=new n($e(k.body,ze,me,()=>{ne&&ne(),_&&_()}),D)}v=v||"text";let Pt=await f[l.findKey(f,v)||"text"](k,d);return!Ue&&_&&_(),await new Promise((D,$)=>{mt(D,$,{data:Pt,headers:L.from(k.headers),status:k.status,statusText:k.statusText,config:d,request:G})})}catch(U){throw _&&_(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,d,G),{cause:U.cause||U}):b.from(U,U&&U.code,d,G)}}},an=new Map,gt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,c=i,h,u,a=an;for(;c--;)h=o[c],u=a.get(h),u===void 0&&a.set(h,u=c?new Map:on(t)),a=u;return u};gt();const ve={http:Tr,xhr:Yr,fetch:{get:gt}};l.forEach(ve,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const We=e=>`- ${e}`,cn=e=>l.isFunction(e)||e===null||e===!1;function un(e,t){e=l.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let c;if(s=n,!cn(n)&&(s=ve[(c=String(n)).toLowerCase()],s===void 0))throw new b(`Unknown adapter '${c}'`);if(s&&(l.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([h,u])=>`adapter ${h} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since :
|
|
4
4
|
`+i.map(We).join(`
|
|
5
|
-
`):" "+We(i[0]):"as no adapter specified";throw new
|
|
6
|
-
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=q(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&ae.assertOptions(n,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1),s!=null&&(l.isFunction(s)?r.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:B.function,serialize:B.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ae.assertOptions(r,{baseUrl:B.spelling("baseURL"),withXsrfToken:B.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&l.merge(o.common,o[r.method]);o&&l.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),r.headers=L.concat(i,o);const c=[];let
|
|
5
|
+
`):" "+We(i[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const bt={getAdapter:un,adapters:ve};function ge(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new K(null,e)}function Ge(e){return ge(e),e.headers=L.from(e.headers),e.data=ye.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bt.getAdapter(e.adapter||ee.adapter,e)(e).then(function(n){return ge(e),n.data=ye.call(e,e.transformResponse,n),n.headers=L.from(n.headers),n},function(n){return pt(n)||(ge(e),n&&n.response&&(n.response.data=ye.call(e,e.transformResponse,n.response),n.response.headers=L.from(n.response.headers))),Promise.reject(n)})}const wt="1.13.2",he={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{he[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Qe={};he.transitional=function(t,r,n){function s(o,i){return"[Axios v"+wt+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,c)=>{if(t===!1)throw new b(s(i," has been removed"+(r?" in "+r:"")),b.ERR_DEPRECATED);return r&&!Qe[i]&&(Qe[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,c):!0}};he.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function ln(e,t,r){if(typeof e!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const c=e[o],h=c===void 0||i(c,o,e);if(h!==!0)throw new b("option "+o+" must be "+h,b.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const ae={assertOptions:ln,validators:he},B=ae.validators;let M=class{constructor(t){this.defaults=t||{},this.interceptors={request:new He,response:new He}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=q(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&ae.assertOptions(n,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1),s!=null&&(l.isFunction(s)?r.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:B.function,serialize:B.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ae.assertOptions(r,{baseUrl:B.spelling("baseURL"),withXsrfToken:B.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&l.merge(o.common,o[r.method]);o&&l.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),r.headers=L.concat(i,o);const c=[];let h=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(r)===!1||(h=h&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const u=[];this.interceptors.response.forEach(function(E){u.push(E.fulfilled,E.rejected)});let a,f=0,m;if(!h){const d=[Ge.bind(this),void 0];for(d.unshift(...c),d.push(...u),m=d.length,a=Promise.resolve(r);f<m;)a=a.then(d[f++],d[f++]);return a}m=c.length;let g=r;for(;f<m;){const d=c[f++],E=c[f++];try{g=d(g)}catch(p){E.call(this,p);break}}try{a=Ge.call(this,g)}catch(d){return Promise.reject(d)}for(f=0,m=u.length;f<m;)a=a.then(u[f++],u[f++]);return a}getUri(t){t=q(this.defaults,t);const r=Et(t.baseURL,t.url,t.allowAbsoluteUrls);return ft(r,t.params,t.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(t){M.prototype[t]=function(r,n){return this.request(q(n||{},{method:t,url:r,data:(n||{}).data}))}});l.forEach(["post","put","patch"],function(t){function r(n){return function(o,i,c){return this.request(q(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}M.prototype[t]=r(),M.prototype[t+"Form"]=r(!0)});let fn=class St{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{n.subscribe(c),o=c}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,c){n.reason||(n.reason=new K(o,i,c),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new St(function(s){t=s}),cancel:t}}};function dn(e){return function(r){return e.apply(null,r)}}function hn(e){return l.isObject(e)&&e.isAxiosError===!0}const Re={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Re).forEach(([e,t])=>{Re[t]=e});function Rt(e){const t=new M(e),r=Ye(M.prototype.request,t);return l.extend(r,M.prototype,t,{allOwnKeys:!0}),l.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Rt(q(e,s))},r}const T=Rt(ee);T.Axios=M;T.CanceledError=K;T.CancelToken=fn;T.isCancel=pt;T.VERSION=wt;T.toFormData=de;T.AxiosError=b;T.Cancel=T.CanceledError;T.all=function(t){return Promise.all(t)};T.spread=dn;T.isAxiosError=hn;T.mergeConfig=q;T.AxiosHeaders=L;T.formToJSON=e=>ht(l.isHTMLForm(e)?new FormData(e):e);T.getAdapter=bt.getAdapter;T.HttpStatusCode=Re;T.default=T;const{Axios:$n,AxiosError:pn,CanceledError:zn,isCancel:Jn,CancelToken:Vn,VERSION:Kn,all:Wn,Cancel:Gn,isAxiosError:mn,spread:Qn,toFormData:Xn,AxiosHeaders:Zn,HttpStatusCode:Yn,formToJSON:es,getAdapter:ts,mergeConfig:rs}=T,En=e=>({PATCH:T.patch,POST:T.post,PUT:T.put})[e],yn=e=>({DELETE:T.delete,GET:T.get})[e],gn=e=>{const{data:t,headers:r,status:n}=e;return{body:t,header:r,status:n}},bn=e=>{if(!mn(e))return new R.HttpServiceError({message:"An unknown error occurred"});const{message:t,response:r}=e;if(!r)return new R.HttpServiceError({message:t});const{config:{url:n,method:s},status:o,data:i}=r,c={method:s,status:o,url:n};if(!i)return new R.HttpServiceError({details:c,message:t});try{return new R.HttpServiceError({details:{...c,body:i},message:t})}catch{return new R.HttpServiceError({details:c,message:t})}},Tt=async e=>{try{const t=await e;return gn(t)}catch(t){return t instanceof pn?bn(t):new R.HttpServiceError({code:R.HttpServiceErrorCode.Generic,message:"An unknown error occurred"})}},Ot=(e,{headers:t={},query:r={},timeout:n,url:s},o)=>{const i=yn(e),c={headers:t},h=P.addQueryParams(s,r);return o.buffer&&(c.responseType="arraybuffer"),n&&(c.timeout=n),Tt(i(h,c))},Ce=(e,{headers:t={},body:r=null,query:n={},timeout:s,url:o,attachments:i},c)=>{const h=En(e),u=i&&i.length>0,a=new FormData,f=u?a:r,m={headers:t},g=P.addQueryParams(o,n);return u&&i.forEach(d=>{a.append(d.name,d.filePath)}),c.buffer&&(m.responseType="arraybuffer"),s&&(m.timeout=s),Tt(h(g,f,m))},wn=(e,t)=>Ot("DELETE",e,t),Sn=(e,t)=>Ot("GET",e,t),Rn=(e,t)=>Ce("PATCH",e,t),Tn=(e,t)=>Ce("POST",e,t),On=(e,t)=>Ce("PUT",e,t),An=()=>()=>({delete:wn,get:Sn,patch:Rn,post:Tn,put:On}),At=e=>()=>e(),vn=({useAdapter:e})=>W("LOGGER_SERVICE",At(e),[]);var vt={exports:{}};/*!
|
|
7
7
|
* js-logger - http://github.com/jonnyreeves/js-logger
|
|
8
8
|
* Jonny Reeves, http://jonnyreeves.co.uk/
|
|
9
9
|
* js-logger may be freely distributed under the MIT license.
|
|
10
|
-
*/(function(e){(function(t){var r={};r.VERSION="1.6.1";var n,s={},o=function(a,f){return function(){return f.apply(a,arguments)}},i=function(){var a=arguments,f=a[0],m,g;for(g=1;g<a.length;g++)for(m in a[g])!(m in f)&&a[g].hasOwnProperty(m)&&(f[m]=a[g][m]);return f},c=function(a,f){return{value:a,name:f}};r.TRACE=c(1,"TRACE"),r.DEBUG=c(2,"DEBUG"),r.INFO=c(3,"INFO"),r.TIME=c(4,"TIME"),r.WARN=c(5,"WARN"),r.ERROR=c(8,"ERROR"),r.OFF=c(99,"OFF");var
|
|
10
|
+
*/(function(e){(function(t){var r={};r.VERSION="1.6.1";var n,s={},o=function(a,f){return function(){return f.apply(a,arguments)}},i=function(){var a=arguments,f=a[0],m,g;for(g=1;g<a.length;g++)for(m in a[g])!(m in f)&&a[g].hasOwnProperty(m)&&(f[m]=a[g][m]);return f},c=function(a,f){return{value:a,name:f}};r.TRACE=c(1,"TRACE"),r.DEBUG=c(2,"DEBUG"),r.INFO=c(3,"INFO"),r.TIME=c(4,"TIME"),r.WARN=c(5,"WARN"),r.ERROR=c(8,"ERROR"),r.OFF=c(99,"OFF");var h=function(a){this.context=a,this.setLevel(a.filterLevel),this.log=this.info};h.prototype={setLevel:function(a){a&&"value"in a&&(this.context.filterLevel=a)},getLevel:function(){return this.context.filterLevel},enabledFor:function(a){var f=this.context.filterLevel;return a.value>=f.value},trace:function(){this.invoke(r.TRACE,arguments)},debug:function(){this.invoke(r.DEBUG,arguments)},info:function(){this.invoke(r.INFO,arguments)},warn:function(){this.invoke(r.WARN,arguments)},error:function(){this.invoke(r.ERROR,arguments)},time:function(a){typeof a=="string"&&a.length>0&&this.invoke(r.TIME,[a,"start"])},timeEnd:function(a){typeof a=="string"&&a.length>0&&this.invoke(r.TIME,[a,"end"])},invoke:function(a,f){n&&this.enabledFor(a)&&n(f,i({level:a},this.context))}};var u=new h({filterLevel:r.OFF});(function(){var a=r;a.enabledFor=o(u,u.enabledFor),a.trace=o(u,u.trace),a.debug=o(u,u.debug),a.time=o(u,u.time),a.timeEnd=o(u,u.timeEnd),a.info=o(u,u.info),a.warn=o(u,u.warn),a.error=o(u,u.error),a.log=a.info})(),r.setHandler=function(a){n=a},r.setLevel=function(a){u.setLevel(a);for(var f in s)s.hasOwnProperty(f)&&s[f].setLevel(a)},r.getLevel=function(){return u.getLevel()},r.get=function(a){return s[a]||(s[a]=new h(i({name:a},u.context)))},r.createDefaultHandler=function(a){a=a||{},a.formatter=a.formatter||function(d,E){E.name&&d.unshift("["+E.name+"]")};var f={},m=function(g,d){Function.prototype.apply.call(g,console,d)};return typeof console>"u"?function(){}:function(g,d){g=Array.prototype.slice.call(g);var E=console.log,p;d.level===r.TIME?(p=(d.name?"["+d.name+"] ":"")+g[0],g[1]==="start"?console.time?console.time(p):f[p]=new Date().getTime():console.timeEnd?console.timeEnd(p):m(E,[p+": "+(new Date().getTime()-f[p])+"ms"])):(d.level===r.WARN&&console.warn?E=console.warn:d.level===r.ERROR&&console.error?E=console.error:d.level===r.INFO&&console.info?E=console.info:d.level===r.DEBUG&&console.debug?E=console.debug:d.level===r.TRACE&&console.trace&&(E=console.trace),a.formatter(g,d),m(E,g))}},r.useDefaults=function(a){r.setLevel(a&&a.defaultLevel||r.DEBUG),r.setHandler(r.createDefaultHandler(a))},r.setDefaults=r.useDefaults,e.exports?e.exports=r:(r._prevLogger=t.Logger,r.noConflict=function(){return t.Logger=r._prevLogger,r},t.Logger=r)})(P.commonjsGlobal)})(vt);var Cn=vt.exports;const j=P.getDefaultExportFromCjs(Cn),xe=e=>typeof e=="string"?e:e.stack||e.toString(),xn=e=>{j.debug("💡",e)},Ln=e=>{j.error("❌",xe(e))},Pn=e=>{j.error("❌",xe(e))},Nn=e=>{j.info("✅",xe(e))},Fn=e=>{j.warn("⚠️",e.toString())},Un=()=>()=>(z.useEffect(()=>{j.useDefaults({defaultLevel:j.INFO})},[]),{debug:xn,error:Ln,fatal:Pn,info:Nn,warn:Fn}),Bn=e=>({...t})=>({captureEvent:e(t).captureEvent}),kn=({useAdapter:e,HttpService:t})=>W("TRACKER_SERVICE",Bn(e),[t.ServiceProvider]),Dn=({getDistinctId:e,getTimestamp:t,getHeaders:r,transformProperties:n,config:s})=>({HttpService:o})=>{const i=I(o),c=()=>({Authorization:`Bearer ${s.apiKey}`,...r==null?void 0:r()}),h=f=>[s.host,f].filter(Boolean).join("/"),u=(f,m)=>i.post({body:m,headers:c(),url:h(f)});return{captureEvent:Lt("posthog-capture-event",async({event:f,properties:m})=>{const g=s.paths.event,d=e(f,m),E=t==null?void 0:t(f,m),p=n(f,m);await u(g,{api_key:s.apiKey,distinct_id:d,event:f,properties:p,timestamp:E})})}};var Ct=(e=>(e.MUTATION="mutation",e.QUERY="query",e))(Ct||{});const _n=()=>{const e=z.createContext(void 0);return{Provider:n=>{const s=P.compilerRuntimeExports.c(3),{children:o,value:i}=n;let c;return s[0]!==o||s[1]!==i?(c=Xe.jsx(e.Provider,{value:i,children:o}),s[0]=o,s[1]=i,s[2]=c):c=s[2],c},useContext:()=>{const n=z.useContext(e);if(n===void 0)throw new Error("Context is missing a provider");return n}}},xt=(e,t,r)=>{const n=r;return n.serviceMethodKey=t,n.serviceMethodType=e,n},Lt=(e,t)=>xt("mutation",e,t),Hn=(e,t)=>xt("query",e,t),W=(e,t,r)=>{const{useContext:n,Provider:s}=_n(),o=c=>{const h=P.compilerRuntimeExports.c(6);let u,a;h[0]!==c?({children:u,...a}=c,h[0]=c,h[1]=u,h[2]=a):(u=h[1],a=h[2]);const f=t(a);let m;return h[3]!==u||h[4]!==f?(m=Xe.jsx(s,{value:f,children:u}),h[3]=u,h[4]=f,h[5]=m):m=h[5],m};return o.serviceName=Symbol(e),o.serviceDependencies=r,{ServiceProvider:o,useService:n}},I=e=>e.useService(),Mn=(e,t)=>{const r=P.compilerRuntimeExports.c(7);let n;r[0]!==e||r[1]!==t.mutationKey?(n=P.buildSafeQueryKeys([e.serviceMethodKey,e,...t.mutationKey??[]]),r[0]=e,r[1]=t.mutationKey,r[2]=n):n=r[2];let s;return r[3]!==e||r[4]!==t||r[5]!==n?(s={...t,mutationFn:e,mutationKey:n},r[3]=e,r[4]=t,r[5]=n,r[6]=s):s=r[6],Ze.useMutation(s)},qn=(e,t)=>{const r=P.compilerRuntimeExports.c(14),[n,s]=z.useState("initialVariables"in t?t.initialVariables:void 0);let o;r[0]!==e||r[1]!==n?(o=()=>e(n),r[0]=e,r[1]=n,r[2]=o):o=r[2];let i;r[3]!==e||r[4]!==t||r[5]!==n?(i=P.buildSafeQueryKeys([e.serviceMethodKey,e,..."initialVariables"in t?[n]:[],...t.queryKey??[]]),r[3]=e,r[4]=t,r[5]=n,r[6]=i):i=r[6];let c;r[7]!==t||r[8]!==o||r[9]!==i?(c={...t,queryFn:o,queryKey:i},r[7]=t,r[8]=o,r[9]=i,r[10]=c):c=r[10];const h=Ze.useQuery(c);if("initialVariables"in t){let u;return r[11]!==h||r[12]!==n?(u={...h,setVariables:s,variables:n},r[11]=h,r[12]=n,r[13]=u):u=r[13],u}return h};exports.ServiceMethodType=Ct;exports.createAxiosHttpAdapter=An;exports.createErrorService=Ft;exports.createEventBasedErrorAdapter=Ut;exports.createGraphQLService=kt;exports.createHttpService=_t;exports.createJsLogLoggerAdapter=Un;exports.createLoggerBuilder=At;exports.createLoggerService=vn;exports.createPosthogTrackerAdapter=Dn;exports.createService=W;exports.createTrackerService=kn;exports.useBuildMutation=Lt;exports.useBuildQuery=Hn;exports.useService=I;exports.useServiceMutation=Mn;exports.useServiceQuery=qn;
|
package/dist/services.es.js
CHANGED
|
@@ -127,7 +127,7 @@ const zt = (e) => ({
|
|
|
127
127
|
}) => ee("GRAPHQL_SERVICE", Jt({
|
|
128
128
|
ErrorService: t,
|
|
129
129
|
HttpService: e
|
|
130
|
-
}), [e.ServiceProvider, t.ServiceProvider]),
|
|
130
|
+
}), [e.ServiceProvider, t.ServiceProvider]), Vt = (e) => ({
|
|
131
131
|
ErrorService: t,
|
|
132
132
|
LoggerService: r
|
|
133
133
|
}) => {
|
|
@@ -225,14 +225,14 @@ const zt = (e) => ({
|
|
|
225
225
|
useAdapter: e,
|
|
226
226
|
ErrorService: t,
|
|
227
227
|
LoggerService: r
|
|
228
|
-
}) => ee("HTTP_SERVICE",
|
|
228
|
+
}) => ee("HTTP_SERVICE", Vt(e), [t.ServiceProvider, r.ServiceProvider]);
|
|
229
229
|
function it(e, t) {
|
|
230
230
|
return function() {
|
|
231
231
|
return e.apply(t, arguments);
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
const { toString:
|
|
235
|
-
const r =
|
|
234
|
+
const { toString: Kt } = Object.prototype, { getPrototypeOf: Oe } = Object, { iterator: ue, toStringTag: at } = Symbol, le = /* @__PURE__ */ ((e) => (t) => {
|
|
235
|
+
const r = Kt.call(t);
|
|
236
236
|
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
|
|
237
237
|
})(/* @__PURE__ */ Object.create(null)), N = (e) => (e = e.toLowerCase(), (t) => le(t) === e), fe = (e) => (t) => typeof t === e, { isArray: z } = Array, I = fe("undefined");
|
|
238
238
|
function Q(e) {
|
|
@@ -733,7 +733,7 @@ function zr(e, t) {
|
|
|
733
733
|
function Jr(e) {
|
|
734
734
|
return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Vr(e) {
|
|
737
737
|
const t = {}, r = Object.keys(e);
|
|
738
738
|
let n;
|
|
739
739
|
const s = r.length;
|
|
@@ -747,7 +747,7 @@ function bt(e) {
|
|
|
747
747
|
let i = r[o++];
|
|
748
748
|
if (i === "__proto__") return !0;
|
|
749
749
|
const c = Number.isFinite(+i), h = o >= r.length;
|
|
750
|
-
return i = !i && l.isArray(s) ? s.length : i, h ? (l.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !c) : ((!s[i] || !l.isObject(s[i])) && (s[i] = []), t(r, n, s[i], o) && l.isArray(s[i]) && (s[i] =
|
|
750
|
+
return i = !i && l.isArray(s) ? s.length : i, h ? (l.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !c) : ((!s[i] || !l.isObject(s[i])) && (s[i] = []), t(r, n, s[i], o) && l.isArray(s[i]) && (s[i] = Vr(s[i])), !c);
|
|
751
751
|
}
|
|
752
752
|
if (l.isFormData(e) && l.isFunction(e.entries)) {
|
|
753
753
|
const r = {};
|
|
@@ -757,7 +757,7 @@ function bt(e) {
|
|
|
757
757
|
}
|
|
758
758
|
return null;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Kr(e, t, r) {
|
|
761
761
|
if (l.isString(e))
|
|
762
762
|
try {
|
|
763
763
|
return (t || JSON.parse)(e), l.trim(e);
|
|
@@ -793,7 +793,7 @@ const Y = {
|
|
|
793
793
|
);
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
return o || s ? (r.setContentType("application/json", !1),
|
|
796
|
+
return o || s ? (r.setContentType("application/json", !1), Kr(t)) : t;
|
|
797
797
|
}],
|
|
798
798
|
transformResponse: [function(t) {
|
|
799
799
|
const r = this.transitional || Y.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
|
|
@@ -862,7 +862,7 @@ const Wr = l.toObjectSet([
|
|
|
862
862
|
s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || t[r] && Wr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
|
|
863
863
|
}), t;
|
|
864
864
|
}, ze = Symbol("internals");
|
|
865
|
-
function
|
|
865
|
+
function K(e) {
|
|
866
866
|
return e && String(e).trim().toLowerCase();
|
|
867
867
|
}
|
|
868
868
|
function ie(e) {
|
|
@@ -907,7 +907,7 @@ let v = class {
|
|
|
907
907
|
set(t, r, n) {
|
|
908
908
|
const s = this;
|
|
909
909
|
function o(c, h, u) {
|
|
910
|
-
const a =
|
|
910
|
+
const a = K(h);
|
|
911
911
|
if (!a)
|
|
912
912
|
throw new Error("header name must be a non-empty string");
|
|
913
913
|
const f = l.findKey(s, a);
|
|
@@ -931,7 +931,7 @@ let v = class {
|
|
|
931
931
|
return this;
|
|
932
932
|
}
|
|
933
933
|
get(t, r) {
|
|
934
|
-
if (t =
|
|
934
|
+
if (t = K(t), t) {
|
|
935
935
|
const n = l.findKey(this, t);
|
|
936
936
|
if (n) {
|
|
937
937
|
const s = this[n];
|
|
@@ -948,7 +948,7 @@ let v = class {
|
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
has(t, r) {
|
|
951
|
-
if (t =
|
|
951
|
+
if (t = K(t), t) {
|
|
952
952
|
const n = l.findKey(this, t);
|
|
953
953
|
return !!(n && this[n] !== void 0 && (!r || ye(this, this[n], n, r)));
|
|
954
954
|
}
|
|
@@ -958,7 +958,7 @@ let v = class {
|
|
|
958
958
|
const n = this;
|
|
959
959
|
let s = !1;
|
|
960
960
|
function o(i) {
|
|
961
|
-
if (i =
|
|
961
|
+
if (i = K(i), i) {
|
|
962
962
|
const c = l.findKey(n, i);
|
|
963
963
|
c && (!r || ye(n, n[c], c, r)) && (delete n[c], s = !0);
|
|
964
964
|
}
|
|
@@ -1020,7 +1020,7 @@ let v = class {
|
|
|
1020
1020
|
accessors: {}
|
|
1021
1021
|
}).accessors, s = this.prototype;
|
|
1022
1022
|
function o(i) {
|
|
1023
|
-
const c =
|
|
1023
|
+
const c = K(i);
|
|
1024
1024
|
n[c] || (Yr(s, i), n[c] = !0);
|
|
1025
1025
|
}
|
|
1026
1026
|
return l.isArray(t) ? t.forEach(o) : o(t), this;
|
|
@@ -1121,7 +1121,7 @@ const ce = (e, t, r = 3) => {
|
|
|
1121
1121
|
total: e,
|
|
1122
1122
|
loaded: n
|
|
1123
1123
|
}), t[1]];
|
|
1124
|
-
},
|
|
1124
|
+
}, Ve = (e) => (...t) => l.asap(() => e(...t)), nn = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, C.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
|
|
1125
1125
|
new URL(C.origin),
|
|
1126
1126
|
C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
|
|
1127
1127
|
) : () => !0, sn = C.hasStandardBrowserEnv ? (
|
|
@@ -1163,7 +1163,7 @@ function Ot(e, t, r) {
|
|
|
1163
1163
|
let n = !on(t);
|
|
1164
1164
|
return e && (n || r == !1) ? an(e, t) : t;
|
|
1165
1165
|
}
|
|
1166
|
-
const
|
|
1166
|
+
const Ke = (e) => e instanceof v ? { ...e } : e;
|
|
1167
1167
|
function H(e, t) {
|
|
1168
1168
|
t = t || {};
|
|
1169
1169
|
const r = {};
|
|
@@ -1221,7 +1221,7 @@ function H(e, t) {
|
|
|
1221
1221
|
socketPath: i,
|
|
1222
1222
|
responseEncoding: i,
|
|
1223
1223
|
validateStatus: c,
|
|
1224
|
-
headers: (u, a, f) => s(
|
|
1224
|
+
headers: (u, a, f) => s(Ke(u), Ke(a), f, !0)
|
|
1225
1225
|
};
|
|
1226
1226
|
return l.forEach(Object.keys({ ...e, ...t }), function(a) {
|
|
1227
1227
|
const f = h[a] || s, m = f(e[a], t[a], a);
|
|
@@ -1461,7 +1461,7 @@ const Tt = (e) => {
|
|
|
1461
1461
|
fetchOptions: Pe
|
|
1462
1462
|
} = Tt(d), Le = t || fetch;
|
|
1463
1463
|
A = A ? (A + "").toLowerCase() : "text";
|
|
1464
|
-
let re = ln([b, S && S.toAbortSignal()], O),
|
|
1464
|
+
let re = ln([b, S && S.toAbortSignal()], O), V = null;
|
|
1465
1465
|
const D = re && re.unsubscribe && (() => {
|
|
1466
1466
|
re.unsubscribe();
|
|
1467
1467
|
});
|
|
@@ -1476,7 +1476,7 @@ const Tt = (e) => {
|
|
|
1476
1476
|
if (l.isFormData(E) && (j = B.headers.get("content-type")) && pe.setContentType(j), B.body) {
|
|
1477
1477
|
const [me, ne] = Je(
|
|
1478
1478
|
Ne,
|
|
1479
|
-
ce(
|
|
1479
|
+
ce(Ve(P))
|
|
1480
1480
|
);
|
|
1481
1481
|
E = We(B.body, Ge, me, ne);
|
|
1482
1482
|
}
|
|
@@ -1491,8 +1491,8 @@ const Tt = (e) => {
|
|
|
1491
1491
|
duplex: "half",
|
|
1492
1492
|
credentials: F ? te : void 0
|
|
1493
1493
|
};
|
|
1494
|
-
|
|
1495
|
-
let k = await (o ? Le(
|
|
1494
|
+
V = o && new r(y, Fe);
|
|
1495
|
+
let k = await (o ? Le(V, Pe) : Le(y, Fe));
|
|
1496
1496
|
const Ue = a && (A === "stream" || A === "response");
|
|
1497
1497
|
if (a && (T || Ue && D)) {
|
|
1498
1498
|
const B = {};
|
|
@@ -1501,7 +1501,7 @@ const Tt = (e) => {
|
|
|
1501
1501
|
});
|
|
1502
1502
|
const j = l.toFiniteNumber(k.headers.get("content-length")), [me, ne] = T && Je(
|
|
1503
1503
|
j,
|
|
1504
|
-
ce(
|
|
1504
|
+
ce(Ve(T), !0)
|
|
1505
1505
|
) || [];
|
|
1506
1506
|
k = new n(
|
|
1507
1507
|
We(k.body, Ge, me, () => {
|
|
@@ -1519,16 +1519,16 @@ const Tt = (e) => {
|
|
|
1519
1519
|
status: k.status,
|
|
1520
1520
|
statusText: k.statusText,
|
|
1521
1521
|
config: d,
|
|
1522
|
-
request:
|
|
1522
|
+
request: V
|
|
1523
1523
|
});
|
|
1524
1524
|
});
|
|
1525
1525
|
} catch (F) {
|
|
1526
1526
|
throw D && D(), F && F.name === "TypeError" && /Load failed|fetch/i.test(F.message) ? Object.assign(
|
|
1527
|
-
new w("Network Error", w.ERR_NETWORK, d,
|
|
1527
|
+
new w("Network Error", w.ERR_NETWORK, d, V),
|
|
1528
1528
|
{
|
|
1529
1529
|
cause: F.cause || F
|
|
1530
1530
|
}
|
|
1531
|
-
) : w.from(F, F && F.code, d,
|
|
1531
|
+
) : w.from(F, F && F.code, d, V);
|
|
1532
1532
|
}
|
|
1533
1533
|
};
|
|
1534
1534
|
}, yn = /* @__PURE__ */ new Map(), At = (e) => {
|
|
@@ -2313,26 +2313,27 @@ const $n = () => {
|
|
|
2313
2313
|
mutationKey: n
|
|
2314
2314
|
}, r[3] = e, r[4] = t, r[5] = n, r[6] = s) : s = r[6], It(s);
|
|
2315
2315
|
}, Os = (e, t) => {
|
|
2316
|
-
const r = G.c(
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2316
|
+
const r = G.c(14), [n, s] = Ht("initialVariables" in t ? t.initialVariables : void 0);
|
|
2317
|
+
let o;
|
|
2318
|
+
r[0] !== e || r[1] !== n ? (o = () => e(n), r[0] = e, r[1] = n, r[2] = o) : o = r[2];
|
|
2319
|
+
let i;
|
|
2320
|
+
r[3] !== e || r[4] !== t || r[5] !== n ? (i = nt([e.serviceMethodKey, e, ..."initialVariables" in t ? [n] : [], ...t.queryKey ?? []]), r[3] = e, r[4] = t, r[5] = n, r[6] = i) : i = r[6];
|
|
2320
2321
|
let c;
|
|
2321
|
-
r[
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2322
|
+
r[7] !== t || r[8] !== o || r[9] !== i ? (c = {
|
|
2323
|
+
...t,
|
|
2324
|
+
queryFn: o,
|
|
2325
|
+
queryKey: i
|
|
2326
|
+
}, r[7] = t, r[8] = o, r[9] = i, r[10] = c) : c = r[10];
|
|
2327
|
+
const h = $t(c);
|
|
2328
|
+
if ("initialVariables" in t) {
|
|
2329
|
+
let u;
|
|
2330
|
+
return r[11] !== h || r[12] !== n ? (u = {
|
|
2331
|
+
...h,
|
|
2332
|
+
setVariables: s,
|
|
2333
|
+
variables: n
|
|
2334
|
+
}, r[11] = h, r[12] = n, r[13] = u) : u = r[13], u;
|
|
2335
|
+
}
|
|
2336
|
+
return h;
|
|
2336
2337
|
};
|
|
2337
2338
|
export {
|
|
2338
2339
|
In as ServiceMethodType,
|
|
@@ -10,7 +10,7 @@ export type GraphQLServiceReturn = {
|
|
|
10
10
|
headers?: HttpHeaders;
|
|
11
11
|
}) => Promise<Result>;
|
|
12
12
|
};
|
|
13
|
-
type GraphQLService = Service<GraphQLServiceProps, GraphQLServiceReturn>;
|
|
13
|
+
export type GraphQLService = Service<GraphQLServiceProps, GraphQLServiceReturn>;
|
|
14
14
|
export declare const createGraphQLService: ({ HttpService, ErrorService, }: {
|
|
15
15
|
HttpService: HttpService;
|
|
16
16
|
ErrorService: ErrorService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.service.d.ts","sourceRoot":"","sources":["../../../src/services/graphql.service.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,WAAW,EACX,OAAO,EAEP,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,KAAK,mBAAmB,GAAG,SAAS,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,CACP,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1D,MAAM,GAAG,OAAO,EAChB,OAAO,EAAE;QACT,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvB,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"graphql.service.d.ts","sourceRoot":"","sources":["../../../src/services/graphql.service.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,WAAW,EACX,OAAO,EAEP,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,KAAK,mBAAmB,GAAG,SAAS,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,CACP,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1D,MAAM,GAAG,OAAO,EAChB,OAAO,EAAE;QACT,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;AA6KhF,eAAO,MAAM,oBAAoB,GAAI,gCAGlC;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;CAC5B,KAAG,cAKD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { BaseProps } from '../types';
|
|
3
|
+
import { MakeOptional } from '../types/helpers';
|
|
3
4
|
|
|
4
5
|
export declare enum ServiceMethodType {
|
|
5
6
|
MUTATION = "mutation",
|
|
@@ -15,19 +16,18 @@ export type ServiceMutationMethod<Vars, Res> = ServiceMethod<Vars, Res> & {
|
|
|
15
16
|
export type ServiceQueryMethod<Vars, Res> = ServiceMethod<Vars, Res> & {
|
|
16
17
|
serviceMethodType: ServiceMethodType.QUERY;
|
|
17
18
|
};
|
|
18
|
-
export type ServiceQueryHookOptions<Vars, Res> =
|
|
19
|
+
export type ServiceQueryHookOptions<Vars, Res> = MakeOptional<[
|
|
20
|
+
Vars
|
|
21
|
+
] extends [never] ? Omit<UseQueryOptions<Res, Error, Res, any[]>, 'queryFn'> : Omit<UseQueryOptions<Res, Error, Res, any[]>, 'queryFn'> & ([Vars] extends [undefined] ? {
|
|
19
22
|
initialVariables?: Vars;
|
|
20
23
|
} : {
|
|
21
24
|
initialVariables: Vars;
|
|
22
|
-
})
|
|
23
|
-
export type ServiceMutationHookOptions<Vars, Res> = Omit<UseMutationOptions<Res, Error, Vars, unknown>, 'mutationFn'>;
|
|
24
|
-
export type ServiceQueryHookResult<Vars, Res> = UseQueryResult<NoInfer<Res>, Error>
|
|
25
|
-
setVariables: React.Dispatch<React.SetStateAction<undefined>>;
|
|
26
|
-
variables: undefined;
|
|
27
|
-
} : {
|
|
25
|
+
}), 'queryKey'>;
|
|
26
|
+
export type ServiceMutationHookOptions<Vars, Res> = MakeOptional<Omit<UseMutationOptions<Res, Error, Vars, unknown>, 'mutationFn'>, 'mutationKey'>;
|
|
27
|
+
export type ServiceQueryHookResult<Vars, Res> = [Vars] extends [never] ? UseQueryResult<NoInfer<Res>, Error> : UseQueryResult<NoInfer<Res>, Error> & {
|
|
28
28
|
setVariables: React.Dispatch<React.SetStateAction<Vars>>;
|
|
29
29
|
variables: Vars;
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
export type ServiceMutationHookResult<Vars, Res> = UseMutationResult<Res, Error, Vars, unknown>;
|
|
32
32
|
export type ServiceProvider<P extends BaseProps> = React.FC<P> & {
|
|
33
33
|
serviceName: symbol;
|
|
@@ -42,5 +42,5 @@ export declare const useBuildQuery: <Vars, Res>(key: string, fn: ServiceMethodFu
|
|
|
42
42
|
export declare const createService: <P extends BaseProps, T>(serviceName: string, useServiceBuilder: (props: Omit<P, "children">) => T, serviceDependencies: ServiceProvider<any>[]) => Service<P, T>;
|
|
43
43
|
export declare const useService: <T>(service: Service<any, T>) => T;
|
|
44
44
|
export declare const useServiceMutation: <Vars, Res>(fn: ServiceMutationMethod<Vars, Res>, options: ServiceMutationHookOptions<Vars, Res>) => ServiceMutationHookResult<Vars, Res>;
|
|
45
|
-
export declare const useServiceQuery: <Vars, Res>(fn: ServiceQueryMethod<Vars, Res>,
|
|
45
|
+
export declare const useServiceQuery: <Vars, Res>(fn: ServiceQueryMethod<Vars, Res>, options: ServiceQueryHookOptions<Vars, Res>) => ServiceQueryHookResult<Vars, Res>;
|
|
46
46
|
//# sourceMappingURL=services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/services/services.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,iBAAiB,EAEjB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/services/services.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,iBAAiB,EAEjB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,oBAAY,iBAAiB;IAC3B,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,qBAAqB,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GACjE,MAAM,OAAO,CAAC,GAAG,CAAC,GAClB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GACxB,CAAC,SAAS,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,GAClC,CAAC,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAExC,MAAM,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG;IACxE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,IAAI,EAAE,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG;IACxE,iBAAiB,EAAE,iBAAiB,CAAC,QAAQ,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,IAAI,EAAE,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG;IACrE,iBAAiB,EAAE,iBAAiB,CAAC,KAAK,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,IAAI,EAAE,GAAG,IAAI,YAAY,CAC3D;IAAC,IAAI;CAAC,SAAS,CAAC,KAAK,CAAC,GAClB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,CAAC,GACxD,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,CAAC,GACtD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GACvB;IAAE,gBAAgB,CAAC,EAAE,IAAI,CAAA;CAAE,GAC3B;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,CAAC,EACrC,UAAU,CACX,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,IAAI,EAAE,GAAG,IAAI,YAAY,CAC9D,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,YAAY,CAAC,EACjE,aAAa,CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAClE,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GACnC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG;IACpC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEN,MAAM,MAAM,yBAAyB,CAAC,IAAI,EAAE,GAAG,IAAI,iBAAiB,CAClE,GAAG,EACH,KAAK,EACL,IAAI,EACJ,OAAO,CACR,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,IAAI;IAC5C,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,CAAC;CACrB,CAAC;AAmCF,eAAO,MAAM,gBAAgB,GAAI,IAAI,EAAE,GAAG,EACxC,KAAK,MAAM,EACX,IAAI,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,KACnC,qBAAqB,CAAC,IAAI,EAAE,GAAG,CACmB,CAAC;AAEtD,eAAO,MAAM,aAAa,GAAI,IAAI,EAAE,GAAG,EACrC,KAAK,MAAM,EACX,IAAI,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,KACnC,kBAAkB,CAAC,IAAI,EAAE,GAAG,CACmB,CAAC;AAEnD,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,SAAS,EAAE,CAAC,EAClD,aAAa,MAAM,EACnB,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,EACpD,qBAAqB,eAAe,CAAC,GAAG,CAAC,EAAE,KAC1C,OAAO,CAAC,CAAC,EAAE,CAAC,CAad,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAG,SAAS,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,MACjC,CAAC;AAEvB,eAAO,MAAM,kBAAkB,GAAI,IAAI,EAAE,GAAG,EAC1C,IAAI,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,EACpC,SAAS,0BAA0B,CAAC,IAAI,EAAE,GAAG,CAAC,KAC7C,yBAAyB,CAAC,IAAI,EAAE,GAAG,CASlC,CAAC;AAEL,eAAO,MAAM,eAAe,GAAI,IAAI,EAAE,GAAG,EACvC,IAAI,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC,EACjC,SAAS,uBAAuB,CAAC,IAAI,EAAE,GAAG,CAAC,KAC1C,sBAAsB,CAAC,IAAI,EAAE,GAAG,CA4BlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/types/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACzD,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtB,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACzD,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|