septor-store-react 0.0.4 → 0.0.5
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/index.js +24 -23
- package/dist/index.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,12 +11,12 @@ const { toString: St } = Object.prototype, { getPrototypeOf: Se } = Object, { it
|
|
|
11
11
|
function W(e) {
|
|
12
12
|
return e !== null && !$(e) && e.constructor !== null && !$(e.constructor) && T(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const Ge = k("ArrayBuffer");
|
|
15
15
|
function Et(e) {
|
|
16
16
|
let t;
|
|
17
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
17
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ge(e.buffer), t;
|
|
18
18
|
}
|
|
19
|
-
const Rt = ae("string"), T = ae("function"),
|
|
19
|
+
const Rt = ae("string"), T = ae("function"), Ke = ae("number"), v = (e) => e !== null && typeof e == "object", Ot = (e) => e === !0 || e === !1, te = (e) => {
|
|
20
20
|
if (ie(e) !== "object")
|
|
21
21
|
return !1;
|
|
22
22
|
const t = Se(e);
|
|
@@ -95,7 +95,7 @@ const jt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
|
|
|
95
95
|
if (!e) return null;
|
|
96
96
|
if (q(e)) return e;
|
|
97
97
|
let t = e.length;
|
|
98
|
-
if (!
|
|
98
|
+
if (!Ke(t)) return null;
|
|
99
99
|
const n = new Array(t);
|
|
100
100
|
for (; t-- > 0; )
|
|
101
101
|
n[t] = e[t];
|
|
@@ -139,14 +139,14 @@ const jt = (e, t, n, { allOwnKeys: r } = {}) => (Q(t, (s, i) => {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
},
|
|
142
|
+
}, Gt = (e, t) => {
|
|
143
143
|
const n = {}, r = (s) => {
|
|
144
144
|
s.forEach((i) => {
|
|
145
145
|
n[i] = !0;
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
return q(e) ? r(e) : r(String(e).split(t)), n;
|
|
149
|
-
},
|
|
149
|
+
}, Kt = () => {
|
|
150
150
|
}, Zt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
151
151
|
function Yt(e) {
|
|
152
152
|
return !!(e && T(e.append) && e[Xe] === "FormData" && e[oe]);
|
|
@@ -179,12 +179,12 @@ const en = (e) => {
|
|
|
179
179
|
T(D.postMessage)
|
|
180
180
|
), rn = typeof queueMicrotask < "u" ? queueMicrotask.bind(D) : typeof process < "u" && process.nextTick || tt, sn = (e) => e != null && T(e[oe]), a = {
|
|
181
181
|
isArray: q,
|
|
182
|
-
isArrayBuffer:
|
|
182
|
+
isArrayBuffer: Ge,
|
|
183
183
|
isBuffer: W,
|
|
184
184
|
isFormData: Pt,
|
|
185
185
|
isArrayBufferView: Et,
|
|
186
186
|
isString: Rt,
|
|
187
|
-
isNumber:
|
|
187
|
+
isNumber: Ke,
|
|
188
188
|
isBoolean: Ot,
|
|
189
189
|
isObject: v,
|
|
190
190
|
isPlainObject: te,
|
|
@@ -222,9 +222,9 @@ const en = (e) => {
|
|
|
222
222
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
223
223
|
reduceDescriptors: et,
|
|
224
224
|
freezeMethods: Xt,
|
|
225
|
-
toObjectSet:
|
|
225
|
+
toObjectSet: Gt,
|
|
226
226
|
toCamelCase: vt,
|
|
227
|
-
noop:
|
|
227
|
+
noop: Kt,
|
|
228
228
|
toFiniteNumber: Zt,
|
|
229
229
|
findKey: Ze,
|
|
230
230
|
global: D,
|
|
@@ -1230,13 +1230,13 @@ const dt = (e) => {
|
|
|
1230
1230
|
onUploadProgress: _,
|
|
1231
1231
|
responseType: x,
|
|
1232
1232
|
headers: ue,
|
|
1233
|
-
withCredentials:
|
|
1233
|
+
withCredentials: G = "same-origin",
|
|
1234
1234
|
fetchOptions: Te
|
|
1235
1235
|
} = dt(d), Ae = t || fetch;
|
|
1236
1236
|
x = x ? (x + "").toLowerCase() : "text";
|
|
1237
|
-
let
|
|
1238
|
-
const B =
|
|
1239
|
-
|
|
1237
|
+
let K = jn([C, E && E.toAbortSignal()], O), z = null;
|
|
1238
|
+
const B = K && K.unsubscribe && (() => {
|
|
1239
|
+
K.unsubscribe();
|
|
1240
1240
|
});
|
|
1241
1241
|
let Ce;
|
|
1242
1242
|
try {
|
|
@@ -1254,15 +1254,15 @@ const dt = (e) => {
|
|
|
1254
1254
|
S = Ie(L.body, He, fe, Z);
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
-
a.isString(
|
|
1257
|
+
a.isString(G) || (G = G ? "include" : "omit");
|
|
1258
1258
|
const P = i && "credentials" in n.prototype, xe = {
|
|
1259
1259
|
...Te,
|
|
1260
|
-
signal:
|
|
1260
|
+
signal: K,
|
|
1261
1261
|
method: h.toUpperCase(),
|
|
1262
1262
|
headers: ue.normalize().toJSON(),
|
|
1263
1263
|
body: S,
|
|
1264
1264
|
duplex: "half",
|
|
1265
|
-
credentials: P ?
|
|
1265
|
+
credentials: P ? G : void 0
|
|
1266
1266
|
};
|
|
1267
1267
|
z = i && new n(m, xe);
|
|
1268
1268
|
let U = await (i ? Ae(z, Te) : Ae(m, xe));
|
|
@@ -1767,7 +1767,7 @@ const {
|
|
|
1767
1767
|
formToJSON: Rr,
|
|
1768
1768
|
getAdapter: Or,
|
|
1769
1769
|
mergeConfig: Tr
|
|
1770
|
-
} = g,
|
|
1770
|
+
} = g, Gn = {
|
|
1771
1771
|
abortController: new AbortController()
|
|
1772
1772
|
};
|
|
1773
1773
|
let ge = "", wt = {};
|
|
@@ -1775,10 +1775,10 @@ const Ar = (e) => {
|
|
|
1775
1775
|
e.backendURL && (ge = e.backendURL, M.defaults.baseURL = ge), e?.axiosCreate && (wt = e.axiosCreate);
|
|
1776
1776
|
}, M = g.create({
|
|
1777
1777
|
baseURL: ge,
|
|
1778
|
-
signal:
|
|
1778
|
+
signal: Gn.abortController.signal,
|
|
1779
1779
|
// Signal that is assiciated with any request to be made with this axios instance
|
|
1780
1780
|
...wt ?? {}
|
|
1781
|
-
}),
|
|
1781
|
+
}), Kn = (e) => {
|
|
1782
1782
|
const t = Yn(), n = t?.token ?? null, r = t?.expiresIn ?? null;
|
|
1783
1783
|
if (r) {
|
|
1784
1784
|
const s = t?.timestamp ?? null, i = Date.now();
|
|
@@ -1797,7 +1797,7 @@ M.interceptors.response.use(
|
|
|
1797
1797
|
(e) => (console.log("Error.....", e), e.response?.status, Promise.reject(e))
|
|
1798
1798
|
);
|
|
1799
1799
|
M.interceptors.request.use(
|
|
1800
|
-
|
|
1800
|
+
Kn,
|
|
1801
1801
|
(e) => Promise.reject(e)
|
|
1802
1802
|
);
|
|
1803
1803
|
const Cr = async ({ url: e, method: t, data: n }) => {
|
|
@@ -1914,7 +1914,7 @@ const ve = (e) => {
|
|
|
1914
1914
|
const u = c?.mUse, p = t();
|
|
1915
1915
|
if (e({ loading: !0 }), u) {
|
|
1916
1916
|
const w = JSON.parse(sessionStorage.getItem(r) || "{}");
|
|
1917
|
-
if (p.validateLength(w) && (f && f(w), e({ [r]: w }), t().setStateValue(r, w),
|
|
1917
|
+
if (p.validateLength(w) && (f && f(w), e({ [r]: w }), t().setStateValue(r, w), !n))
|
|
1918
1918
|
return w;
|
|
1919
1919
|
}
|
|
1920
1920
|
const b = p?.[r] ?? t().getStateItem(r);
|
|
@@ -1938,7 +1938,8 @@ const ve = (e) => {
|
|
|
1938
1938
|
f
|
|
1939
1939
|
);
|
|
1940
1940
|
} catch (u) {
|
|
1941
|
-
|
|
1941
|
+
const p = state?.[r] ?? t().getStateItem(r);
|
|
1942
|
+
t().cleareQueApi(l), f && f(p), console.error(u);
|
|
1942
1943
|
}
|
|
1943
1944
|
}
|
|
1944
1945
|
})), or = sr;
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(C,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],L):(C=typeof globalThis<"u"?globalThis:C||self,L(C["septor-store-react"]={},C.React))})(this,(function(C,L){"use strict";var fe=typeof document<"u"?document.currentScript:null;function Ce(e,t){return function(){return e.apply(t,arguments)}}const{toString:Tt}=Object.prototype,{getPrototypeOf:de}=Object,{iterator:Z,toStringTag:xe}=Symbol,Y=(e=>t=>{const n=Tt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Y(t)===e),ee=e=>t=>typeof t===e,{isArray:M}=Array,q=ee("undefined");function v(e){return e!==null&&!q(e)&&e.constructor!==null&&!q(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ne=P("ArrayBuffer");function At(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ne(e.buffer),t}const Ct=ee("string"),O=ee("function"),Pe=ee("number"),W=e=>e!==null&&typeof e=="object",xt=e=>e===!0||e===!1,te=e=>{if(Y(e)!=="object")return!1;const t=de(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(xe in e)&&!(Z in e)},Nt=e=>{if(!W(e)||v(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pt=P("Date"),kt=P("File"),Ft=P("Blob"),Ut=P("FileList"),Lt=e=>W(e)&&O(e.pipe),_t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=Y(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Bt=P("URLSearchParams"),[Dt,jt,It,Ht]=["ReadableStream","Request","Response","Headers"].map(P),$t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),M(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(v(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function ke(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fe=e=>!q(e)&&e!==D;function pe(){const{caseless:e,skipUndefined:t}=Fe(this)&&this||{},n={},r=(s,i)=>{const o=e&&ke(n,i)||i;te(n[o])&&te(s)?n[o]=pe(n[o],s):te(s)?n[o]=pe({},s):M(s)?n[o]=s.slice():(!t||!q(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Q(arguments[s],r);return n}const Mt=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,i)=>{n&&O(s)?e[i]=Ce(s,n):e[i]=s},{allOwnKeys:r}),e),qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},zt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&de(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Jt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},vt=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!Pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&de(Uint8Array)),Qt=(e,t)=>{const r=(e&&e[Z]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Xt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Kt=P("HTMLFormElement"),Gt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ue=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Zt=P("RegExp"),Le=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Yt=e=>{Le(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},en=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return M(e)?r(e):r(String(e).split(t)),n},tn=()=>{},nn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function rn(e){return!!(e&&O(e.append)&&e[xe]==="FormData"&&e[Z])}const sn=e=>{const t=new Array(10),n=(r,s)=>{if(W(r)){if(t.indexOf(r)>=0)return;if(v(r))return r;if(!("toJSON"in r)){t[s]=r;const i=M(r)?[]:{};return Q(r,(o,c)=>{const f=n(o,s+1);!q(f)&&(i[c]=f)}),t[s]=void 0,i}}return r};return n(e,0)},on=P("AsyncFunction"),an=e=>e&&(W(e)||O(e))&&O(e.then)&&O(e.catch),_e=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:i})=>{s===D&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(D.postMessage)),cn=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||_e,a={isArray:M,isArrayBuffer:Ne,isBuffer:v,isFormData:_t,isArrayBufferView:At,isString:Ct,isNumber:Pe,isBoolean:xt,isObject:W,isPlainObject:te,isEmptyObject:Nt,isReadableStream:Dt,isRequest:jt,isResponse:It,isHeaders:Ht,isUndefined:q,isDate:Pt,isFile:kt,isBlob:Ft,isRegExp:Zt,isFunction:O,isStream:Lt,isURLSearchParams:Bt,isTypedArray:Wt,isFileList:Ut,forEach:Q,merge:pe,extend:Mt,trim:$t,stripBOM:qt,inherits:Vt,toFlatObject:zt,kindOf:Y,kindOfTest:P,endsWith:Jt,toArray:vt,forEachEntry:Qt,matchAll:Xt,isHTMLForm:Kt,hasOwnProperty:Ue,hasOwnProp:Ue,reduceDescriptors:Le,freezeMethods:Yt,toObjectSet:en,toCamelCase:Gt,noop:tn,toFiniteNumber:nn,findKey:ke,global:D,isContextDefined:Fe,isSpecCompliantForm:rn,toJSONObject:sn,isAsyncFn:on,isThenable:an,setImmediate:_e,asap:cn,isIterable:e=>e!=null&&O(e[Z])};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Be=y.prototype,De={};["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=>{De[e]={value:e}}),Object.defineProperties(y,De),Object.defineProperty(Be,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(Be);a.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return y.call(o,c,f,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const ln=null;function he(e){return a.isPlainObject(e)||a.isArray(e)}function je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=je(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function un(e){return a.isArray(e)&&!e.some(he)}const fn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ne(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,m,h){let g=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&un(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(g=a.toArray(d)))return m=je(m),g.forEach(function(E,A){!(a.isUndefined(E)||E===null)&&t.append(o===!0?Ie([m],A,i):o===null?m:m+"[]",l(E))}),!1}return he(d)?!0:(t.append(Ie(h,m,i),l(d)),!1)}const p=[],b=Object.assign(fn,{defaultVisitor:u,convertValue:l,isVisitable:he});function w(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(g,x){(!(a.isUndefined(g)||g===null)&&s.call(t,g,a.isString(x)?x.trim():x,m,b))===!0&&w(g,m?m.concat(x):[x])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function me(e,t){this._pairs=[],e&&ne(e,this,t)}const $e=me.prototype;$e.append=function(t,n){this._pairs.push([t,n])},$e.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function dn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Me(e,t,n){if(!t)return e;const r=n&&n.encode||dn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new me(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ye=typeof window<"u"&&typeof document<"u",be=typeof navigator=="object"&&navigator||void 0,hn=ye&&(!be||["ReactNative","NativeScript","NS"].indexOf(be.product)<0),mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yn=ye&&window.location.href||"http://localhost",R={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:hn,hasStandardBrowserWebWorkerEnv:mn,navigator:be,origin:yn},Symbol.toStringTag,{value:"Module"})),...pn};function bn(e,t){return ne(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function wn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Sn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(wn(r),s,n,0)}),n}return null}function gn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:Ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return bn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ne(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),gn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const En=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&En[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Je=Symbol("internals");function
|
|
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,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=K(o);r[c]||(Cn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(T.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(T);function Se(e,t){const n=this||X,r=t||n,s=T.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ve(e){return!!(e&&e.__CANCEL__)}function V(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(V,y,{__CANCEL__:!0});function We(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Nn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),u=r[i];o||(o=l),n[s]=f,r[s]=l;let p=i,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const w=u&&l-u;return w?Math.round(b*1e3/w):void 0}}function Pn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),p=u-n;p>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const se=(e,t,n=3)=>{let r=0;const s=Nn(50,250);return Pn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-r,l=s(f),u=o<=c;r=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Qe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xe=e=>(...t)=>a.asap(()=>e(...t)),kn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Fn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),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 Un(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ln(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t,n){let r=!Un(t);return e&&(r||n==!1)?Ln(e,t):t}const Ge=e=>e instanceof T?{...e}:e;function j(e,t){t=t||{};const n={};function r(l,u,p,b){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:b},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,p,b){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,p,b)}else return r(l,u,p,b)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,p){if(p in t)return r(l,u);if(p in e)return r(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,p)=>s(Ge(l),Ge(u),p,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const p=f[u]||s,b=p(e[u],t[u],u);a.isUndefined(b)&&p!==c||(n[u]=b)}),n}const Ze=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=T.from(o),t.url=Me(Ke(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,p])=>{l.includes(u.toLowerCase())&&o.set(u,p)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&kn(t.url))){const f=s&&i&&Fn.read(i);f&&o.set(s,f)}return t},_n=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Ze(e);let i=s.data;const o=T.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,p,b,w,d;function m(){w&&w(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function g(){if(!h)return;const E=T.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:E,config:e,request:h};We(function(N){n(N),m()},function(N){r(N),m()},k),h=null}"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(g)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){const k=A&&A.message?A.message:"Network Error",H=new y(k,y.ERR_NETWORK,e,h);H.event=A||null,r(H),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||Ve;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,k.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(A,k){h.setRequestHeader(k,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),l&&([b,d]=se(l,!0),h.addEventListener("progress",b)),f&&h.upload&&([p,w]=se(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(u=E=>{h&&(r(!E||E.type?new V(null,e,h):E),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=xn(s.url);if(x&&R.protocols.indexOf(x)===-1){r(new y("Unsupported protocol "+x+":",y.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Bn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof y?u:new V(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Dn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},jn=async function*(e,t){for await(const n of In(e))yield*Dn(n,t)},In=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ye=(e,t,n,r)=>{const s=jn(e,t);let i=0,o,c=f=>{o||(o=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let p=u.byteLength;if(n){let b=i+=p;n(b)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},et=64*1024,{isFunction:oe}=a,Hn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:tt,TextEncoder:nt}=a.global,rt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$n=e=>{e=a.merge.call({skipUndefined:!0},Hn,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const c=s&&oe(tt),f=s&&(typeof nt=="function"?(d=>m=>d.encode(m))(new nt):async d=>new Uint8Array(await new n(d).arrayBuffer())),l=i&&c&&rt(()=>{let d=!1;const m=new n(R.origin,{body:new tt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),u=o&&c&&rt(()=>a.isReadableStream(new r("").body)),p={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let g=m&&m[d];if(g)return g.call(m);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,h)})});const b=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},w=async(d,m)=>{const h=a.toFiniteNumber(d.getContentLength());return h??b(m)};return async d=>{let{url:m,method:h,data:g,signal:x,cancelToken:E,timeout:A,onDownloadProgress:k,onUploadProgress:H,responseType:N,headers:Te,withCredentials:ce="same-origin",fetchOptions:bt}=Ze(d),wt=t||fetch;N=N?(N+"").toLowerCase():"text";let le=Bn([x,E&&E.toAbortSignal()],A),G=null;const $=le&&le.unsubscribe&&(()=>{le.unsubscribe()});let St;try{if(H&&l&&h!=="get"&&h!=="head"&&(St=await w(Te,g))!==0){let B=new n(m,{method:"POST",body:g,duplex:"half"}),J;if(a.isFormData(g)&&(J=B.headers.get("content-type"))&&Te.setContentType(J),B.body){const[Ae,ue]=Qe(St,se(Xe(H)));g=Ye(B.body,et,Ae,ue)}}a.isString(ce)||(ce=ce?"include":"omit");const U=i&&"credentials"in n.prototype,gt={...bt,signal:le,method:h.toUpperCase(),headers:Te.normalize().toJSON(),body:g,duplex:"half",credentials:U?ce:void 0};G=i&&new n(m,gt);let _=await(i?wt(G,bt):wt(m,gt));const Et=u&&(N==="stream"||N==="response");if(u&&(k||Et&&$)){const B={};["status","statusText","headers"].forEach(Rt=>{B[Rt]=_[Rt]});const J=a.toFiniteNumber(_.headers.get("content-length")),[Ae,ue]=k&&Qe(J,se(Xe(k),!0))||[];_=new r(Ye(_.body,et,Ae,()=>{ue&&ue(),$&&$()}),B)}N=N||"text";let rr=await p[a.findKey(p,N)||"text"](_,d);return!Et&&$&&$(),await new Promise((B,J)=>{We(B,J,{data:rr,headers:T.from(_.headers),status:_.status,statusText:_.statusText,config:d,request:G})})}catch(U){throw $&&$(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,G),{cause:U.cause||U}):y.from(U,U&&U.code,d,G)}}},Mn=new Map,st=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,f,l,u=Mn;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:$n(t)),u=l;return l};st();const ge={http:ln,xhr:_n,fetch:{get:st}};a.forEach(ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ot=e=>`- ${e}`,qn=e=>a.isFunction(e)||e===null||e===!1;function Vn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!qn(r)&&(s=ge[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
|
|
1
|
+
(function(C,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],L):(C=typeof globalThis<"u"?globalThis:C||self,L(C["septor-store-react"]={},C.React))})(this,(function(C,L){"use strict";var fe=typeof document<"u"?document.currentScript:null;function Ce(e,t){return function(){return e.apply(t,arguments)}}const{toString:Tt}=Object.prototype,{getPrototypeOf:de}=Object,{iterator:K,toStringTag:xe}=Symbol,Y=(e=>t=>{const n=Tt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Y(t)===e),ee=e=>t=>typeof t===e,{isArray:M}=Array,q=ee("undefined");function v(e){return e!==null&&!q(e)&&e.constructor!==null&&!q(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ne=P("ArrayBuffer");function At(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ne(e.buffer),t}const Ct=ee("string"),O=ee("function"),Pe=ee("number"),W=e=>e!==null&&typeof e=="object",xt=e=>e===!0||e===!1,te=e=>{if(Y(e)!=="object")return!1;const t=de(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(xe in e)&&!(K in e)},Nt=e=>{if(!W(e)||v(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pt=P("Date"),kt=P("File"),Ft=P("Blob"),Ut=P("FileList"),Lt=e=>W(e)&&O(e.pipe),_t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=Y(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Bt=P("URLSearchParams"),[Dt,jt,It,Ht]=["ReadableStream","Request","Response","Headers"].map(P),$t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),M(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(v(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function ke(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const D=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fe=e=>!q(e)&&e!==D;function pe(){const{caseless:e,skipUndefined:t}=Fe(this)&&this||{},n={},r=(s,i)=>{const o=e&&ke(n,i)||i;te(n[o])&&te(s)?n[o]=pe(n[o],s):te(s)?n[o]=pe({},s):M(s)?n[o]=s.slice():(!t||!q(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Q(arguments[s],r);return n}const Mt=(e,t,n,{allOwnKeys:r}={})=>(Q(t,(s,i)=>{n&&O(s)?e[i]=Ce(s,n):e[i]=s},{allOwnKeys:r}),e),qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},zt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&de(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Jt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},vt=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!Pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&de(Uint8Array)),Qt=(e,t)=>{const r=(e&&e[K]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Xt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Gt=P("HTMLFormElement"),Zt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ue=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Kt=P("RegExp"),Le=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Q(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Yt=e=>{Le(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},en=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return M(e)?r(e):r(String(e).split(t)),n},tn=()=>{},nn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function rn(e){return!!(e&&O(e.append)&&e[xe]==="FormData"&&e[K])}const sn=e=>{const t=new Array(10),n=(r,s)=>{if(W(r)){if(t.indexOf(r)>=0)return;if(v(r))return r;if(!("toJSON"in r)){t[s]=r;const i=M(r)?[]:{};return Q(r,(o,c)=>{const f=n(o,s+1);!q(f)&&(i[c]=f)}),t[s]=void 0,i}}return r};return n(e,0)},on=P("AsyncFunction"),an=e=>e&&(W(e)||O(e))&&O(e.then)&&O(e.catch),_e=((e,t)=>e?setImmediate:t?((n,r)=>(D.addEventListener("message",({source:s,data:i})=>{s===D&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),D.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(D.postMessage)),cn=typeof queueMicrotask<"u"?queueMicrotask.bind(D):typeof process<"u"&&process.nextTick||_e,a={isArray:M,isArrayBuffer:Ne,isBuffer:v,isFormData:_t,isArrayBufferView:At,isString:Ct,isNumber:Pe,isBoolean:xt,isObject:W,isPlainObject:te,isEmptyObject:Nt,isReadableStream:Dt,isRequest:jt,isResponse:It,isHeaders:Ht,isUndefined:q,isDate:Pt,isFile:kt,isBlob:Ft,isRegExp:Kt,isFunction:O,isStream:Lt,isURLSearchParams:Bt,isTypedArray:Wt,isFileList:Ut,forEach:Q,merge:pe,extend:Mt,trim:$t,stripBOM:qt,inherits:Vt,toFlatObject:zt,kindOf:Y,kindOfTest:P,endsWith:Jt,toArray:vt,forEachEntry:Qt,matchAll:Xt,isHTMLForm:Gt,hasOwnProperty:Ue,hasOwnProp:Ue,reduceDescriptors:Le,freezeMethods:Yt,toObjectSet:en,toCamelCase:Zt,noop:tn,toFiniteNumber:nn,findKey:ke,global:D,isContextDefined:Fe,isSpecCompliantForm:rn,toJSONObject:sn,isAsyncFn:on,isThenable:an,setImmediate:_e,asap:cn,isIterable:e=>e!=null&&O(e[K])};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Be=y.prototype,De={};["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=>{De[e]={value:e}}),Object.defineProperties(y,De),Object.defineProperty(Be,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(Be);a.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return y.call(o,c,f,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const ln=null;function he(e){return a.isPlainObject(e)||a.isArray(e)}function je(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=je(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function un(e){return a.isArray(e)&&!e.some(he)}const fn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ne(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,m,h){let g=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&un(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(g=a.toArray(d)))return m=je(m),g.forEach(function(E,A){!(a.isUndefined(E)||E===null)&&t.append(o===!0?Ie([m],A,i):o===null?m:m+"[]",l(E))}),!1}return he(d)?!0:(t.append(Ie(h,m,i),l(d)),!1)}const p=[],b=Object.assign(fn,{defaultVisitor:u,convertValue:l,isVisitable:he});function w(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(g,x){(!(a.isUndefined(g)||g===null)&&s.call(t,g,a.isString(x)?x.trim():x,m,b))===!0&&w(g,m?m.concat(x):[x])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function He(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function me(e,t){this._pairs=[],e&&ne(e,this,t)}const $e=me.prototype;$e.append=function(t,n){this._pairs.push([t,n])},$e.toString=function(t){const n=t?function(r){return t.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function dn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Me(e,t,n){if(!t)return e;const r=n&&n.encode||dn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new me(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ye=typeof window<"u"&&typeof document<"u",be=typeof navigator=="object"&&navigator||void 0,hn=ye&&(!be||["ReactNative","NativeScript","NS"].indexOf(be.product)<0),mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yn=ye&&window.location.href||"http://localhost",R={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:hn,hasStandardBrowserWebWorkerEnv:mn,navigator:be,origin:yn},Symbol.toStringTag,{value:"Module"})),...pn};function bn(e,t){return ne(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function wn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Sn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(wn(r),s,n,0)}),n}return null}function gn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:Ve,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return bn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ne(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),gn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const En=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&En[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Je=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function re(e){return e===!1||e==null?e:a.isArray(e)?e.map(re):String(e)}function On(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Tn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function we(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function An(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Cn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let T=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,f,l){const u=G(f);if(!u)throw new Error("header name must be a non-empty string");const p=a.findKey(s,u);(!p||s[p]===void 0||l===!0||l===void 0&&s[p]!==!1)&&(s[p||f]=re(c))}const o=(c,f)=>a.forEach(c,(l,u)=>i(l,u,f));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Tn(t))o(Rn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(f=c[l])?a.isArray(f)?[...f,u[1]]:[f,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=G(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return On(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=G(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||we(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=G(o),o){const c=a.findKey(r,o);c&&(!n||we(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||we(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=re(s),delete n[i];return}const c=t?An(i):String(i).trim();c!==i&&delete n[i],n[c]=re(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}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,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=G(o);r[c]||(Cn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(T.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(T);function Se(e,t){const n=this||X,r=t||n,s=T.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ve(e){return!!(e&&e.__CANCEL__)}function V(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(V,y,{__CANCEL__:!0});function We(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Nn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),u=r[i];o||(o=l),n[s]=f,r[s]=l;let p=i,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const w=u&&l-u;return w?Math.round(b*1e3/w):void 0}}function Pn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),p=u-n;p>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const se=(e,t,n=3)=>{let r=0;const s=Nn(50,250);return Pn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-r,l=s(f),u=o<=c;r=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Qe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xe=e=>(...t)=>a.asap(()=>e(...t)),kn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Fn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),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 Un(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ln(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ge(e,t,n){let r=!Un(t);return e&&(r||n==!1)?Ln(e,t):t}const Ze=e=>e instanceof T?{...e}:e;function j(e,t){t=t||{};const n={};function r(l,u,p,b){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:b},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,p,b){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,p,b)}else return r(l,u,p,b)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,p){if(p in t)return r(l,u);if(p in e)return r(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,p)=>s(Ze(l),Ze(u),p,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const p=f[u]||s,b=p(e[u],t[u],u);a.isUndefined(b)&&p!==c||(n[u]=b)}),n}const Ke=e=>{const t=j({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=T.from(o),t.url=Me(Ge(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,p])=>{l.includes(u.toLowerCase())&&o.set(u,p)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&kn(t.url))){const f=s&&i&&Fn.read(i);f&&o.set(s,f)}return t},_n=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Ke(e);let i=s.data;const o=T.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,p,b,w,d;function m(){w&&w(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function g(){if(!h)return;const E=T.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),k={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:E,config:e,request:h};We(function(N){n(N),m()},function(N){r(N),m()},k),h=null}"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(g)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){const k=A&&A.message?A.message:"Network Error",H=new y(k,y.ERR_NETWORK,e,h);H.event=A||null,r(H),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||Ve;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,k.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(A,k){h.setRequestHeader(k,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),l&&([b,d]=se(l,!0),h.addEventListener("progress",b)),f&&h.upload&&([p,w]=se(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(u=E=>{h&&(r(!E||E.type?new V(null,e,h):E),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=xn(s.url);if(x&&R.protocols.indexOf(x)===-1){r(new y("Unsupported protocol "+x+":",y.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Bn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof y?u:new V(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},Dn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},jn=async function*(e,t){for await(const n of In(e))yield*Dn(n,t)},In=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ye=(e,t,n,r)=>{const s=jn(e,t);let i=0,o,c=f=>{o||(o=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let p=u.byteLength;if(n){let b=i+=p;n(b)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},et=64*1024,{isFunction:oe}=a,Hn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:tt,TextEncoder:nt}=a.global,rt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$n=e=>{e=a.merge.call({skipUndefined:!0},Hn,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const c=s&&oe(tt),f=s&&(typeof nt=="function"?(d=>m=>d.encode(m))(new nt):async d=>new Uint8Array(await new n(d).arrayBuffer())),l=i&&c&&rt(()=>{let d=!1;const m=new n(R.origin,{body:new tt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),u=o&&c&&rt(()=>a.isReadableStream(new r("").body)),p={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let g=m&&m[d];if(g)return g.call(m);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,h)})});const b=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},w=async(d,m)=>{const h=a.toFiniteNumber(d.getContentLength());return h??b(m)};return async d=>{let{url:m,method:h,data:g,signal:x,cancelToken:E,timeout:A,onDownloadProgress:k,onUploadProgress:H,responseType:N,headers:Te,withCredentials:ce="same-origin",fetchOptions:bt}=Ke(d),wt=t||fetch;N=N?(N+"").toLowerCase():"text";let le=Bn([x,E&&E.toAbortSignal()],A),Z=null;const $=le&&le.unsubscribe&&(()=>{le.unsubscribe()});let St;try{if(H&&l&&h!=="get"&&h!=="head"&&(St=await w(Te,g))!==0){let B=new n(m,{method:"POST",body:g,duplex:"half"}),J;if(a.isFormData(g)&&(J=B.headers.get("content-type"))&&Te.setContentType(J),B.body){const[Ae,ue]=Qe(St,se(Xe(H)));g=Ye(B.body,et,Ae,ue)}}a.isString(ce)||(ce=ce?"include":"omit");const U=i&&"credentials"in n.prototype,gt={...bt,signal:le,method:h.toUpperCase(),headers:Te.normalize().toJSON(),body:g,duplex:"half",credentials:U?ce:void 0};Z=i&&new n(m,gt);let _=await(i?wt(Z,bt):wt(m,gt));const Et=u&&(N==="stream"||N==="response");if(u&&(k||Et&&$)){const B={};["status","statusText","headers"].forEach(Rt=>{B[Rt]=_[Rt]});const J=a.toFiniteNumber(_.headers.get("content-length")),[Ae,ue]=k&&Qe(J,se(Xe(k),!0))||[];_=new r(Ye(_.body,et,Ae,()=>{ue&&ue(),$&&$()}),B)}N=N||"text";let rr=await p[a.findKey(p,N)||"text"](_,d);return!Et&&$&&$(),await new Promise((B,J)=>{We(B,J,{data:rr,headers:T.from(_.headers),status:_.status,statusText:_.statusText,config:d,request:Z})})}catch(U){throw $&&$(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,Z),{cause:U.cause||U}):y.from(U,U&&U.code,d,Z)}}},Mn=new Map,st=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,f,l,u=Mn;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:$n(t)),u=l;return l};st();const ge={http:ln,xhr:_n,fetch:{get:st}};a.forEach(ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ot=e=>`- ${e}`,qn=e=>a.isFunction(e)||e===null||e===!1;function Vn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!qn(r)&&(s=ge[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
|
|
4
4
|
`+o.map(ot).join(`
|
|
5
5
|
`):" "+ot(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const it={getAdapter:Vn,adapters:ge};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function at(e){return Ee(e),e.headers=T.from(e.headers),e.data=Se.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),it.getAdapter(e.adapter||X.adapter,e)(e).then(function(r){return Ee(e),r.data=Se.call(e,e.transformResponse,r),r.headers=T.from(r.headers),r},function(r){return ve(r)||(Ee(e),r&&r.response&&(r.response.data=Se.call(e,e.transformResponse,r.response),r.response.headers=T.from(r.response.headers))),Promise.reject(r)})}const ct="1.13.2",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const lt={};ie.transitional=function(t,n,r){function s(i,o){return"[Axios v"+ct+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!lt[o]&&(lt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},ie.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],f=c===void 0||o(c,i,e);if(f!==!0)throw new y("option "+i+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const ae={assertOptions:zn,validators:ie},F=ae.validators;let I=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qe,response:new qe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ae.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=T.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,p=0,b;if(!f){const d=[at.bind(this),void 0];for(d.unshift(...c),d.push(...l),b=d.length,u=Promise.resolve(n);p<b;)u=u.then(d[p++],d[p++]);return u}b=c.length;let w=n;for(;p<b;){const d=c[p++],m=c[p++];try{w=d(w)}catch(h){m.call(this,h);break}}try{u=at.call(this,w)}catch(d){return Promise.reject(d)}for(p=0,b=l.length;p<b;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=j(this.defaults,t);const n=
|
|
6
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=j(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ae.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=T.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,p=0,b;if(!f){const d=[at.bind(this),void 0];for(d.unshift(...c),d.push(...l),b=d.length,u=Promise.resolve(n);p<b;)u=u.then(d[p++],d[p++]);return u}b=c.length;let w=n;for(;p<b;){const d=c[p++],m=c[p++];try{w=d(w)}catch(h){m.call(this,h);break}}try{u=at.call(this,w)}catch(d){return Promise.reject(d)}for(p=0,b=l.length;p<b;)u=u.then(l[p++],l[p++]);return u}getUri(t){t=j(this.defaults,t);const n=Ge(t.baseURL,t.url,t.allowAbsoluteUrls);return Me(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){I.prototype[t]=function(n,r){return this.request(j(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(j(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}I.prototype[t]=n(),I.prototype[t+"Form"]=n(!0)});let Jn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new V(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function vn(e){return function(n){return e.apply(null,n)}}function Wn(e){return a.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 ut(e){const t=new I(e),n=Ce(I.prototype.request,t);return a.extend(n,I.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ut(j(e,s))},n}const S=ut(X);S.Axios=I,S.CanceledError=V,S.CancelToken=Jn,S.isCancel=ve,S.VERSION=ct,S.toFormData=ne,S.AxiosError=y,S.Cancel=S.CanceledError,S.all=function(t){return Promise.all(t)},S.spread=vn,S.isAxiosError=Wn,S.mergeConfig=j,S.AxiosHeaders=T,S.formToJSON=e=>ze(a.isHTMLForm(e)?new FormData(e):e),S.getAdapter=it.getAdapter,S.HttpStatusCode=Re,S.default=S;const{Axios:ur,AxiosError:fr,CanceledError:dr,isCancel:pr,CancelToken:hr,VERSION:mr,all:yr,Cancel:br,isAxiosError:wr,spread:Sr,toFormData:gr,AxiosHeaders:Er,HttpStatusCode:Rr,formToJSON:Or,getAdapter:Tr,mergeConfig:Ar}=S,Qn={abortController:new AbortController};let Oe=(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:fe&&fe.tagName.toUpperCase()==="SCRIPT"&&fe.src||new URL("index.umd.cjs",document.baseURI).href}<"u",""),ft={};const Xn=e=>{e.backendURL&&(Oe=e.backendURL,z.defaults.baseURL=Oe),e?.axiosCreate&&(ft=e.axiosCreate)},z=S.create({baseURL:Oe,signal:Qn.abortController.signal,...ft??{}}),Gn=e=>{const t=pt(),n=t?.token??null,r=t?.expiresIn??null;if(r){const s=t?.timestamp??null,i=Date.now();if(r&&i-s>r*1e3)return console.warn("Token has expired."),localStorage.removeItem("logginToken"),null}if(e.headers={...e.headers},n&&(e.headers.Authorization=`Bearer ${n}`),e.data instanceof FormData){const s=e.data;e.data=s}else e.data&&(e.data={...e.data??{}});return e};z.interceptors.response.use(e=>e,e=>(console.log("Error.....",e),e.response?.status,Promise.reject(e))),z.interceptors.request.use(Gn,e=>Promise.reject(e));const Zn=async({url:e,method:t,data:n})=>{let r=n??{};try{let s=null;if(t.toLowerCase()==="get"){const o=dt(r??{});s=await z.get(`${e}${o}`)}else s=await z.post(e,r);return s?.data??{Empty:"Empty"}}catch(s){return console.error(s),{success:!1,error:s}}},dt=(e={})=>{try{let t="?";for(let n in e)if(Object.hasOwnProperty.call(e,n)&&e[n])if(Array.isArray(e[n])){const r=e[n];for(const s of r)t+=`${n}[]=${s}&`}else t+=`${n}=${e[n]}&`;return t.slice(0,-1)}catch(t){console.error(t)}};function Kn(e={token:null}){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("setBearerToken expects an object {token} with a 'token' property.");const t={token:null,...e,timestamp:Date.now()};localStorage.setItem("logginToken",JSON.stringify(t))}function pt(){const e=localStorage.getItem("logginToken");try{return e?JSON.parse(e):null}catch(t){return console.error("Invalid token format in localStorage:",t),null}}const ht=e=>{let t;const n=new Set,r=(l,u)=>{const p=typeof l=="function"?l(t):l;if(!Object.is(p,t)){const b=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(w=>w(t,b))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:l=>(n.add(l),()=>n.delete(l))},f=t=e(r,s,c);return c},Yn=(e=>e?ht(e):ht),er=e=>e;function tr(e,t=er){const n=L.useSyncExternalStore(e.subscribe,L.useCallback(()=>t(e.getState()),[e,t]),L.useCallback(()=>t(e.getInitialState()),[e,t]));return L.useDebugValue(n),n}const mt=e=>{const t=Yn(e),n=r=>tr(t,r);return Object.assign(n,t),n},yt=(e=>e?mt(e):mt)((e,t)=>({loading:!1,stateValue:{},checkQueriesInQue:{},isThereAnyDataChangeInAform:!1,setStateValue:(n,r)=>e(s=>({stateValue:{...s.stateValue,[n]:r}})),getStateItem:n=>t().stateValue[n],sleep:n=>new Promise(r=>setTimeout(r,n)),validateLength:n=>Array.isArray(n)?n.length:typeof n=="object"?Object.keys(n).length:0,callApiData:async(n,r,s,i=!1,o=!1)=>{const{checkQueriesInQue:c}=t();if(t().getStateItem("checkQueriesInQue")?.[r]){console.warn(`************************************* dont call this api again ${s.url} 🛩️ *************************************`,s);return}t().setStateValue("loading",!0),t().setStateValue("checkQueriesInQue",{...c,[r]:r});const f=await z(s);return f?.status==200?(e({[n]:f?.data}),t().setStateValue(n,f?.data),o&&sessionStorage.setItem(n,JSON.stringify(f?.data))):console.error(f),t().cleareQueApi(r),e({loading:!1}),f},cleareQueApi:n=>{const s={...t().stateValue.checkQueriesInQue||{}};delete s[n],t().setStateValue("checkQueriesInQue",s)},complatedTheCall:async(n,r,s,i,o,c,f)=>{const l=await n.callApiData(r,s,i,o,c);return l?.status==200?(f&&f(l?.data),l?.data):(f&&f([]),l?.data)},stateGeneratorApi:async({reload:n,stateKey:r,req:s,time:i=0,paginated:o=!1,mStore:c={}},f)=>{e({[r]:[]});const l=JSON.stringify(s);try{const u=c?.mUse,p=t();if(e({loading:!0}),u){const w=JSON.parse(sessionStorage.getItem(r)||"{}");if(p.validateLength(w)&&(f&&f(w),e({[r]:w}),t().setStateValue(r,w),!n))return w}const b=p?.[r]??t().getStateItem(r);return p.validateLength(b)&&f&&f(b),n&&i>0&&setTimeout(()=>{t().complatedTheCall(p,r,l,s,o,u,f)},i*1e3),await t().complatedTheCall(p,r,l,s,o,u,f)}catch(u){const p=state?.[r]??t().getStateItem(r);t().cleareQueApi(l),f&&f(p),console.error(u)}}}));function nr(){return yt()}C.Store=yt,C.default=nr,C.generateParams=dt,C.getBearerToken=pt,C.setBaseURL=Xn,C.setBearerToken=Kn,C.useFetch=Zn,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "septor-store-react",
|
|
3
3
|
"description": "PomStore is a lightweight, flexible global state & API store for React. It simplifies data fetching, caching, and shared state management—without Redux or heavy boilerplate. Built for real-world React apps that need fast data access, request de-duplication, and cache-first loading. PomStore is built on top of Zustand, a lightweight state management library for React.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|