@articles-media/articles-dev-box 1.0.2 → 1.0.4
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/README.md +11 -6
- package/dist/Ad.cjs +1 -0
- package/dist/Ad.js +461 -0
- package/dist/ArticlesAd.cjs +1 -0
- package/dist/ArticlesAd.js +16 -0
- package/dist/Button-CZyAJPvK.cjs +1 -0
- package/dist/Button-g7fiSVpz.js +91 -0
- package/dist/GameScoreboard.cjs +1 -0
- package/dist/GameScoreboard.js +107 -0
- package/dist/ReturnToLauncherButton.cjs +1 -0
- package/dist/ReturnToLauncherButton.js +50 -0
- package/dist/articles-dev-box.css +1 -0
- package/dist/index-CqsCVLvJ.cjs +6 -0
- package/dist/index-CsgQIn35.js +2387 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +14 -0
- package/dist/jsx-runtime-Blz-RjDE.cjs +6 -0
- package/dist/jsx-runtime-tc70JA_2.js +264 -0
- package/package.json +25 -5
- package/index.js +0 -16
- package/src/components/Ads/Ad.jsx +0 -629
- package/src/components/Ads/ArticlesAd.jsx +0 -76
- package/src/components/Games/GameScoreboard.jsx +0 -188
- package/src/components/Games/ReturnToLauncherButton.jsx +0 -55
- package/src/components/UI/Button.js +0 -61
- package/src/hooks/Ads/useAd.js +0 -55
- package/src/hooks/Ads/useAds.js +0 -54
- package/src/hooks/Games/useGameScoreboard.js +0 -59
- package/src/styles/components/Ad.scss +0 -223
- package/src/styles/components/GameScoreboard.scss +0 -37
- package/src/styles/global.scss +0 -98
- package/src/styles/variables.scss +0 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-tc70JA_2.js";
|
|
2
|
+
import { useState as o, useEffect as d } from "react";
|
|
3
|
+
import { A as f } from "./Button-g7fiSVpz.js";
|
|
4
|
+
import { u as x, a as h } from "./index-CsgQIn35.js";
|
|
5
|
+
const j = async (s) => {
|
|
6
|
+
if (process.env.NODE_ENV === "development")
|
|
7
|
+
try {
|
|
8
|
+
return (await h.get("http://localhost:3001/api/community/games/scoreboard", {
|
|
9
|
+
params: {
|
|
10
|
+
game: s.game
|
|
11
|
+
}
|
|
12
|
+
})).data;
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
return h.get(s.url, {
|
|
16
|
+
params: {
|
|
17
|
+
game: s.game
|
|
18
|
+
}
|
|
19
|
+
}).then((a) => a.data);
|
|
20
|
+
}, p = {
|
|
21
|
+
dedupingInterval: 1e3 * 60 * 30,
|
|
22
|
+
refreshInterval: 0,
|
|
23
|
+
revalidateOnFocus: !1,
|
|
24
|
+
revalidateIfStale: !1,
|
|
25
|
+
shouldRetryOnError: !1
|
|
26
|
+
// fallbackData: []
|
|
27
|
+
}, g = (s) => {
|
|
28
|
+
const { data: a, error: r, isLoading: i, isValidating: l, mutate: c } = x(
|
|
29
|
+
s?.game ? {
|
|
30
|
+
// url: "/api/community/games/scoreboard",
|
|
31
|
+
url: "https://articles.media/api/community/games/scoreboard",
|
|
32
|
+
game: s.game
|
|
33
|
+
} : null,
|
|
34
|
+
j,
|
|
35
|
+
p
|
|
36
|
+
);
|
|
37
|
+
return {
|
|
38
|
+
data: a,
|
|
39
|
+
error: r,
|
|
40
|
+
isLoading: i,
|
|
41
|
+
isValidating: l,
|
|
42
|
+
mutate: c
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
function w({ game: s, reloadScoreboard: a, setReloadScoreboard: r }) {
|
|
46
|
+
const [i, l] = o(!1), [c, b] = o(!1), {
|
|
47
|
+
data: n,
|
|
48
|
+
mutate: m
|
|
49
|
+
} = g({
|
|
50
|
+
game: s
|
|
51
|
+
});
|
|
52
|
+
return d(() => {
|
|
53
|
+
}, []), d(() => {
|
|
54
|
+
a && (r(!1), m());
|
|
55
|
+
}, [a]), /* @__PURE__ */ e.jsx("div", { className: "scoreboard", children: /* @__PURE__ */ e.jsxs("div", { className: "card card-articles card-sm mb-3 mb-lg-0", children: [
|
|
56
|
+
/* @__PURE__ */ e.jsxs("div", { className: "card-header d-flex justify-content-between align-items-center", children: [
|
|
57
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
58
|
+
s,
|
|
59
|
+
" Scoreboard"
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ e.jsx(
|
|
62
|
+
f,
|
|
63
|
+
{
|
|
64
|
+
onClick: () => {
|
|
65
|
+
m();
|
|
66
|
+
},
|
|
67
|
+
small: !0,
|
|
68
|
+
children: /* @__PURE__ */ e.jsx("i", { className: "fad fa-redo me-0" })
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ e.jsxs("div", { className: "card-body p-0", children: [
|
|
73
|
+
(n?.length || 0) == 0 && /* @__PURE__ */ e.jsx("div", { className: "small p-2", children: "No scores yet" }),
|
|
74
|
+
n?.map(
|
|
75
|
+
(t, u) => /* @__PURE__ */ e.jsxs("div", { className: "result d-flex flex-column justify-content-between border-bottom p-2", children: [
|
|
76
|
+
/* @__PURE__ */ e.jsxs("div", { className: "d-flex justify-content-between lh-sm", children: [
|
|
77
|
+
/* @__PURE__ */ e.jsxs("div", { className: "d-flex", children: [
|
|
78
|
+
/* @__PURE__ */ e.jsx("h5", { className: "mb-0 me-3", children: u + 1 }),
|
|
79
|
+
/* @__PURE__ */ e.jsx("div", { className: "lh-sm" })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("h5", { className: "mb-0", children: t.score || t.total }) })
|
|
82
|
+
] }),
|
|
83
|
+
t.last_play && t.public_last_play && /* @__PURE__ */ e.jsxs("small", { className: "mt-1", style: { fontSize: "0.75rem" }, children: [
|
|
84
|
+
"Played: ",
|
|
85
|
+
format(new Date(t.last_play), "MM/d/yy hh:mmaa")
|
|
86
|
+
] })
|
|
87
|
+
] }, t._id)
|
|
88
|
+
)
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ e.jsxs("div", { className: "card-footer d-flex justify-content-between align-items-center", children: [
|
|
91
|
+
/* @__PURE__ */ e.jsx("div", { className: "small", children: "Play to get on the board!" }),
|
|
92
|
+
/* @__PURE__ */ e.jsx(
|
|
93
|
+
f,
|
|
94
|
+
{
|
|
95
|
+
small: !0,
|
|
96
|
+
onClick: () => {
|
|
97
|
+
l(!0);
|
|
98
|
+
},
|
|
99
|
+
children: /* @__PURE__ */ e.jsx("i", { className: "fad fa-cog me-0" })
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] })
|
|
103
|
+
] }) });
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
w as default
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-Blz-RjDE.cjs"),s=require("./Button-CZyAJPvK.cjs"),r=require("react");function u(){const[a,n]=r.useState(!1);if(r.useEffect(()=>{n(!0)},[]),!a)return null;const i=new URLSearchParams(window.location.search),o=Object.fromEntries(i);let{launcher_mode:t}=o;return t=t==="1",t?e.jsxRuntimeExports.jsxs(s.ArticlesButton,{className:"w-100",small:!0,style:{zIndex:10,position:"relative"},onClick:()=>{window.location.href="https://games.articles.media"},children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-gamepad"}),"Return to Games"]}):e.jsxRuntimeExports.jsxs(s.ArticlesButton,{className:"w-100",small:!0,style:{zIndex:10,position:"relative"},onClick:()=>{window.location.href="https://games.articles.media"},children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-gamepad"}),"View our other games"]})}module.exports=u;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-tc70JA_2.js";
|
|
2
|
+
import { A as s } from "./Button-g7fiSVpz.js";
|
|
3
|
+
import { useState as i, useEffect as l } from "react";
|
|
4
|
+
function f() {
|
|
5
|
+
const [a, r] = i(!1);
|
|
6
|
+
if (l(() => {
|
|
7
|
+
r(!0);
|
|
8
|
+
}, []), !a)
|
|
9
|
+
return null;
|
|
10
|
+
const o = new URLSearchParams(window.location.search), n = Object.fromEntries(o);
|
|
11
|
+
let { launcher_mode: t } = n;
|
|
12
|
+
return t = t === "1", t ? /* @__PURE__ */ e.jsxs(
|
|
13
|
+
s,
|
|
14
|
+
{
|
|
15
|
+
className: "w-100",
|
|
16
|
+
small: !0,
|
|
17
|
+
style: {
|
|
18
|
+
zIndex: 10,
|
|
19
|
+
position: "relative"
|
|
20
|
+
},
|
|
21
|
+
onClick: () => {
|
|
22
|
+
window.location.href = "https://games.articles.media";
|
|
23
|
+
},
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ e.jsx("i", { className: "fad fa-gamepad" }),
|
|
26
|
+
"Return to Games"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
) : /* @__PURE__ */ e.jsxs(
|
|
30
|
+
s,
|
|
31
|
+
{
|
|
32
|
+
className: "w-100",
|
|
33
|
+
small: !0,
|
|
34
|
+
style: {
|
|
35
|
+
zIndex: 10,
|
|
36
|
+
position: "relative"
|
|
37
|
+
},
|
|
38
|
+
onClick: () => {
|
|
39
|
+
window.location.href = "https://games.articles.media";
|
|
40
|
+
},
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ e.jsx("i", { className: "fad fa-gamepad" }),
|
|
43
|
+
"View our other games"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
f as default
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ad-wrap{z-index:1;margin:0 auto;margin-bottom:1rem;max-width:312px;width:100%}.ad-wrap .ad{position:relative;align-self:flex-start;width:100%;z-index:2;font-family:brandon-grotesque,sans-serif;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003;font-size:14px}@media(max-width:768px){.ad-wrap .ad{font-size:16px;width:100%}}.ad-wrap .ad .main-panel{background-color:var(--articles-ad-background-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));height:400px;display:flex;flex-direction:column}.ad-wrap .ad .main-panel .ad-warning{padding:.1rem .75rem;font-family:brandon-grotesque,sans-serif;font-weight:900;font-size:1rem;border-bottom:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .content-wrap{display:flex;flex-direction:column;align-items:center}@media(min-width:992px){.ad-wrap .ad .main-panel .content-wrap{flex-direction:column}}.ad-wrap .ad .main-panel .photo-banner{position:relative;height:100px;width:100px;flex-shrink:0;display:flex;align-items:center;padding-left:1rem;margin-left:.75rem;margin-left:0rem;height:125px;width:100%}.ad-wrap .ad .main-panel .photo-banner .logo{object-fit:cover;z-index:1}.ad-wrap .ad .main-panel .photo-banner .logo img{width:75px;height:75px;object-fit:contain}.ad-wrap .ad .main-panel .photo-banner .icon{display:none;position:absolute;bottom:-62.5px;left:20px;height:125px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:3.5rem}.ad-wrap .ad .main-panel .photo-banner .photo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.ad-wrap .ad .main-panel .details-wrap{width:100%}.ad-wrap .ad .main-panel .details,.ad-wrap .ad .main-panel .detail-title{padding:.75rem .75rem 0rem;display:grid;grid-gap:5px 5px;grid-template-columns:repeat(2,1fr)}.ad-wrap .ad .main-panel .details .detail .icon,.ad-wrap .ad .main-panel .detail-title .detail .icon{display:inline-block;width:1.5rem}.ad-wrap .ad .main-panel .details .detail .icon i,.ad-wrap .ad .main-panel .detail-title .detail .icon i{justify-content:flex-start;display:flex}.ad-wrap .ad .main-panel .short-description{padding:.25rem .75rem 0rem;min-height:50px;overflow-y:auto;max-height:125px}.ad-wrap .ad .main-panel .detail-title{display:flex;justify-content:space-between;align-items:center}.ad-wrap .ad .main-panel .action-wrap{border-top:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .action-wrap .action{padding:.25rem;display:flex;justify-content:center;align-items:center;border:1px solid var(--articles-ad-border-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));border-radius:10px;margin-left:auto;margin-right:auto;cursor:pointer;transition-duration:.2s}.ad-wrap .ad .main-panel .action-wrap .action:hover{background-color:#fff;color:#000}.ad-wrap .ad .main-panel .action-wrap .action:active{background-color:gray}.ad-wrap .advertise-with-us{background-color:var(--articles-ad-background-color, var(--card-background));border-top:2px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .advertise-with-us a{color:var(--articles-ad-font-color, var(--bs-body-color))!important}:root{--articles-theme-primary: #f9edcd}.shadow-articles{box-shadow:0 0 0 1px #0000004d,0 2px 3px #0003;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003}.text-center{text-align:center}.d-flex{display:flex}.flex-header{display:flex;justify-content:space-between;align-items:center}.scoreboard{margin-top:1rem;max-width:300px;width:100%;margin-bottom:1rem}@media(min-width:992px){.scoreboard{margin-top:0rem;margin-bottom:0rem;display:block;position:absolute;left:1rem;top:50%;transform:translateY(-50%)}}.articles-game-scoreboard{border:1px solid rgb(206,212,218);border-radius:8px;box-shadow:#00000012 0 2px 8px;color:#222;width:100%;max-width:350px;margin:0px 1rem;overflow:hidden;display:flex;flex-direction:column;z-index:1;position:fixed;bottom:50%;transform:translateY(50%);left:8px}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const x=require("react");function Qt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Un}=Object.prototype,{getPrototypeOf:ht}=Object,{iterator:je,toStringTag:Zt}=Symbol,ke=(e=>t=>{const n=Un.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),X=e=>(e=e.toLowerCase(),t=>ke(t)===e),qe=e=>t=>typeof t===e,{isArray:we}=Array,ye=qe("undefined");function Oe(e){return e!==null&&!ye(e)&&e.constructor!==null&&!ye(e.constructor)&&q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const en=X("ArrayBuffer");function In(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&en(e.buffer),t}const Bn=qe("string"),q=qe("function"),tn=qe("number"),Te=e=>e!==null&&typeof e=="object",jn=e=>e===!0||e===!1,ve=e=>{if(ke(e)!=="object")return!1;const t=ht(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Zt in e)&&!(je in e)},kn=e=>{if(!Te(e)||Oe(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},qn=X("Date"),Hn=X("File"),Mn=X("Blob"),Vn=X("FileList"),$n=e=>Te(e)&&q(e.pipe),Wn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||q(e.append)&&((t=ke(e))==="formdata"||t==="object"&&q(e.toString)&&e.toString()==="[object FormData]"))},zn=X("URLSearchParams"),[Jn,Kn,Gn,Xn]=["ReadableStream","Request","Response","Headers"].map(X),Yn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ae(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),we(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Oe(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function nn(e,t){if(Oe(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 fe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rn=e=>!ye(e)&&e!==fe;function nt(){const{caseless:e,skipUndefined:t}=rn(this)&&this||{},n={},r=(s,i)=>{const o=e&&nn(n,i)||i;ve(n[o])&&ve(s)?n[o]=nt(n[o],s):ve(s)?n[o]=nt({},s):we(s)?n[o]=s.slice():(!t||!ye(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Ae(arguments[s],r);return n}const Qn=(e,t,n,{allOwnKeys:r}={})=>(Ae(t,(s,i)=>{n&&q(s)?e[i]=Qt(s,n):e[i]=s},{allOwnKeys:r}),e),Zn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),er=(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)},tr=(e,t,n,r)=>{let s,i,o;const a={};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))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&ht(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},nr=(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},rr=e=>{if(!e)return null;if(we(e))return e;let t=e.length;if(!tn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},sr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ht(Uint8Array)),or=(e,t)=>{const r=(e&&e[je]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},ir=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ar=X("HTMLFormElement"),cr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),_t=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ur=X("RegExp"),sn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ae(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},lr=e=>{sn(e,(t,n)=>{if(q(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(q(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+"'")})}})},fr=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return we(e)?r(e):r(String(e).split(t)),n},dr=()=>{},pr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function hr(e){return!!(e&&q(e.append)&&e[Zt]==="FormData"&&e[je])}const mr=e=>{const t=new Array(10),n=(r,s)=>{if(Te(r)){if(t.indexOf(r)>=0)return;if(Oe(r))return r;if(!("toJSON"in r)){t[s]=r;const i=we(r)?[]:{};return Ae(r,(o,a)=>{const d=n(o,s+1);!ye(d)&&(i[a]=d)}),t[s]=void 0,i}}return r};return n(e,0)},Er=X("AsyncFunction"),yr=e=>e&&(Te(e)||q(e))&&q(e.then)&&q(e.catch),on=((e,t)=>e?setImmediate:t?((n,r)=>(fe.addEventListener("message",({source:s,data:i})=>{s===fe&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),fe.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",q(fe.postMessage)),wr=typeof queueMicrotask<"u"?queueMicrotask.bind(fe):typeof process<"u"&&process.nextTick||on,Sr=e=>e!=null&&q(e[je]),c={isArray:we,isArrayBuffer:en,isBuffer:Oe,isFormData:Wn,isArrayBufferView:In,isString:Bn,isNumber:tn,isBoolean:jn,isObject:Te,isPlainObject:ve,isEmptyObject:kn,isReadableStream:Jn,isRequest:Kn,isResponse:Gn,isHeaders:Xn,isUndefined:ye,isDate:qn,isFile:Hn,isBlob:Mn,isRegExp:ur,isFunction:q,isStream:$n,isURLSearchParams:zn,isTypedArray:sr,isFileList:Vn,forEach:Ae,merge:nt,extend:Qn,trim:Yn,stripBOM:Zn,inherits:er,toFlatObject:tr,kindOf:ke,kindOfTest:X,endsWith:nr,toArray:rr,forEachEntry:or,matchAll:ir,isHTMLForm:ar,hasOwnProperty:_t,hasOwnProp:_t,reduceDescriptors:sn,freezeMethods:lr,toObjectSet:fr,toCamelCase:cr,noop:dr,toFiniteNumber:pr,findKey:nn,global:fe,isContextDefined:rn,isSpecCompliantForm:hr,toJSONObject:mr,isAsyncFn:Er,isThenable:yr,setImmediate:on,asap:wr,isIterable:Sr};function S(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)}c.inherits(S,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:c.toJSONObject(this.config),code:this.code,status:this.status}}});const an=S.prototype,cn={};["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=>{cn[e]={value:e}});Object.defineProperties(S,cn);Object.defineProperty(an,"isAxiosError",{value:!0});S.from=(e,t,n,r,s,i)=>{const o=Object.create(an);c.toFlatObject(e,o,function(l){return l!==Error.prototype},f=>f!=="isAxiosError");const a=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return S.call(o,a,d,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 br=null;function rt(e){return c.isPlainObject(e)||c.isArray(e)}function un(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ct(e,t,n){return e?e.concat(t).map(function(s,i){return s=un(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function gr(e){return c.isArray(e)&&!e.some(rt)}const Rr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function He(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!c.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function f(u){if(u===null)return"";if(c.isDate(u))return u.toISOString();if(c.isBoolean(u))return u.toString();if(!d&&c.isBlob(u))throw new S("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(u)||c.isTypedArray(u)?d&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function l(u,m,h){let b=u;if(u&&!h&&typeof u=="object"){if(c.endsWith(m,"{}"))m=r?m:m.slice(0,-2),u=JSON.stringify(u);else if(c.isArray(u)&&gr(u)||(c.isFileList(u)||c.endsWith(m,"[]"))&&(b=c.toArray(u)))return m=un(m),b.forEach(function(A,D){!(c.isUndefined(A)||A===null)&&t.append(o===!0?Ct([m],D,i):o===null?m:m+"[]",f(A))}),!1}return rt(u)?!0:(t.append(Ct(h,m,i),f(u)),!1)}const p=[],E=Object.assign(Rr,{defaultVisitor:l,convertValue:f,isVisitable:rt});function y(u,m){if(!c.isUndefined(u)){if(p.indexOf(u)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(u),c.forEach(u,function(b,w){(!(c.isUndefined(b)||b===null)&&s.call(t,b,c.isString(w)?w.trim():w,m,E))===!0&&y(b,m?m.concat(w):[w])}),p.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return y(e),t}function xt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function mt(e,t){this._pairs=[],e&&He(e,this,t)}const ln=mt.prototype;ln.append=function(t,n){this._pairs.push([t,n])};ln.toString=function(t){const n=t?function(r){return t.call(this,r,xt)}:xt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Or(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fn(e,t,n){if(!t)return e;const r=n&&n.encode||Or;c.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=c.isURLSearchParams(t)?t.toString():new mt(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Dt{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){c.forEach(this.handlers,function(r){r!==null&&t(r)})}}const dn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Tr=typeof URLSearchParams<"u"?URLSearchParams:mt,Ar=typeof FormData<"u"?FormData:null,_r=typeof Blob<"u"?Blob:null,Cr={isBrowser:!0,classes:{URLSearchParams:Tr,FormData:Ar,Blob:_r},protocols:["http","https","file","blob","url","data"]},Et=typeof window<"u"&&typeof document<"u",st=typeof navigator=="object"&&navigator||void 0,xr=Et&&(!st||["ReactNative","NativeScript","NS"].indexOf(st.product)<0),Dr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Lr=Et&&window.location.href||"http://localhost",Nr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Et,hasStandardBrowserEnv:xr,hasStandardBrowserWebWorkerEnv:Dr,navigator:st,origin:Lr},Symbol.toStringTag,{value:"Module"})),B={...Nr,...Cr};function Fr(e,t){return He(e,new B.classes.URLSearchParams,{visitor:function(n,r,s,i){return B.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Pr(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vr(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 pn(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),d=i>=n.length;return o=!o&&c.isArray(s)?s.length:o,d?(c.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!c.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&c.isArray(s[o])&&(s[o]=vr(s[o])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(r,s)=>{t(Pr(r),s,n,0)}),n}return null}function Ur(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const _e={transitional:dn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(pn(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Fr(t,this.formSerializer).toString();if((a=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return He(a?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Ur(t)):t}],transformResponse:[function(t){const n=this.transitional||_e.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?S.from(a,S.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{_e.headers[e]={}});const Ir=c.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"]),Br=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]&&Ir[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Lt=Symbol("internals");function Re(e){return e&&String(e).trim().toLowerCase()}function Ue(e){return e===!1||e==null?e:c.isArray(e)?e.map(Ue):String(e)}function jr(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 kr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function We(e,t,n,r,s){if(c.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!c.isString(t)){if(c.isString(r))return t.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(t)}}function qr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Hr(e,t){const n=c.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 H=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(a,d,f){const l=Re(d);if(!l)throw new Error("header name must be a non-empty string");const p=c.findKey(s,l);(!p||s[p]===void 0||f===!0||f===void 0&&s[p]!==!1)&&(s[p||d]=Ue(a))}const o=(a,d)=>c.forEach(a,(f,l)=>i(f,l,d));if(c.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(c.isString(t)&&(t=t.trim())&&!kr(t))o(Br(t),n);else if(c.isObject(t)&&c.isIterable(t)){let a={},d,f;for(const l of t){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[f=l[0]]=(d=a[f])?c.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}o(a,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Re(t),t){const r=c.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return jr(s);if(c.isFunction(n))return n.call(this,s,r);if(c.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Re(t),t){const r=c.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=Re(o),o){const a=c.findKey(r,o);a&&(!n||We(r,r[a],a,n))&&(delete r[a],s=!0)}}return c.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 c.forEach(this,(s,i)=>{const o=c.findKey(r,i);if(o){n[o]=Ue(s),delete n[i];return}const a=t?qr(i):String(i).trim();a!==i&&delete n[i],n[a]=Ue(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return c.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&c.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[Lt]=this[Lt]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=Re(o);r[a]||(Hr(s,o),r[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};H.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(H.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});c.freezeMethods(H);function ze(e,t){const n=this||_e,r=t||n,s=H.from(r.headers);let i=r.data;return c.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function hn(e){return!!(e&&e.__CANCEL__)}function Se(e,t,n){S.call(this,e??"canceled",S.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits(Se,S,{__CANCEL__:!0});function mn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new S("Request failed with status code "+n.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Mr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vr(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(d){const f=Date.now(),l=r[i];o||(o=f),n[s]=d,r[s]=f;let p=i,E=0;for(;p!==s;)E+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),f-o<t)return;const y=l&&f-l;return y?Math.round(E*1e3/y):void 0}}function $r(e,t){let n=0,r=1e3/t,s,i;const o=(f,l=Date.now())=>{n=l,s=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{const l=Date.now(),p=l-n;p>=r?o(f,l):(s=f,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const Be=(e,t,n=3)=>{let r=0;const s=Vr(50,250);return $r(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,d=o-r,f=s(d),l=o<=a;r=o;const p={loaded:o,total:a,progress:a?o/a:void 0,bytes:d,rate:f||void 0,estimated:f&&a&&l?(a-o)/f:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},Nt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ft=e=>(...t)=>c.asap(()=>e(...t)),Wr=B.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,B.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0,zr=B.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),c.isString(r)&&a.push(`path=${r}`),c.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),c.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.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 Jr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Kr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function En(e,t,n){let r=!Jr(t);return e&&(r||n==!1)?Kr(e,t):t}const Pt=e=>e instanceof H?{...e}:e;function pe(e,t){t=t||{};const n={};function r(f,l,p,E){return c.isPlainObject(f)&&c.isPlainObject(l)?c.merge.call({caseless:E},f,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function s(f,l,p,E){if(c.isUndefined(l)){if(!c.isUndefined(f))return r(void 0,f,p,E)}else return r(f,l,p,E)}function i(f,l){if(!c.isUndefined(l))return r(void 0,l)}function o(f,l){if(c.isUndefined(l)){if(!c.isUndefined(f))return r(void 0,f)}else return r(void 0,l)}function a(f,l,p){if(p in t)return r(f,l);if(p in e)return r(void 0,f)}const d={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:a,headers:(f,l,p)=>s(Pt(f),Pt(l),p,!0)};return c.forEach(Object.keys({...e,...t}),function(l){const p=d[l]||s,E=p(e[l],t[l],l);c.isUndefined(E)&&p!==a||(n[l]=E)}),n}const yn=e=>{const t=pe({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=t;if(t.headers=o=H.from(o),t.url=fn(En(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([l,p])=>{f.includes(l.toLowerCase())&&o.set(l,p)})}}if(B.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&Wr(t.url))){const d=s&&i&&zr.read(i);d&&o.set(s,d)}return t},Gr=typeof XMLHttpRequest<"u",Xr=Gr&&function(e){return new Promise(function(n,r){const s=yn(e);let i=s.data;const o=H.from(s.headers).normalize();let{responseType:a,onUploadProgress:d,onDownloadProgress:f}=s,l,p,E,y,u;function m(){y&&y(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function b(){if(!h)return;const A=H.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:A,config:e,request:h};mn(function(_){n(_),m()},function(_){r(_),m()},R),h=null}"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(b)},h.onabort=function(){h&&(r(new S("Request aborted",S.ECONNABORTED,e,h)),h=null)},h.onerror=function(D){const R=D&&D.message?D.message:"Network Error",v=new S(R,S.ERR_NETWORK,e,h);v.event=D||null,r(v),h=null},h.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||dn;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),r(new S(D,R.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&c.forEach(o.toJSON(),function(D,R){h.setRequestHeader(R,D)}),c.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),a&&a!=="json"&&(h.responseType=s.responseType),f&&([E,u]=Be(f,!0),h.addEventListener("progress",E)),d&&h.upload&&([p,y]=Be(d),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",y)),(s.cancelToken||s.signal)&&(l=A=>{h&&(r(!A||A.type?new Se(null,e,h):A),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const w=Mr(s.url);if(w&&B.protocols.indexOf(w)===-1){r(new S("Unsupported protocol "+w+":",S.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Yr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(f){if(!s){s=!0,a();const l=f instanceof Error?f:this.reason;r.abort(l instanceof S?l:new Se(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new S(`timeout ${t} of ms exceeded`,S.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>c.asap(a),d}},Qr=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},Zr=async function*(e,t){for await(const n of es(e))yield*Qr(n,t)},es=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()}},vt=(e,t,n,r)=>{const s=Zr(e,t);let i=0,o,a=d=>{o||(o=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:l}=await s.next();if(f){a(),d.close();return}let p=l.byteLength;if(n){let E=i+=p;n(E)}d.enqueue(new Uint8Array(l))}catch(f){throw a(f),f}},cancel(d){return a(d),s.return()}},{highWaterMark:2})},Ut=64*1024,{isFunction:Le}=c,ts=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:It,TextEncoder:Bt}=c.global,jt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ns=e=>{e=c.merge.call({skipUndefined:!0},ts,e);const{fetch:t,Request:n,Response:r}=e,s=t?Le(t):typeof fetch=="function",i=Le(n),o=Le(r);if(!s)return!1;const a=s&&Le(It),d=s&&(typeof Bt=="function"?(u=>m=>u.encode(m))(new Bt):async u=>new Uint8Array(await new n(u).arrayBuffer())),f=i&&a&&jt(()=>{let u=!1;const m=new n(B.origin,{body:new It,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!m}),l=o&&a&&jt(()=>c.isReadableStream(new r("").body)),p={stream:l&&(u=>u.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!p[u]&&(p[u]=(m,h)=>{let b=m&&m[u];if(b)return b.call(m);throw new S(`Response type '${u}' is not supported`,S.ERR_NOT_SUPPORT,h)})});const E=async u=>{if(u==null)return 0;if(c.isBlob(u))return u.size;if(c.isSpecCompliantForm(u))return(await new n(B.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(c.isArrayBufferView(u)||c.isArrayBuffer(u))return u.byteLength;if(c.isURLSearchParams(u)&&(u=u+""),c.isString(u))return(await d(u)).byteLength},y=async(u,m)=>{const h=c.toFiniteNumber(u.getContentLength());return h??E(m)};return async u=>{let{url:m,method:h,data:b,signal:w,cancelToken:A,timeout:D,onDownloadProgress:R,onUploadProgress:v,responseType:_,headers:Y,withCredentials:O="same-origin",fetchOptions:te}=yn(u),M=t||fetch;_=_?(_+"").toLowerCase():"text";let z=Yr([w,A&&A.toAbortSignal()],D),V=null;const P=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let ne;try{if(v&&f&&h!=="get"&&h!=="head"&&(ne=await y(Y,b))!==0){let Q=new n(m,{method:"POST",body:b,duplex:"half"}),$;if(c.isFormData(b)&&($=Q.headers.get("content-type"))&&Y.setContentType($),Q.body){const[K,se]=Nt(ne,Be(Ft(v)));b=vt(Q.body,Ut,K,se)}}c.isString(O)||(O=O?"include":"omit");const j=i&&"credentials"in n.prototype,be={...te,signal:z,method:h.toUpperCase(),headers:Y.normalize().toJSON(),body:b,duplex:"half",credentials:j?O:void 0};V=i&&new n(m,be);let J=await(i?M(V,te):M(m,be));const re=l&&(_==="stream"||_==="response");if(l&&(R||re&&P)){const Q={};["status","statusText","headers"].forEach(he=>{Q[he]=J[he]});const $=c.toFiniteNumber(J.headers.get("content-length")),[K,se]=R&&Nt($,Be(Ft(R),!0))||[];J=new r(vt(J.body,Ut,K,()=>{se&&se(),P&&P()}),Q)}_=_||"text";let xe=await p[c.findKey(p,_)||"text"](J,u);return!re&&P&&P(),await new Promise((Q,$)=>{mn(Q,$,{data:xe,headers:H.from(J.headers),status:J.status,statusText:J.statusText,config:u,request:V})})}catch(j){throw P&&P(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new S("Network Error",S.ERR_NETWORK,u,V),{cause:j.cause||j}):S.from(j,j&&j.code,u,V)}}},rs=new Map,wn=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,a=o,d,f,l=rs;for(;a--;)d=i[a],f=l.get(d),f===void 0&&l.set(d,f=a?new Map:ns(t)),l=f;return f};wn();const yt={http:br,xhr:Xr,fetch:{get:wn}};c.forEach(yt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const kt=e=>`- ${e}`,ss=e=>c.isFunction(e)||e===null||e===!1;function os(e,t){e=c.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let a;if(s=r,!ss(r)&&(s=yt[(a=String(r)).toLowerCase()],s===void 0))throw new S(`Unknown adapter '${a}'`);if(s&&(c.isFunction(s)||(s=s.get(t))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since :
|
|
4
|
+
`+o.map(kt).join(`
|
|
5
|
+
`):" "+kt(o[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const Sn={getAdapter:os,adapters:yt};function Je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Se(null,e)}function qt(e){return Je(e),e.headers=H.from(e.headers),e.data=ze.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Sn.getAdapter(e.adapter||_e.adapter,e)(e).then(function(r){return Je(e),r.data=ze.call(e,e.transformResponse,r),r.headers=H.from(r.headers),r},function(r){return hn(r)||(Je(e),r&&r.response&&(r.response.data=ze.call(e,e.transformResponse,r.response),r.response.headers=H.from(r.response.headers))),Promise.reject(r)})}const bn="1.13.2",Me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Me[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ht={};Me.transitional=function(t,n,r){function s(i,o){return"[Axios v"+bn+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(t===!1)throw new S(s(o," has been removed"+(n?" in "+n:"")),S.ERR_DEPRECATED);return n&&!Ht[o]&&(Ht[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,a):!0}};Me.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function is(e,t,n){if(typeof e!="object")throw new S("options must be an object",S.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 a=e[i],d=a===void 0||o(a,i,e);if(d!==!0)throw new S("option "+i+" must be "+d,S.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new S("Unknown option "+i,S.ERR_BAD_OPTION)}}const Ie={assertOptions:is,validators:Me},Z=Ie.validators;let de=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Dt,response:new Dt}}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=pe(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Ie.assertOptions(r,{silentJSONParsing:Z.transitional(Z.boolean),forcedJSONParsing:Z.transitional(Z.boolean),clarifyTimeoutError:Z.transitional(Z.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:Ie.assertOptions(s,{encode:Z.function,serialize:Z.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ie.assertOptions(n,{baseUrl:Z.spelling("baseURL"),withXsrfToken:Z.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&c.merge(i.common,i[n.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u]}),n.headers=H.concat(o,i);const a=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(d=d&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const f=[];this.interceptors.response.forEach(function(m){f.push(m.fulfilled,m.rejected)});let l,p=0,E;if(!d){const u=[qt.bind(this),void 0];for(u.unshift(...a),u.push(...f),E=u.length,l=Promise.resolve(n);p<E;)l=l.then(u[p++],u[p++]);return l}E=a.length;let y=n;for(;p<E;){const u=a[p++],m=a[p++];try{y=u(y)}catch(h){m.call(this,h);break}}try{l=qt.call(this,y)}catch(u){return Promise.reject(u)}for(p=0,E=f.length;p<E;)l=l.then(f[p++],f[p++]);return l}getUri(t){t=pe(this.defaults,t);const n=En(t.baseURL,t.url,t.allowAbsoluteUrls);return fn(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){de.prototype[t]=function(n,r){return this.request(pe(r||{},{method:t,url:n,data:(r||{}).data}))}});c.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(pe(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}de.prototype[t]=n(),de.prototype[t+"Form"]=n(!0)});let as=class gn{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(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new Se(i,o,a),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 gn(function(s){t=s}),cancel:t}}};function cs(e){return function(n){return e.apply(null,n)}}function us(e){return c.isObject(e)&&e.isAxiosError===!0}const ot={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(ot).forEach(([e,t])=>{ot[t]=e});function Rn(e){const t=new de(e),n=Qt(de.prototype.request,t);return c.extend(n,de.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Rn(pe(e,s))},n}const N=Rn(_e);N.Axios=de;N.CanceledError=Se;N.CancelToken=as;N.isCancel=hn;N.VERSION=bn;N.toFormData=He;N.AxiosError=S;N.Cancel=N.CanceledError;N.all=function(t){return Promise.all(t)};N.spread=cs;N.isAxiosError=us;N.mergeConfig=pe;N.AxiosHeaders=H;N.formToJSON=e=>pn(c.isHTMLForm(e)?new FormData(e):e);N.getAdapter=Sn.getAdapter;N.HttpStatusCode=ot;N.default=N;const{Axios:zs,AxiosError:Js,CanceledError:Ks,isCancel:Gs,CancelToken:Xs,VERSION:Ys,all:Qs,Cancel:Zs,isAxiosError:eo,spread:to,toFormData:no,AxiosHeaders:ro,HttpStatusCode:so,formToJSON:oo,getAdapter:io,mergeConfig:ao}=N;var Ne={exports:{}},Ke={};var Mt;function ls(){if(Mt)return Ke;Mt=1;var e=x;function t(p,E){return p===E&&(p!==0||1/p===1/E)||p!==p&&E!==E}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(p,E){var y=E(),u=r({inst:{value:y,getSnapshot:E}}),m=u[0].inst,h=u[1];return i(function(){m.value=y,m.getSnapshot=E,d(m)&&h({inst:m})},[p,y,E]),s(function(){return d(m)&&h({inst:m}),p(function(){d(m)&&h({inst:m})})},[p]),o(y),y}function d(p){var E=p.getSnapshot;p=p.value;try{var y=E();return!n(p,y)}catch{return!0}}function f(p,E){return E()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:a;return Ke.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Ke}var Ge={};var Vt;function fs(){return Vt||(Vt=1,process.env.NODE_ENV!=="production"&&(function(){function e(y,u){return y===u&&(y!==0||1/y===1/u)||y!==y&&u!==u}function t(y,u){l||s.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=u();if(!p){var h=u();i(m,h)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}h=o({inst:{value:m,getSnapshot:u}});var b=h[0].inst,w=h[1];return d(function(){b.value=m,b.getSnapshot=u,n(b)&&w({inst:b})},[y,m,u]),a(function(){return n(b)&&w({inst:b}),y(function(){n(b)&&w({inst:b})})},[y]),f(m),m}function n(y){var u=y.getSnapshot;y=y.value;try{var m=u();return!i(y,m)}catch{return!0}}function r(y,u){return u()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=x,i=typeof Object.is=="function"?Object.is:e,o=s.useState,a=s.useEffect,d=s.useLayoutEffect,f=s.useDebugValue,l=!1,p=!1,E=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Ge.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:E,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ge}var $t;function ds(){return $t||($t=1,process.env.NODE_ENV==="production"?Ne.exports=ls():Ne.exports=fs()),Ne.exports}var Wt=ds();const On=0,Tn=1,An=2,zt=3;var Jt=Object.prototype.hasOwnProperty;function it(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&it(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Jt.call(e,n)&&++r&&!Jt.call(t,n)||!(n in t)||!it(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ae=new WeakMap,ce=()=>{},I=ce(),at=Object,g=e=>e===I,ee=e=>typeof e=="function",ue=(e,t)=>({...e,...t}),_n=e=>ee(e.then),Xe={},Fe={},wt="undefined",Ce=typeof window!=wt,ct=typeof document!=wt,ps=Ce&&"Deno"in window,hs=()=>Ce&&typeof window.requestAnimationFrame!=wt,Cn=(e,t)=>{const n=ae.get(e);return[()=>!g(t)&&e.get(t)||Xe,r=>{if(!g(t)){const s=e.get(t);t in Fe||(Fe[t]=s),n[5](t,ue(s,r),s||Xe)}},n[6],()=>!g(t)&&t in Fe?Fe[t]:!g(t)&&e.get(t)||Xe]};let ut=!0;const ms=()=>ut,[lt,ft]=Ce&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ce,ce],Es=()=>{const e=ct&&document.visibilityState;return g(e)||e!=="hidden"},ys=e=>(ct&&document.addEventListener("visibilitychange",e),lt("focus",e),()=>{ct&&document.removeEventListener("visibilitychange",e),ft("focus",e)}),ws=e=>{const t=()=>{ut=!0,e()},n=()=>{ut=!1};return lt("online",t),lt("offline",n),()=>{ft("online",t),ft("offline",n)}},Ss={isOnline:ms,isVisible:Es},bs={initFocus:ys,initReconnect:ws},Kt=!x.useId,Ee=!Ce||ps,gs=e=>hs()?window.requestAnimationFrame(e):setTimeout(e,1),Ye=Ee?x.useEffect:x.useLayoutEffect,Qe=typeof navigator<"u"&&navigator.connection,Gt=!Ee&&Qe&&(["slow-2g","2g"].includes(Qe.effectiveType)||Qe.saveData),Pe=new WeakMap,Rs=e=>at.prototype.toString.call(e),Ze=(e,t)=>e===`[object ${t}]`;let Os=0;const dt=e=>{const t=typeof e,n=Rs(e),r=Ze(n,"Date"),s=Ze(n,"RegExp"),i=Ze(n,"Object");let o,a;if(at(e)===e&&!r&&!s){if(o=Pe.get(e),o)return o;if(o=++Os+"~",Pe.set(e,o),Array.isArray(e)){for(o="@",a=0;a<e.length;a++)o+=dt(e[a])+",";Pe.set(e,o)}if(i){o="#";const d=at.keys(e).sort();for(;!g(a=d.pop());)g(e[a])||(o+=a+":"+dt(e[a])+",");Pe.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},St=e=>{if(ee(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?dt(e):"",[e,t]};let Ts=0;const pt=()=>++Ts;async function xn(...e){const[t,n,r,s]=e,i=ue({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=i.populateCache;const a=i.rollbackOnError;let d=i.optimisticData;const f=E=>typeof a=="function"?a(E):a!==!1,l=i.throwOnError;if(ee(n)){const E=n,y=[],u=t.keys();for(const m of u)!/^\$(inf|sub)\$/.test(m)&&E(t.get(m)._k)&&y.push(m);return Promise.all(y.map(p))}return p(n);async function p(E){const[y]=St(E);if(!y)return;const[u,m]=Cn(t,y),[h,b,w,A]=ae.get(t),D=()=>{const P=h[y];return(ee(i.revalidate)?i.revalidate(u().data,E):i.revalidate!==!1)&&(delete w[y],delete A[y],P&&P[0])?P[0](An).then(()=>u().data):u().data};if(e.length<3)return D();let R=r,v,_=!1;const Y=pt();b[y]=[Y,0];const O=!g(d),te=u(),M=te.data,z=te._c,V=g(z)?M:z;if(O&&(d=ee(d)?d(V,M):d,m({data:d,_c:V})),ee(R))try{R=R(V)}catch(P){v=P,_=!0}if(R&&_n(R))if(R=await R.catch(P=>{v=P,_=!0}),Y!==b[y][0]){if(_)throw v;return R}else _&&O&&f(v)&&(o=!0,m({data:V,_c:I}));if(o&&!_)if(ee(o)){const P=o(R,V);m({data:P,error:I,_c:I})}else m({data:R,error:I,_c:I});if(b[y][1]=pt(),Promise.resolve(D()).then(()=>{m({_c:I})}),_){if(l)throw v;return}return R}}const Xt=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},As=(e,t)=>{if(!ae.has(e)){const n=ue(bs,t),r=Object.create(null),s=xn.bind(I,e);let i=ce;const o=Object.create(null),a=(l,p)=>{const E=o[l]||[];return o[l]=E,E.push(p),()=>E.splice(E.indexOf(p),1)},d=(l,p,E)=>{e.set(l,p);const y=o[l];if(y)for(const u of y)u(p,E)},f=()=>{if(!ae.has(e)&&(ae.set(e,[r,Object.create(null),Object.create(null),Object.create(null),s,d,a]),!Ee)){const l=n.initFocus(setTimeout.bind(I,Xt.bind(I,r,On))),p=n.initReconnect(setTimeout.bind(I,Xt.bind(I,r,Tn)));i=()=>{l&&l(),p&&p(),ae.delete(e)}}};return f(),[e,s,f,i]}return[e,ae.get(e)[4]]},_s=(e,t,n,r,s)=>{const i=n.errorRetryCount,o=s.retryCount,a=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!g(i)&&o>i||setTimeout(r,a,s)},Cs=it,[Dn,xs]=As(new Map),Ds=ue({onLoadingSlow:ce,onSuccess:ce,onError:ce,onErrorRetry:_s,onDiscarded:ce,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Gt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Gt?5e3:3e3,compare:Cs,isPaused:()=>!1,cache:Dn,mutate:xs,fallback:{}},Ss),Ls=(e,t)=>{const n=ue(e,t);if(t){const{use:r,fallback:s}=e,{use:i,fallback:o}=t;r&&i&&(n.use=r.concat(i)),s&&o&&(n.fallback=ue(s,o))}return n},Ns=x.createContext({}),Fs="$inf$",Ln=Ce&&window.__SWR_DEVTOOLS_USE__,Ps=Ln?window.__SWR_DEVTOOLS_USE__:[],vs=()=>{Ln&&(window.__SWR_DEVTOOLS_REACT__=x)},Us=e=>ee(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Is=()=>{const e=x.useContext(Ns);return x.useMemo(()=>ue(Ds,e),[e])},Bs=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=St(t),[,,,a]=ae.get(Dn);if(o.startsWith(Fs))return n(...i);const d=a[o];return g(d)?n(...i):(delete a[o],d)}),r),js=Ps.concat(Bs),ks=e=>function(...n){const r=Is(),[s,i,o]=Us(n),a=Ls(r,o);let d=e;const{use:f}=a,l=(f||[]).concat(js);for(let p=l.length;p--;)d=l[p](d);return d(s,i||a.fetcher||null,a)},qs=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const s=r.indexOf(n);s>=0&&(r[s]=r[r.length-1],r.pop())}};vs();const et=x.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),tt={dedupe:!0},Yt=Promise.resolve(I),Hs=(e,t,n)=>{const{cache:r,compare:s,suspense:i,fallbackData:o,revalidateOnMount:a,revalidateIfStale:d,refreshInterval:f,refreshWhenHidden:l,refreshWhenOffline:p,keepPreviousData:E,strictServerPrefetchWarning:y}=n,[u,m,h,b]=ae.get(r),[w,A]=St(e),D=x.useRef(!1),R=x.useRef(!1),v=x.useRef(w),_=x.useRef(t),Y=x.useRef(n),O=()=>Y.current,te=()=>O().isVisible()&&O().isOnline(),[M,z,V,P]=Cn(r,w),ne=x.useRef({}).current,j=g(o)?g(n.fallback)?I:n.fallback[w]:o,be=(T,C)=>{for(const F in ne){const L=F;if(L==="data"){if(!s(T[L],C[L])&&(!g(T[L])||!s(De,C[L])))return!1}else if(C[L]!==T[L])return!1}return!0},J=x.useMemo(()=>{const T=!w||!t?!1:g(a)?O().isPaused()||i?!1:d!==!1:a,C=k=>{const oe=ue(k);return delete oe._k,T?{isValidating:!0,isLoading:!0,...oe}:oe},F=M(),L=P(),G=C(F),me=F===L?G:C(L);let U=G;return[()=>{const k=C(M());return be(k,U)?(U.data=k.data,U.isLoading=k.isLoading,U.isValidating=k.isValidating,U.error=k.error,U):(U=k,k)},()=>me]},[r,w]),re=Wt.useSyncExternalStore(x.useCallback(T=>V(w,(C,F)=>{be(F,C)||T()}),[r,w]),J[0],J[1]),xe=!D.current,Q=u[w]&&u[w].length>0,$=re.data,K=g($)?j&&_n(j)?et(j):j:$,se=re.error,he=x.useRef(K),De=E?g($)?g(he.current)?K:he.current:$:K,le=w&&g(K),Nn=!Ee&&Wt.useSyncExternalStore(()=>ce,()=>!1,()=>!0);y&&Nn&&!i&&le&&console.warn(`Missing pre-initiated data for serialized key "${w}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const bt=Q&&!g(se)?!1:xe&&!g(a)?a:O().isPaused()?!1:i?g(K)?!1:d:g(K)||d,gt=!!(w&&t&&xe&&bt),Fn=g(re.isValidating)?gt:re.isValidating,Pn=g(re.isLoading)?gt:re.isLoading,ge=x.useCallback(async T=>{const C=_.current;if(!w||!C||R.current||O().isPaused())return!1;let F,L,G=!0;const me=T||{},U=!h[w]||!me.dedupe,k=()=>Kt?!R.current&&w===v.current&&D.current:w===v.current,oe={isValidating:!1,isLoading:!1},Ot=()=>{z(oe)},Tt=()=>{const W=h[w];W&&W[1]===L&&delete h[w]},At={isValidating:!0};g(M().data)&&(At.isLoading=!0);try{if(U&&(z(At),n.loadingTimeout&&g(M().data)&&setTimeout(()=>{G&&k()&&O().onLoadingSlow(w,n)},n.loadingTimeout),h[w]=[C(A),pt()]),[F,L]=h[w],F=await F,U&&setTimeout(Tt,n.dedupingInterval),!h[w]||h[w][1]!==L)return U&&k()&&O().onDiscarded(w),!1;oe.error=I;const W=m[w];if(!g(W)&&(L<=W[0]||L<=W[1]||W[1]===0))return Ot(),U&&k()&&O().onDiscarded(w),!1;const ie=M().data;oe.data=s(ie,F)?ie:F,U&&k()&&O().onSuccess(F,w,n)}catch(W){Tt();const ie=O(),{shouldRetryOnError:Ve}=ie;ie.isPaused()||(oe.error=W,U&&k()&&(ie.onError(W,w,ie),(Ve===!0||ee(Ve)&&Ve(W))&&(!O().revalidateOnFocus||!O().revalidateOnReconnect||te())&&ie.onErrorRetry(W,w,ie,vn=>{const $e=u[w];$e&&$e[0]&&$e[0](zt,vn)},{retryCount:(me.retryCount||0)+1,dedupe:!0})))}return G=!1,Ot(),!0},[w,r]),Rt=x.useCallback((...T)=>xn(r,v.current,...T),[]);if(Ye(()=>{_.current=t,Y.current=n,g($)||(he.current=$)}),Ye(()=>{if(!w)return;const T=ge.bind(I,tt);let C=0;O().revalidateOnFocus&&(C=Date.now()+O().focusThrottleInterval);const L=qs(w,u,(G,me={})=>{if(G==On){const U=Date.now();O().revalidateOnFocus&&U>C&&te()&&(C=U+O().focusThrottleInterval,T())}else if(G==Tn)O().revalidateOnReconnect&&te()&&T();else{if(G==An)return ge();if(G==zt)return ge(me)}});return R.current=!1,v.current=w,D.current=!0,z({_k:A}),bt&&(h[w]||(g(K)||Ee?T():gs(T))),()=>{R.current=!0,L()}},[w]),Ye(()=>{let T;function C(){const L=ee(f)?f(M().data):f;L&&T!==-1&&(T=setTimeout(F,L))}function F(){!M().error&&(l||O().isVisible())&&(p||O().isOnline())?ge(tt).then(C):C()}return C(),()=>{T&&(clearTimeout(T),T=-1)}},[f,l,p,w]),x.useDebugValue(De),i){if(!Kt&&Ee&&le)throw new Error("Fallback data is required when using Suspense in SSR.");le&&(_.current=t,Y.current=n,R.current=!1);const T=b[w],C=!g(T)&&le?Rt(T):Yt;if(et(C),!g(se)&&le)throw se;const F=le?ge(tt):Yt;!g(De)&&le&&(F.status="fulfilled",F.value=!0),et(F)}return{mutate:Rt,get data(){return ne.data=!0,De},get error(){return ne.error=!0,se},get isValidating(){return ne.isValidating=!0,Fn},get isLoading(){return ne.isLoading=!0,Pn}}},Ms=ks(Hs);exports.axios=N;exports.useSWR=Ms;
|