@cccsaurora/clue-ui 1.4.1 → 1.4.2-dev.453

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/ActionForm-CbLz66Rk.js +6099 -0
  2. package/AnnotationDetails-CdNvyJl7.js +176 -0
  3. package/AnnotationPreview-C6a3qRFG.js +188 -0
  4. package/ClueEnrichContext-0eVIgvZp.js +594 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_MapCache-kuEY_iOH.js +220 -0
  7. package/_Set-BrSMTlHn.js +6 -0
  8. package/_Uint8Array-OPpgYQj7.js +123 -0
  9. package/_arrayIncludes-BNqL-9ZP.js +31 -0
  10. package/_arrayPush-CBkQqaE_.js +10 -0
  11. package/_baseAssignValue-CNUVPOBW.js +16 -0
  12. package/_baseClone-9FaRd1R2.js +287 -0
  13. package/_baseExtremum-wOGT4Dgw.js +18 -0
  14. package/_baseFlatten-Co6QHDlG.js +92 -0
  15. package/_baseGet-Cmp6FztG.js +109 -0
  16. package/_baseGetTag-Hj-0NTYF.js +44 -0
  17. package/_baseIsEqual-1CpU47TZ.js +211 -0
  18. package/_baseIteratee-BN7Vbe5g.js +126 -0
  19. package/_baseRest-BZ_hQ9PC.js +8 -0
  20. package/_baseSlice-GAv_YFTT.js +20 -0
  21. package/_baseSum-D0WC1dN0.js +13 -0
  22. package/_baseUniq-BnvS3JHL.js +63 -0
  23. package/_cacheHas-_aF2y2Xv.js +25 -0
  24. package/_commonjsHelpers-CUmg6egw.js +6 -0
  25. package/_createAggregator-BUZrP_is.js +63 -0
  26. package/_defineProperty-DolZLKmv.js +12 -0
  27. package/_getPrototype-Bb4gm-5m.js +5 -0
  28. package/_getTag-CML_cXiN.js +105 -0
  29. package/_isIterateeCall-B1IFEqVv.js +17 -0
  30. package/_setToArray-CqyqC8ib.js +10 -0
  31. package/cloneDeep-l3UkXG5M.js +8 -0
  32. package/components/AnnotationBody.js +49 -35
  33. package/components/AnnotationDetailPopover.js +39 -30
  34. package/components/AnnotationDetails.js +7 -7
  35. package/components/AnnotationEntry.js +35 -35
  36. package/components/AnnotationPreview.js +5 -5
  37. package/components/ClassificationChip.js +46 -24
  38. package/components/CountBadge.js +31 -26
  39. package/components/EnrichedCard.js +110 -97
  40. package/components/EnrichedChip.js +130 -105
  41. package/components/EnrichedTypography.js +133 -107
  42. package/components/ErrorBoundary.js +28 -24
  43. package/components/RetryFailedEnrichments.js +10 -9
  44. package/components/SourcePicker.js +57 -49
  45. package/components/actions/ActionForm.js +4 -4
  46. package/components/actions/ExecutePopover.js +75 -59
  47. package/components/actions/ResultModal.js +4 -4
  48. package/components/actions/form/schemaAdapter.js +39 -23
  49. package/components/actions/formats/FileResult.js +86 -59
  50. package/components/actions/formats/index.js +29 -25
  51. package/components/display/graph/ExpandMoreButton.js +10 -10
  52. package/components/display/graph/elements/NodeCard.js +111 -91
  53. package/components/display/graph/elements/NodeTag.js +15 -13
  54. package/components/display/graph/index.js +261 -202
  55. package/components/display/graph/visualizations/Leaf.js +89 -70
  56. package/components/display/graph/visualizations/cloud/index.js +98 -81
  57. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  58. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  59. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  60. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  61. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  62. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  63. package/components/display/graph/visualizations/icons/index.js +14 -13
  64. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  65. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  66. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  67. package/components/display/graph/visualizations/tree/index.js +408 -306
  68. package/components/display/icons/Iconified.js +27 -12
  69. package/components/display/json/index.js +4 -4
  70. package/components/display/markdown/index.js +8678 -5770
  71. package/components/enrichment/EnrichPopover.js +54 -46
  72. package/components/fetchers/Fetcher.js +166 -123
  73. package/components/fetchers/FetcherResultView.js +31 -27
  74. package/components/fetchers/PreviewModal.js +17 -16
  75. package/components/fetchers/StatusChip.js +21 -17
  76. package/components/group/Entry.js +13 -11
  77. package/components/group/Group.js +13 -10
  78. package/components/group/GroupControl.js +76 -65
  79. package/components/stats/QueryStatus.js +45 -32
  80. package/countBy-Bqcp3VCs.js +14 -0
  81. package/data/event.js +6 -4
  82. package/database/globals.js +2 -2
  83. package/database/index.js +3 -3
  84. package/database/replication.js +4 -4
  85. package/get-CdMThM8x.js +8 -0
  86. package/groupBy-BVV07EGQ.js +14 -0
  87. package/hooks/ClueActionContext.js +6 -6
  88. package/hooks/ClueComponentContext.js +29 -23
  89. package/hooks/ClueConfigProvider.js +14 -12
  90. package/hooks/ClueDatabaseContext.d.ts +4 -0
  91. package/hooks/ClueDatabaseContext.js +36 -23
  92. package/hooks/ClueEnrichContext.js +11 -11
  93. package/hooks/ClueFetcherContext.js +83 -56
  94. package/hooks/ClueGroupContext.js +17 -14
  95. package/hooks/CluePopupContext.js +5 -5
  96. package/hooks/ClueProvider.js +13 -11
  97. package/hooks/ClueUIPluginContext.js +50 -36
  98. package/hooks/selectors.js +7 -7
  99. package/hooks/useActionResult.js +3 -3
  100. package/hooks/useAnnotations.js +48 -32
  101. package/hooks/useClue.js +6 -4
  102. package/hooks/useClueActions.js +3 -3
  103. package/hooks/useClueConfig.js +6 -4
  104. package/hooks/useClueTypeConfig.js +49 -24
  105. package/hooks/useClueUIPlugins.js +8 -7
  106. package/hooks/useComparator.js +722 -435
  107. package/hooks/useErrors.js +22 -18
  108. package/hooks/useFetcherResult.js +33 -24
  109. package/hooks/useMyHighlights.js +66 -36
  110. package/hooks/useMyLocalStorage.js +66 -37
  111. package/iconify-DJxl6dC-.js +1789 -0
  112. package/icons/Action.js +66 -49
  113. package/icons/Assessment.js +85 -69
  114. package/icons/Context.js +77 -63
  115. package/icons/Opinion.js +76 -60
  116. package/icons/iconMap.js +2 -2
  117. package/identity-CPGTqrE4.js +6 -0
  118. package/index-CDrC9oSE.js +1172 -0
  119. package/index-CVUD9o3t.js +15768 -0
  120. package/index-DUEubgWN.js +464 -0
  121. package/index-DpJxD74E.js +3272 -0
  122. package/index-IKI1G5v-.js +9314 -0
  123. package/index-_gpzM2Px.js +702 -0
  124. package/isArguments-CuYlEuhP.js +27 -0
  125. package/isArray-RJPfgWqI.js +4 -0
  126. package/isEmpty-BE656RUK.js +30 -0
  127. package/isNil-CIubwp4T.js +6 -0
  128. package/isObject-FTY-5JQX.js +7 -0
  129. package/isObjectLike-CeENW9FN.js +6 -0
  130. package/isSymbol-D_H4HPZQ.js +9 -0
  131. package/last-CUCl67Im.js +7 -0
  132. package/main.js +62 -62
  133. package/maxBy-BjjQmX5t.js +8 -0
  134. package/package.json +22 -22
  135. package/plugins/ClueUIPlugin.js +163 -96
  136. package/plugins/file/index.js +15 -15
  137. package/plugins/graph/index.js +29 -26
  138. package/plugins/image/index.js +28 -24
  139. package/plugins/json/index.js +21 -21
  140. package/plugins/markdown/index.js +18 -18
  141. package/plugins/registry.js +6 -6
  142. package/plugins/store.js +4 -4
  143. package/plugins/test/index.js +17 -17
  144. package/plugins/utils.js +13 -12
  145. package/replication-kdsH0l7f.js +11779 -0
  146. package/sessionStorage-B68y-wnE.js +140 -0
  147. package/sortBy-B8JVsLQY.js +95 -0
  148. package/store-DHP48fQB.js +2165 -0
  149. package/sumBy-D-HCzM2i.js +8 -0
  150. package/text/Frequency.js +42 -23
  151. package/toFinite-meZTg4Su.js +16 -0
  152. package/toNumber-B5JaA1vX.js +39 -0
  153. package/uniq-CahZPAwp.js +7 -0
  154. package/utils/chain.js +92 -65
  155. package/utils/classificationParser.js +519 -256
  156. package/utils/constants.js +37 -11
  157. package/utils/graph.js +72 -45
  158. package/utils/hashUtil.js +7 -7
  159. package/utils/line.js +131 -81
  160. package/utils/loggerUtil.js +5 -3
  161. package/utils/sessionStorage.js +7 -7
  162. package/utils/time.js +447 -427
  163. package/utils/utils.js +10 -10
  164. package/utils/window.js +21 -10
  165. package/utils-CEySTPtg.js +224 -0
  166. package/ActionForm-DjyNwVzM.js +0 -4403
  167. package/AnnotationDetails-BvPv3_pR.js +0 -160
  168. package/AnnotationPreview-C0JN_lr0.js +0 -140
  169. package/ClueEnrichContext-CNbh-qiy.js +0 -452
  170. package/FlexOne-BXWFOd1T.js +0 -6
  171. package/_MapCache-DRK-s2eK.js +0 -179
  172. package/_Set-DrS_bbSV.js +0 -6
  173. package/_Uint8Array-D9R2N9Lp.js +0 -98
  174. package/_arrayIncludes-Dcl_29E6.js +0 -25
  175. package/_arrayPush-DBJIuK2V.js +0 -8
  176. package/_baseAssignValue-Bx1cxHj5.js +0 -12
  177. package/_baseClone-DRhywkxm.js +0 -211
  178. package/_baseExtremum-DodEaEyF.js +0 -16
  179. package/_baseFlatten-CD9NgrYE.js +0 -72
  180. package/_baseGet-bVwDaGrA.js +0 -80
  181. package/_baseGetTag-CxDaTem-.js +0 -25
  182. package/_baseIsEqual-C-FKsm1J.js +0 -150
  183. package/_baseIteratee-D0FhC5bC.js +0 -95
  184. package/_baseRest-D_eW2E0d.js +0 -8
  185. package/_baseSlice-M5RKzt1A.js +0 -10
  186. package/_baseSum-wEbgNeUs.js +0 -10
  187. package/_baseUniq-D3N8igOm.js +0 -41
  188. package/_cacheHas-Wgl-hw34.js +0 -22
  189. package/_commonjsHelpers-C6fGbg64.js +0 -6
  190. package/_createAggregator-BVj8IAuF.js +0 -53
  191. package/_defineProperty-BZU4WKA3.js +0 -11
  192. package/_getPrototype-BGBCg-aX.js +0 -5
  193. package/_getTag-B7R9qBo7.js +0 -73
  194. package/_isIterateeCall-Dm0VTAYy.js +0 -13
  195. package/_setToArray-Ck4YZu0Z.js +0 -9
  196. package/cloneDeep-fV59zwUf.js +0 -8
  197. package/countBy-B3rNuG4T.js +0 -8
  198. package/get-Bil3mzRD.js +0 -8
  199. package/groupBy-CrJC7sGa.js +0 -8
  200. package/iconify-Ptb5dTKy.js +0 -1270
  201. package/identity-ByMq8VxU.js +0 -6
  202. package/index-BH-gBhtO.js +0 -2282
  203. package/index-BM9Sve5T.js +0 -571
  204. package/index-Cj4d5cGz.js +0 -357
  205. package/index-D3Dwn-8x.js +0 -6464
  206. package/index-Dh2PP9h8.js +0 -11747
  207. package/index-DoFpWPHo.js +0 -975
  208. package/isArguments-BWcXOE6a.js +0 -24
  209. package/isArray-WzO_os3q.js +0 -4
  210. package/isEmpty-DKxrY-_M.js +0 -22
  211. package/isNil-CjWwlQS3.js +0 -6
  212. package/isObject-B53jY8Qg.js +0 -7
  213. package/isObjectLike-CYbdrIBr.js +0 -6
  214. package/isSymbol-DE1Kcy2M.js +0 -9
  215. package/last-7CdUxN0r.js +0 -7
  216. package/maxBy-BOWDkL_D.js +0 -8
  217. package/replication-WkKbPdwG.js +0 -8453
  218. package/sessionStorage-DFMae61b.js +0 -90
  219. package/sortBy-BHe812lF.js +0 -74
  220. package/store-D4aFUWxi.js +0 -1169
  221. package/sumBy-B7f_bP_k.js +0 -8
  222. package/toFinite-CBrE65MP.js +0 -14
  223. package/toNumber-CxmWey0f.js +0 -31
  224. package/uniq-B4UZ671_.js +0 -7
  225. package/utils-SpTOhPYl.js +0 -147
package/index-BH-gBhtO.js DELETED
@@ -1,2282 +0,0 @@
1
- var on = Object.defineProperty;
2
- var an = (e, t, n) => t in e ? on(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Ze = (e, t, n) => an(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { MY_LOCAL_STORAGE_PREFIX as Pe, StorageKey as O } from "./utils/constants.js";
5
- import { i as q } from "./isNil-CjWwlQS3.js";
6
- import { g as cn } from "./_commonjsHelpers-C6fGbg64.js";
7
- import { g as un, s as ln } from "./sessionStorage-DFMae61b.js";
8
- const fn = (e, t, n = { timeout: null }, r) => {
9
- const s = [];
10
- return q(n.timeout) || s.push(`max_timeout=${n.timeout}`), I(
11
- S(Z(), `${e.replace(".", "/")}/status/${t}`),
12
- s.length > 0 ? new URLSearchParams(s.join("&")) : null,
13
- r
14
- );
15
- }, dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16
- __proto__: null,
17
- get: fn
18
- }, Symbol.toStringTag, { value: "Module" })), Z = () => S(F(), "actions"), pn = (e) => I(Z(), null, e), hn = (e, t, n, r, s = { timeout: null }, o) => {
19
- const i = [];
20
- q(s.timeout) || i.push(`max_timeout=${s.timeout}`);
21
- const a = { ...n };
22
- return Array.isArray(t) ? t.length < 2 ? (a.selector = t[0], a.selectors = []) : a.selectors = t : (a.selector = t, a.selectors = []), a.context = r ?? null, oe(
23
- S(
24
- S(Z(), "execute"),
25
- e.replace(".", "/"),
26
- i.length > 0 ? new URLSearchParams(i.join("&")) : null
27
- ),
28
- a,
29
- o
30
- );
31
- }, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
32
- __proto__: null,
33
- get: pn,
34
- post: hn,
35
- status: dn,
36
- uri: Z
37
- }, Symbol.toStringTag, { value: "Module" })), Fe = (e) => S(bt(), "login", e), En = (e) => oe(Fe(), e), yn = (e) => {
38
- const t = localStorage.getItem(`${Pe}.${O.LOGIN_NONCE}`);
39
- return t && (e.set("nonce", JSON.parse(t)), localStorage.removeItem(`${Pe}.${O.LOGIN_NONCE}`)), I(Fe(), e);
40
- }, gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41
- __proto__: null,
42
- get: yn,
43
- post: En,
44
- uri: Fe
45
- }, Symbol.toStringTag, { value: "Module" })), bt = () => S(F(), "auth"), Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
46
- __proto__: null,
47
- login: gn,
48
- uri: bt
49
- }, Symbol.toStringTag, { value: "Module" })), Ot = () => S(F(), "configs"), _n = (e) => I(Ot(), null, e), bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50
- __proto__: null,
51
- get: _n,
52
- uri: Ot
53
- }, Symbol.toStringTag, { value: "Module" })), On = (e, t, n = { timeout: null }, r) => {
54
- const s = [];
55
- return q(n.timeout) || s.push(`max_timeout=${n.timeout}`), I(
56
- S(Z(), `${e.replace(".", "/")}/status/${t}`),
57
- s.length > 0 ? new URLSearchParams(s.join("&")) : null,
58
- r
59
- );
60
- }, Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
61
- __proto__: null,
62
- get: On
63
- }, Symbol.toStringTag, { value: "Module" })), je = () => S(F(), "fetchers"), wn = (e) => I(je(), null, e), Tn = (e, t, n) => oe(be(je(), e.replace(".", "/")), t, n), An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
64
- __proto__: null,
65
- get: wn,
66
- post: Tn,
67
- status: Sn,
68
- uri: je
69
- }, Symbol.toStringTag, { value: "Module" })), St = () => S(me(), "enrich"), Nn = (e, t = [], n = { timeout: null, includeRaw: !1, noCache: !1 }, r) => {
70
- const s = [];
71
- return (t == null ? void 0 : t.length) > 0 && s.push(`sources=${t.join()}`), n.classification && s.push(`classification=${encodeURIComponent(n.classification)}`), q(n.timeout) || s.push(`max_timeout=${n.timeout}`), n.includeRaw && s.push("include_raw=true"), n.noCache && s.push("no_cache=true"), oe(
72
- S(St(), "", s.length > 0 ? new URLSearchParams(s.join("&")) : null),
73
- e,
74
- r
75
- );
76
- }, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
77
- __proto__: null,
78
- post: Nn,
79
- uri: St
80
- }, Symbol.toStringTag, { value: "Module" })), wt = () => S(me(), "types"), Pn = (e) => I(wt(), null, e), Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
81
- __proto__: null,
82
- get: Pn,
83
- uri: wt
84
- }, Symbol.toStringTag, { value: "Module" })), Tt = () => S(me(), "types_detection"), Dn = (e) => I(Tt(), null, e), xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
85
- __proto__: null,
86
- get: Dn,
87
- uri: Tt
88
- }, Symbol.toStringTag, { value: "Module" })), me = () => S(F(), "lookup"), Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
89
- __proto__: null,
90
- enrich: Cn,
91
- types: Ln,
92
- types_detection: xn,
93
- uri: me
94
- }, Symbol.toStringTag, { value: "Module" })), At = (e) => S($e(), e ? "/docs?filter=" + e : "/docs"), In = (e, t) => I(At(e), null, t), Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
95
- __proto__: null,
96
- get: In,
97
- uri: At
98
- }, Symbol.toStringTag, { value: "Module" })), Nt = (e) => be($e(), "docs", e), jn = (e, t) => I(Nt(e), null, t), $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
- __proto__: null,
100
- get: jn,
101
- uri: Nt
102
- }, Symbol.toStringTag, { value: "Module" })), $e = () => S(F(), "static"), Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
103
- __proto__: null,
104
- all_documentation: Fn,
105
- documentation: $n,
106
- uri: $e
107
- }, Symbol.toStringTag, { value: "Module" })), Be = () => S(F(), "sync"), kn = (e, t, n, r, s) => {
108
- const o = new URLSearchParams();
109
- return o.set("limit", "250"), q(t) || o.set("id", t.toString()), q(n) || o.set("updated_at", n.toString()), !q(r) && r && o.set("omit_deleted", "true"), I(be(Be(), e), o, s);
110
- }, vn = (e, t, n) => oe(be(Be(), e), t, n), qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
111
- __proto__: null,
112
- get: kn,
113
- post: vn,
114
- uri: Be
115
- }, Symbol.toStringTag, { value: "Module" }));
116
- function Ct(e, t) {
117
- return function() {
118
- return e.apply(t, arguments);
119
- };
120
- }
121
- const { toString: Mn } = Object.prototype, { getPrototypeOf: ke } = Object, { iterator: Ee, toStringTag: Pt } = Symbol, ye = /* @__PURE__ */ ((e) => (t) => {
122
- const n = Mn.call(t);
123
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
124
- })(/* @__PURE__ */ Object.create(null)), U = (e) => (e = e.toLowerCase(), (t) => ye(t) === e), ge = (e) => (t) => typeof t === e, { isArray: K } = Array, V = ge("undefined");
125
- function ee(e) {
126
- return e !== null && !V(e) && e.constructor !== null && !V(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
127
- }
128
- const Lt = U("ArrayBuffer");
129
- function Hn(e) {
130
- let t;
131
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Lt(e.buffer), t;
132
- }
133
- const zn = ge("string"), N = ge("function"), Dt = ge("number"), te = (e) => e !== null && typeof e == "object", Jn = (e) => e === !0 || e === !1, le = (e) => {
134
- if (ye(e) !== "object")
135
- return !1;
136
- const t = ke(e);
137
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Pt in e) && !(Ee in e);
138
- }, Vn = (e) => {
139
- if (!te(e) || ee(e))
140
- return !1;
141
- try {
142
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
143
- } catch {
144
- return !1;
145
- }
146
- }, Kn = U("Date"), Xn = U("File"), Wn = U("Blob"), Gn = U("FileList"), Yn = (e) => te(e) && N(e.pipe), Qn = (e) => {
147
- let t;
148
- return e && (typeof FormData == "function" && e instanceof FormData || N(e.append) && ((t = ye(e)) === "formdata" || // detect form-data instance
149
- t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
150
- }, Zn = U("URLSearchParams"), [er, tr, nr, rr] = [
151
- "ReadableStream",
152
- "Request",
153
- "Response",
154
- "Headers"
155
- ].map(U), sr = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
156
- function ne(e, t, { allOwnKeys: n = !1 } = {}) {
157
- if (e === null || typeof e > "u")
158
- return;
159
- let r, s;
160
- if (typeof e != "object" && (e = [e]), K(e))
161
- for (r = 0, s = e.length; r < s; r++)
162
- t.call(null, e[r], r, e);
163
- else {
164
- if (ee(e))
165
- return;
166
- const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
167
- let a;
168
- for (r = 0; r < i; r++)
169
- a = o[r], t.call(null, e[a], a, e);
170
- }
171
- }
172
- function xt(e, t) {
173
- if (ee(e))
174
- return null;
175
- t = t.toLowerCase();
176
- const n = Object.keys(e);
177
- let r = n.length, s;
178
- for (; r-- > 0; )
179
- if (s = n[r], t === s.toLowerCase())
180
- return s;
181
- return null;
182
- }
183
- const v = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ut = (e) => !V(e) && e !== v;
184
- function Le() {
185
- const { caseless: e, skipUndefined: t } = Ut(this) && this || {}, n = {}, r = (s, o) => {
186
- if (o === "__proto__" || o === "constructor" || o === "prototype")
187
- return;
188
- const i = e && xt(n, o) || o;
189
- le(n[i]) && le(s) ? n[i] = Le(n[i], s) : le(s) ? n[i] = Le({}, s) : K(s) ? n[i] = s.slice() : (!t || !V(s)) && (n[i] = s);
190
- };
191
- for (let s = 0, o = arguments.length; s < o; s++)
192
- arguments[s] && ne(arguments[s], r);
193
- return n;
194
- }
195
- const or = (e, t, n, { allOwnKeys: r } = {}) => (ne(
196
- t,
197
- (s, o) => {
198
- n && N(s) ? Object.defineProperty(e, o, {
199
- value: Ct(s, n),
200
- writable: !0,
201
- enumerable: !0,
202
- configurable: !0
203
- }) : Object.defineProperty(e, o, {
204
- value: s,
205
- writable: !0,
206
- enumerable: !0,
207
- configurable: !0
208
- });
209
- },
210
- { allOwnKeys: r }
211
- ), e), ir = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), ar = (e, t, n, r) => {
212
- e.prototype = Object.create(
213
- t.prototype,
214
- r
215
- ), Object.defineProperty(e.prototype, "constructor", {
216
- value: e,
217
- writable: !0,
218
- enumerable: !1,
219
- configurable: !0
220
- }), Object.defineProperty(e, "super", {
221
- value: t.prototype
222
- }), n && Object.assign(e.prototype, n);
223
- }, cr = (e, t, n, r) => {
224
- let s, o, i;
225
- const a = {};
226
- if (t = t || {}, e == null) return t;
227
- do {
228
- for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
229
- i = s[o], (!r || r(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
230
- e = n !== !1 && ke(e);
231
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
232
- return t;
233
- }, ur = (e, t, n) => {
234
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
235
- const r = e.indexOf(t, n);
236
- return r !== -1 && r === n;
237
- }, lr = (e) => {
238
- if (!e) return null;
239
- if (K(e)) return e;
240
- let t = e.length;
241
- if (!Dt(t)) return null;
242
- const n = new Array(t);
243
- for (; t-- > 0; )
244
- n[t] = e[t];
245
- return n;
246
- }, fr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ke(Uint8Array)), dr = (e, t) => {
247
- const r = (e && e[Ee]).call(e);
248
- let s;
249
- for (; (s = r.next()) && !s.done; ) {
250
- const o = s.value;
251
- t.call(e, o[0], o[1]);
252
- }
253
- }, pr = (e, t) => {
254
- let n;
255
- const r = [];
256
- for (; (n = e.exec(t)) !== null; )
257
- r.push(n);
258
- return r;
259
- }, hr = U("HTMLFormElement"), mr = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
260
- return r.toUpperCase() + s;
261
- }), et = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Er = U("RegExp"), It = (e, t) => {
262
- const n = Object.getOwnPropertyDescriptors(e), r = {};
263
- ne(n, (s, o) => {
264
- let i;
265
- (i = t(s, o, e)) !== !1 && (r[o] = i || s);
266
- }), Object.defineProperties(e, r);
267
- }, yr = (e) => {
268
- It(e, (t, n) => {
269
- if (N(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
270
- return !1;
271
- const r = e[n];
272
- if (N(r)) {
273
- if (t.enumerable = !1, "writable" in t) {
274
- t.writable = !1;
275
- return;
276
- }
277
- t.set || (t.set = () => {
278
- throw Error("Can not rewrite read-only method '" + n + "'");
279
- });
280
- }
281
- });
282
- }, gr = (e, t) => {
283
- const n = {}, r = (s) => {
284
- s.forEach((o) => {
285
- n[o] = !0;
286
- });
287
- };
288
- return K(e) ? r(e) : r(String(e).split(t)), n;
289
- }, Rr = () => {
290
- }, _r = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
291
- function br(e) {
292
- return !!(e && N(e.append) && e[Pt] === "FormData" && e[Ee]);
293
- }
294
- const Or = (e) => {
295
- const t = new Array(10), n = (r, s) => {
296
- if (te(r)) {
297
- if (t.indexOf(r) >= 0)
298
- return;
299
- if (ee(r))
300
- return r;
301
- if (!("toJSON" in r)) {
302
- t[s] = r;
303
- const o = K(r) ? [] : {};
304
- return ne(r, (i, a) => {
305
- const f = n(i, s + 1);
306
- !V(f) && (o[a] = f);
307
- }), t[s] = void 0, o;
308
- }
309
- }
310
- return r;
311
- };
312
- return n(e, 0);
313
- }, Sr = U("AsyncFunction"), wr = (e) => e && (te(e) || N(e)) && N(e.then) && N(e.catch), Ft = ((e, t) => e ? setImmediate : t ? ((n, r) => (v.addEventListener(
314
- "message",
315
- ({ source: s, data: o }) => {
316
- s === v && o === n && r.length && r.shift()();
317
- },
318
- !1
319
- ), (s) => {
320
- r.push(s), v.postMessage(n, "*");
321
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", N(v.postMessage)), Tr = typeof queueMicrotask < "u" ? queueMicrotask.bind(v) : typeof process < "u" && process.nextTick || Ft, Ar = (e) => e != null && N(e[Ee]), c = {
322
- isArray: K,
323
- isArrayBuffer: Lt,
324
- isBuffer: ee,
325
- isFormData: Qn,
326
- isArrayBufferView: Hn,
327
- isString: zn,
328
- isNumber: Dt,
329
- isBoolean: Jn,
330
- isObject: te,
331
- isPlainObject: le,
332
- isEmptyObject: Vn,
333
- isReadableStream: er,
334
- isRequest: tr,
335
- isResponse: nr,
336
- isHeaders: rr,
337
- isUndefined: V,
338
- isDate: Kn,
339
- isFile: Xn,
340
- isBlob: Wn,
341
- isRegExp: Er,
342
- isFunction: N,
343
- isStream: Yn,
344
- isURLSearchParams: Zn,
345
- isTypedArray: fr,
346
- isFileList: Gn,
347
- forEach: ne,
348
- merge: Le,
349
- extend: or,
350
- trim: sr,
351
- stripBOM: ir,
352
- inherits: ar,
353
- toFlatObject: cr,
354
- kindOf: ye,
355
- kindOfTest: U,
356
- endsWith: ur,
357
- toArray: lr,
358
- forEachEntry: dr,
359
- matchAll: pr,
360
- isHTMLForm: hr,
361
- hasOwnProperty: et,
362
- hasOwnProp: et,
363
- // an alias to avoid ESLint no-prototype-builtins detection
364
- reduceDescriptors: It,
365
- freezeMethods: yr,
366
- toObjectSet: gr,
367
- toCamelCase: mr,
368
- noop: Rr,
369
- toFiniteNumber: _r,
370
- findKey: xt,
371
- global: v,
372
- isContextDefined: Ut,
373
- isSpecCompliantForm: br,
374
- toJSONObject: Or,
375
- isAsyncFn: Sr,
376
- isThenable: wr,
377
- setImmediate: Ft,
378
- asap: Tr,
379
- isIterable: Ar
380
- };
381
- let E = class jt extends Error {
382
- static from(t, n, r, s, o, i) {
383
- const a = new jt(t.message, n || t.code, r, s, o);
384
- return a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
385
- }
386
- /**
387
- * Create an Error with the specified message, config, error code, request and response.
388
- *
389
- * @param {string} message The error message.
390
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
391
- * @param {Object} [config] The config.
392
- * @param {Object} [request] The request.
393
- * @param {Object} [response] The response.
394
- *
395
- * @returns {Error} The created error.
396
- */
397
- constructor(t, n, r, s, o) {
398
- super(t), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), s && (this.request = s), o && (this.response = o, this.status = o.status);
399
- }
400
- toJSON() {
401
- return {
402
- // Standard
403
- message: this.message,
404
- name: this.name,
405
- // Microsoft
406
- description: this.description,
407
- number: this.number,
408
- // Mozilla
409
- fileName: this.fileName,
410
- lineNumber: this.lineNumber,
411
- columnNumber: this.columnNumber,
412
- stack: this.stack,
413
- // Axios
414
- config: c.toJSONObject(this.config),
415
- code: this.code,
416
- status: this.status
417
- };
418
- }
419
- };
420
- E.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
421
- E.ERR_BAD_OPTION = "ERR_BAD_OPTION";
422
- E.ECONNABORTED = "ECONNABORTED";
423
- E.ETIMEDOUT = "ETIMEDOUT";
424
- E.ERR_NETWORK = "ERR_NETWORK";
425
- E.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
426
- E.ERR_DEPRECATED = "ERR_DEPRECATED";
427
- E.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
428
- E.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
429
- E.ERR_CANCELED = "ERR_CANCELED";
430
- E.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
431
- E.ERR_INVALID_URL = "ERR_INVALID_URL";
432
- const Nr = null;
433
- function De(e) {
434
- return c.isPlainObject(e) || c.isArray(e);
435
- }
436
- function $t(e) {
437
- return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
438
- }
439
- function tt(e, t, n) {
440
- return e ? e.concat(t).map(function(s, o) {
441
- return s = $t(s), !n && o ? "[" + s + "]" : s;
442
- }).join(n ? "." : "") : t;
443
- }
444
- function Cr(e) {
445
- return c.isArray(e) && !e.some(De);
446
- }
447
- const Pr = c.toFlatObject(c, {}, null, function(t) {
448
- return /^is[A-Z]/.test(t);
449
- });
450
- function Re(e, t, n) {
451
- if (!c.isObject(e))
452
- throw new TypeError("target must be an object");
453
- t = t || new FormData(), n = c.toFlatObject(n, {
454
- metaTokens: !0,
455
- dots: !1,
456
- indexes: !1
457
- }, !1, function(m, p) {
458
- return !c.isUndefined(p[m]);
459
- });
460
- const r = n.metaTokens, s = n.visitor || u, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
461
- if (!c.isFunction(s))
462
- throw new TypeError("visitor must be a function");
463
- function d(l) {
464
- if (l === null) return "";
465
- if (c.isDate(l))
466
- return l.toISOString();
467
- if (c.isBoolean(l))
468
- return l.toString();
469
- if (!f && c.isBlob(l))
470
- throw new E("Blob is not supported. Use a Buffer instead.");
471
- return c.isArrayBuffer(l) || c.isTypedArray(l) ? f && typeof Blob == "function" ? new Blob([l]) : Buffer.from(l) : l;
472
- }
473
- function u(l, m, p) {
474
- let R = l;
475
- if (l && !p && typeof l == "object") {
476
- if (c.endsWith(m, "{}"))
477
- m = r ? m : m.slice(0, -2), l = JSON.stringify(l);
478
- else if (c.isArray(l) && Cr(l) || (c.isFileList(l) || c.endsWith(m, "[]")) && (R = c.toArray(l)))
479
- return m = $t(m), R.forEach(function(b, T) {
480
- !(c.isUndefined(b) || b === null) && t.append(
481
- // eslint-disable-next-line no-nested-ternary
482
- i === !0 ? tt([m], T, o) : i === null ? m : m + "[]",
483
- d(b)
484
- );
485
- }), !1;
486
- }
487
- return De(l) ? !0 : (t.append(tt(p, m, o), d(l)), !1);
488
- }
489
- const h = [], y = Object.assign(Pr, {
490
- defaultVisitor: u,
491
- convertValue: d,
492
- isVisitable: De
493
- });
494
- function _(l, m) {
495
- if (!c.isUndefined(l)) {
496
- if (h.indexOf(l) !== -1)
497
- throw Error("Circular reference detected in " + m.join("."));
498
- h.push(l), c.forEach(l, function(R, P) {
499
- (!(c.isUndefined(R) || R === null) && s.call(
500
- t,
501
- R,
502
- c.isString(P) ? P.trim() : P,
503
- m,
504
- y
505
- )) === !0 && _(R, m ? m.concat(P) : [P]);
506
- }), h.pop();
507
- }
508
- }
509
- if (!c.isObject(e))
510
- throw new TypeError("data must be an object");
511
- return _(e), t;
512
- }
513
- function nt(e) {
514
- const t = {
515
- "!": "%21",
516
- "'": "%27",
517
- "(": "%28",
518
- ")": "%29",
519
- "~": "%7E",
520
- "%20": "+",
521
- "%00": "\0"
522
- };
523
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
524
- return t[r];
525
- });
526
- }
527
- function ve(e, t) {
528
- this._pairs = [], e && Re(e, this, t);
529
- }
530
- const Bt = ve.prototype;
531
- Bt.append = function(t, n) {
532
- this._pairs.push([t, n]);
533
- };
534
- Bt.toString = function(t) {
535
- const n = t ? function(r) {
536
- return t.call(this, r, nt);
537
- } : nt;
538
- return this._pairs.map(function(s) {
539
- return n(s[0]) + "=" + n(s[1]);
540
- }, "").join("&");
541
- };
542
- function Lr(e) {
543
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
544
- }
545
- function kt(e, t, n) {
546
- if (!t)
547
- return e;
548
- const r = n && n.encode || Lr, s = c.isFunction(n) ? {
549
- serialize: n
550
- } : n, o = s && s.serialize;
551
- let i;
552
- if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new ve(t, s).toString(r), i) {
553
- const a = e.indexOf("#");
554
- a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
555
- }
556
- return e;
557
- }
558
- class rt {
559
- constructor() {
560
- this.handlers = [];
561
- }
562
- /**
563
- * Add a new interceptor to the stack
564
- *
565
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
566
- * @param {Function} rejected The function to handle `reject` for a `Promise`
567
- * @param {Object} options The options for the interceptor, synchronous and runWhen
568
- *
569
- * @return {Number} An ID used to remove interceptor later
570
- */
571
- use(t, n, r) {
572
- return this.handlers.push({
573
- fulfilled: t,
574
- rejected: n,
575
- synchronous: r ? r.synchronous : !1,
576
- runWhen: r ? r.runWhen : null
577
- }), this.handlers.length - 1;
578
- }
579
- /**
580
- * Remove an interceptor from the stack
581
- *
582
- * @param {Number} id The ID that was returned by `use`
583
- *
584
- * @returns {void}
585
- */
586
- eject(t) {
587
- this.handlers[t] && (this.handlers[t] = null);
588
- }
589
- /**
590
- * Clear all interceptors from the stack
591
- *
592
- * @returns {void}
593
- */
594
- clear() {
595
- this.handlers && (this.handlers = []);
596
- }
597
- /**
598
- * Iterate over all the registered interceptors
599
- *
600
- * This method is particularly useful for skipping over any
601
- * interceptors that may have become `null` calling `eject`.
602
- *
603
- * @param {Function} fn The function to call for each interceptor
604
- *
605
- * @returns {void}
606
- */
607
- forEach(t) {
608
- c.forEach(this.handlers, function(r) {
609
- r !== null && t(r);
610
- });
611
- }
612
- }
613
- const qe = {
614
- silentJSONParsing: !0,
615
- forcedJSONParsing: !0,
616
- clarifyTimeoutError: !1,
617
- legacyInterceptorReqResOrdering: !0
618
- }, Dr = typeof URLSearchParams < "u" ? URLSearchParams : ve, xr = typeof FormData < "u" ? FormData : null, Ur = typeof Blob < "u" ? Blob : null, Ir = {
619
- isBrowser: !0,
620
- classes: {
621
- URLSearchParams: Dr,
622
- FormData: xr,
623
- Blob: Ur
624
- },
625
- protocols: ["http", "https", "file", "blob", "url", "data"]
626
- }, Me = typeof window < "u" && typeof document < "u", xe = typeof navigator == "object" && navigator || void 0, Fr = Me && (!xe || ["ReactNative", "NativeScript", "NS"].indexOf(xe.product) < 0), jr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
627
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", $r = Me && window.location.href || "http://localhost", Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
628
- __proto__: null,
629
- hasBrowserEnv: Me,
630
- hasStandardBrowserEnv: Fr,
631
- hasStandardBrowserWebWorkerEnv: jr,
632
- navigator: xe,
633
- origin: $r
634
- }, Symbol.toStringTag, { value: "Module" })), w = {
635
- ...Br,
636
- ...Ir
637
- };
638
- function kr(e, t) {
639
- return Re(e, new w.classes.URLSearchParams(), {
640
- visitor: function(n, r, s, o) {
641
- return w.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
642
- },
643
- ...t
644
- });
645
- }
646
- function vr(e) {
647
- return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
648
- }
649
- function qr(e) {
650
- const t = {}, n = Object.keys(e);
651
- let r;
652
- const s = n.length;
653
- let o;
654
- for (r = 0; r < s; r++)
655
- o = n[r], t[o] = e[o];
656
- return t;
657
- }
658
- function vt(e) {
659
- function t(n, r, s, o) {
660
- let i = n[o++];
661
- if (i === "__proto__") return !0;
662
- const a = Number.isFinite(+i), f = o >= n.length;
663
- return i = !i && c.isArray(s) ? s.length : i, f ? (c.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && c.isArray(s[i]) && (s[i] = qr(s[i])), !a);
664
- }
665
- if (c.isFormData(e) && c.isFunction(e.entries)) {
666
- const n = {};
667
- return c.forEachEntry(e, (r, s) => {
668
- t(vr(r), s, n, 0);
669
- }), n;
670
- }
671
- return null;
672
- }
673
- function Mr(e, t, n) {
674
- if (c.isString(e))
675
- try {
676
- return (t || JSON.parse)(e), c.trim(e);
677
- } catch (r) {
678
- if (r.name !== "SyntaxError")
679
- throw r;
680
- }
681
- return (n || JSON.stringify)(e);
682
- }
683
- const re = {
684
- transitional: qe,
685
- adapter: ["xhr", "http", "fetch"],
686
- transformRequest: [function(t, n) {
687
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = c.isObject(t);
688
- if (o && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
689
- return s ? JSON.stringify(vt(t)) : t;
690
- if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t) || c.isReadableStream(t))
691
- return t;
692
- if (c.isArrayBufferView(t))
693
- return t.buffer;
694
- if (c.isURLSearchParams(t))
695
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
696
- let a;
697
- if (o) {
698
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
699
- return kr(t, this.formSerializer).toString();
700
- if ((a = c.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
701
- const f = this.env && this.env.FormData;
702
- return Re(
703
- a ? { "files[]": t } : t,
704
- f && new f(),
705
- this.formSerializer
706
- );
707
- }
708
- }
709
- return o || s ? (n.setContentType("application/json", !1), Mr(t)) : t;
710
- }],
711
- transformResponse: [function(t) {
712
- const n = this.transitional || re.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
713
- if (c.isResponse(t) || c.isReadableStream(t))
714
- return t;
715
- if (t && c.isString(t) && (r && !this.responseType || s)) {
716
- const i = !(n && n.silentJSONParsing) && s;
717
- try {
718
- return JSON.parse(t, this.parseReviver);
719
- } catch (a) {
720
- if (i)
721
- throw a.name === "SyntaxError" ? E.from(a, E.ERR_BAD_RESPONSE, this, null, this.response) : a;
722
- }
723
- }
724
- return t;
725
- }],
726
- /**
727
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
728
- * timeout is not created.
729
- */
730
- timeout: 0,
731
- xsrfCookieName: "XSRF-TOKEN",
732
- xsrfHeaderName: "X-XSRF-TOKEN",
733
- maxContentLength: -1,
734
- maxBodyLength: -1,
735
- env: {
736
- FormData: w.classes.FormData,
737
- Blob: w.classes.Blob
738
- },
739
- validateStatus: function(t) {
740
- return t >= 200 && t < 300;
741
- },
742
- headers: {
743
- common: {
744
- Accept: "application/json, text/plain, */*",
745
- "Content-Type": void 0
746
- }
747
- }
748
- };
749
- c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
750
- re.headers[e] = {};
751
- });
752
- const Hr = c.toObjectSet([
753
- "age",
754
- "authorization",
755
- "content-length",
756
- "content-type",
757
- "etag",
758
- "expires",
759
- "from",
760
- "host",
761
- "if-modified-since",
762
- "if-unmodified-since",
763
- "last-modified",
764
- "location",
765
- "max-forwards",
766
- "proxy-authorization",
767
- "referer",
768
- "retry-after",
769
- "user-agent"
770
- ]), zr = (e) => {
771
- const t = {};
772
- let n, r, s;
773
- return e && e.split(`
774
- `).forEach(function(i) {
775
- s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Hr[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
776
- }), t;
777
- }, st = Symbol("internals");
778
- function W(e) {
779
- return e && String(e).trim().toLowerCase();
780
- }
781
- function fe(e) {
782
- return e === !1 || e == null ? e : c.isArray(e) ? e.map(fe) : String(e);
783
- }
784
- function Jr(e) {
785
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
786
- let r;
787
- for (; r = n.exec(e); )
788
- t[r[1]] = r[2];
789
- return t;
790
- }
791
- const Vr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
792
- function we(e, t, n, r, s) {
793
- if (c.isFunction(r))
794
- return r.call(this, t, n);
795
- if (s && (t = n), !!c.isString(t)) {
796
- if (c.isString(r))
797
- return t.indexOf(r) !== -1;
798
- if (c.isRegExp(r))
799
- return r.test(t);
800
- }
801
- }
802
- function Kr(e) {
803
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
804
- }
805
- function Xr(e, t) {
806
- const n = c.toCamelCase(" " + t);
807
- ["get", "set", "has"].forEach((r) => {
808
- Object.defineProperty(e, r + n, {
809
- value: function(s, o, i) {
810
- return this[r].call(this, t, s, o, i);
811
- },
812
- configurable: !0
813
- });
814
- });
815
- }
816
- let C = class {
817
- constructor(t) {
818
- t && this.set(t);
819
- }
820
- set(t, n, r) {
821
- const s = this;
822
- function o(a, f, d) {
823
- const u = W(f);
824
- if (!u)
825
- throw new Error("header name must be a non-empty string");
826
- const h = c.findKey(s, u);
827
- (!h || s[h] === void 0 || d === !0 || d === void 0 && s[h] !== !1) && (s[h || f] = fe(a));
828
- }
829
- const i = (a, f) => c.forEach(a, (d, u) => o(d, u, f));
830
- if (c.isPlainObject(t) || t instanceof this.constructor)
831
- i(t, n);
832
- else if (c.isString(t) && (t = t.trim()) && !Vr(t))
833
- i(zr(t), n);
834
- else if (c.isObject(t) && c.isIterable(t)) {
835
- let a = {}, f, d;
836
- for (const u of t) {
837
- if (!c.isArray(u))
838
- throw TypeError("Object iterator must return a key-value pair");
839
- a[d = u[0]] = (f = a[d]) ? c.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
840
- }
841
- i(a, n);
842
- } else
843
- t != null && o(n, t, r);
844
- return this;
845
- }
846
- get(t, n) {
847
- if (t = W(t), t) {
848
- const r = c.findKey(this, t);
849
- if (r) {
850
- const s = this[r];
851
- if (!n)
852
- return s;
853
- if (n === !0)
854
- return Jr(s);
855
- if (c.isFunction(n))
856
- return n.call(this, s, r);
857
- if (c.isRegExp(n))
858
- return n.exec(s);
859
- throw new TypeError("parser must be boolean|regexp|function");
860
- }
861
- }
862
- }
863
- has(t, n) {
864
- if (t = W(t), t) {
865
- const r = c.findKey(this, t);
866
- return !!(r && this[r] !== void 0 && (!n || we(this, this[r], r, n)));
867
- }
868
- return !1;
869
- }
870
- delete(t, n) {
871
- const r = this;
872
- let s = !1;
873
- function o(i) {
874
- if (i = W(i), i) {
875
- const a = c.findKey(r, i);
876
- a && (!n || we(r, r[a], a, n)) && (delete r[a], s = !0);
877
- }
878
- }
879
- return c.isArray(t) ? t.forEach(o) : o(t), s;
880
- }
881
- clear(t) {
882
- const n = Object.keys(this);
883
- let r = n.length, s = !1;
884
- for (; r--; ) {
885
- const o = n[r];
886
- (!t || we(this, this[o], o, t, !0)) && (delete this[o], s = !0);
887
- }
888
- return s;
889
- }
890
- normalize(t) {
891
- const n = this, r = {};
892
- return c.forEach(this, (s, o) => {
893
- const i = c.findKey(r, o);
894
- if (i) {
895
- n[i] = fe(s), delete n[o];
896
- return;
897
- }
898
- const a = t ? Kr(o) : String(o).trim();
899
- a !== o && delete n[o], n[a] = fe(s), r[a] = !0;
900
- }), this;
901
- }
902
- concat(...t) {
903
- return this.constructor.concat(this, ...t);
904
- }
905
- toJSON(t) {
906
- const n = /* @__PURE__ */ Object.create(null);
907
- return c.forEach(this, (r, s) => {
908
- r != null && r !== !1 && (n[s] = t && c.isArray(r) ? r.join(", ") : r);
909
- }), n;
910
- }
911
- [Symbol.iterator]() {
912
- return Object.entries(this.toJSON())[Symbol.iterator]();
913
- }
914
- toString() {
915
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
916
- `);
917
- }
918
- getSetCookie() {
919
- return this.get("set-cookie") || [];
920
- }
921
- get [Symbol.toStringTag]() {
922
- return "AxiosHeaders";
923
- }
924
- static from(t) {
925
- return t instanceof this ? t : new this(t);
926
- }
927
- static concat(t, ...n) {
928
- const r = new this(t);
929
- return n.forEach((s) => r.set(s)), r;
930
- }
931
- static accessor(t) {
932
- const r = (this[st] = this[st] = {
933
- accessors: {}
934
- }).accessors, s = this.prototype;
935
- function o(i) {
936
- const a = W(i);
937
- r[a] || (Xr(s, i), r[a] = !0);
938
- }
939
- return c.isArray(t) ? t.forEach(o) : o(t), this;
940
- }
941
- };
942
- C.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
943
- c.reduceDescriptors(C.prototype, ({ value: e }, t) => {
944
- let n = t[0].toUpperCase() + t.slice(1);
945
- return {
946
- get: () => e,
947
- set(r) {
948
- this[n] = r;
949
- }
950
- };
951
- });
952
- c.freezeMethods(C);
953
- function Te(e, t) {
954
- const n = this || re, r = t || n, s = C.from(r.headers);
955
- let o = r.data;
956
- return c.forEach(e, function(a) {
957
- o = a.call(n, o, s.normalize(), t ? t.status : void 0);
958
- }), s.normalize(), o;
959
- }
960
- function qt(e) {
961
- return !!(e && e.__CANCEL__);
962
- }
963
- let se = class extends E {
964
- /**
965
- * A `CanceledError` is an object that is thrown when an operation is canceled.
966
- *
967
- * @param {string=} message The message.
968
- * @param {Object=} config The config.
969
- * @param {Object=} request The request.
970
- *
971
- * @returns {CanceledError} The created error.
972
- */
973
- constructor(t, n, r) {
974
- super(t ?? "canceled", E.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
975
- }
976
- };
977
- function Mt(e, t, n) {
978
- const r = n.config.validateStatus;
979
- !n.status || !r || r(n.status) ? e(n) : t(new E(
980
- "Request failed with status code " + n.status,
981
- [E.ERR_BAD_REQUEST, E.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
982
- n.config,
983
- n.request,
984
- n
985
- ));
986
- }
987
- function Wr(e) {
988
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
989
- return t && t[1] || "";
990
- }
991
- function Gr(e, t) {
992
- e = e || 10;
993
- const n = new Array(e), r = new Array(e);
994
- let s = 0, o = 0, i;
995
- return t = t !== void 0 ? t : 1e3, function(f) {
996
- const d = Date.now(), u = r[o];
997
- i || (i = d), n[s] = f, r[s] = d;
998
- let h = o, y = 0;
999
- for (; h !== s; )
1000
- y += n[h++], h = h % e;
1001
- if (s = (s + 1) % e, s === o && (o = (o + 1) % e), d - i < t)
1002
- return;
1003
- const _ = u && d - u;
1004
- return _ ? Math.round(y * 1e3 / _) : void 0;
1005
- };
1006
- }
1007
- function Yr(e, t) {
1008
- let n = 0, r = 1e3 / t, s, o;
1009
- const i = (d, u = Date.now()) => {
1010
- n = u, s = null, o && (clearTimeout(o), o = null), e(...d);
1011
- };
1012
- return [(...d) => {
1013
- const u = Date.now(), h = u - n;
1014
- h >= r ? i(d, u) : (s = d, o || (o = setTimeout(() => {
1015
- o = null, i(s);
1016
- }, r - h)));
1017
- }, () => s && i(s)];
1018
- }
1019
- const pe = (e, t, n = 3) => {
1020
- let r = 0;
1021
- const s = Gr(50, 250);
1022
- return Yr((o) => {
1023
- const i = o.loaded, a = o.lengthComputable ? o.total : void 0, f = i - r, d = s(f), u = i <= a;
1024
- r = i;
1025
- const h = {
1026
- loaded: i,
1027
- total: a,
1028
- progress: a ? i / a : void 0,
1029
- bytes: f,
1030
- rate: d || void 0,
1031
- estimated: d && a && u ? (a - i) / d : void 0,
1032
- event: o,
1033
- lengthComputable: a != null,
1034
- [t ? "download" : "upload"]: !0
1035
- };
1036
- e(h);
1037
- }, n);
1038
- }, ot = (e, t) => {
1039
- const n = e != null;
1040
- return [(r) => t[0]({
1041
- lengthComputable: n,
1042
- total: e,
1043
- loaded: r
1044
- }), t[1]];
1045
- }, it = (e) => (...t) => c.asap(() => e(...t)), Qr = w.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, w.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1046
- new URL(w.origin),
1047
- w.navigator && /(msie|trident)/i.test(w.navigator.userAgent)
1048
- ) : () => !0, Zr = w.hasStandardBrowserEnv ? (
1049
- // Standard browser envs support document.cookie
1050
- {
1051
- write(e, t, n, r, s, o, i) {
1052
- if (typeof document > "u") return;
1053
- const a = [`${e}=${encodeURIComponent(t)}`];
1054
- c.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`), c.isString(r) && a.push(`path=${r}`), c.isString(s) && a.push(`domain=${s}`), o === !0 && a.push("secure"), c.isString(i) && a.push(`SameSite=${i}`), document.cookie = a.join("; ");
1055
- },
1056
- read(e) {
1057
- if (typeof document > "u") return null;
1058
- const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
1059
- return t ? decodeURIComponent(t[1]) : null;
1060
- },
1061
- remove(e) {
1062
- this.write(e, "", Date.now() - 864e5, "/");
1063
- }
1064
- }
1065
- ) : (
1066
- // Non-standard browser env (web workers, react-native) lack needed support.
1067
- {
1068
- write() {
1069
- },
1070
- read() {
1071
- return null;
1072
- },
1073
- remove() {
1074
- }
1075
- }
1076
- );
1077
- function es(e) {
1078
- return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1079
- }
1080
- function ts(e, t) {
1081
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1082
- }
1083
- function Ht(e, t, n) {
1084
- let r = !es(t);
1085
- return e && (r || n == !1) ? ts(e, t) : t;
1086
- }
1087
- const at = (e) => e instanceof C ? { ...e } : e;
1088
- function H(e, t) {
1089
- t = t || {};
1090
- const n = {};
1091
- function r(d, u, h, y) {
1092
- return c.isPlainObject(d) && c.isPlainObject(u) ? c.merge.call({ caseless: y }, d, u) : c.isPlainObject(u) ? c.merge({}, u) : c.isArray(u) ? u.slice() : u;
1093
- }
1094
- function s(d, u, h, y) {
1095
- if (c.isUndefined(u)) {
1096
- if (!c.isUndefined(d))
1097
- return r(void 0, d, h, y);
1098
- } else return r(d, u, h, y);
1099
- }
1100
- function o(d, u) {
1101
- if (!c.isUndefined(u))
1102
- return r(void 0, u);
1103
- }
1104
- function i(d, u) {
1105
- if (c.isUndefined(u)) {
1106
- if (!c.isUndefined(d))
1107
- return r(void 0, d);
1108
- } else return r(void 0, u);
1109
- }
1110
- function a(d, u, h) {
1111
- if (h in t)
1112
- return r(d, u);
1113
- if (h in e)
1114
- return r(void 0, d);
1115
- }
1116
- const f = {
1117
- url: o,
1118
- method: o,
1119
- data: o,
1120
- baseURL: i,
1121
- transformRequest: i,
1122
- transformResponse: i,
1123
- paramsSerializer: i,
1124
- timeout: i,
1125
- timeoutMessage: i,
1126
- withCredentials: i,
1127
- withXSRFToken: i,
1128
- adapter: i,
1129
- responseType: i,
1130
- xsrfCookieName: i,
1131
- xsrfHeaderName: i,
1132
- onUploadProgress: i,
1133
- onDownloadProgress: i,
1134
- decompress: i,
1135
- maxContentLength: i,
1136
- maxBodyLength: i,
1137
- beforeRedirect: i,
1138
- transport: i,
1139
- httpAgent: i,
1140
- httpsAgent: i,
1141
- cancelToken: i,
1142
- socketPath: i,
1143
- responseEncoding: i,
1144
- validateStatus: a,
1145
- headers: (d, u, h) => s(at(d), at(u), h, !0)
1146
- };
1147
- return c.forEach(
1148
- Object.keys({ ...e, ...t }),
1149
- function(u) {
1150
- if (u === "__proto__" || u === "constructor" || u === "prototype")
1151
- return;
1152
- const h = c.hasOwnProp(f, u) ? f[u] : s, y = h(e[u], t[u], u);
1153
- c.isUndefined(y) && h !== a || (n[u] = y);
1154
- }
1155
- ), n;
1156
- }
1157
- const zt = (e) => {
1158
- const t = H({}, e);
1159
- let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t;
1160
- if (t.headers = i = C.from(i), t.url = kt(Ht(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1161
- "Authorization",
1162
- "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1163
- ), c.isFormData(n)) {
1164
- if (w.hasStandardBrowserEnv || w.hasStandardBrowserWebWorkerEnv)
1165
- i.setContentType(void 0);
1166
- else if (c.isFunction(n.getHeaders)) {
1167
- const f = n.getHeaders(), d = ["content-type", "content-length"];
1168
- Object.entries(f).forEach(([u, h]) => {
1169
- d.includes(u.toLowerCase()) && i.set(u, h);
1170
- });
1171
- }
1172
- }
1173
- if (w.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(t)), r || r !== !1 && Qr(t.url))) {
1174
- const f = s && o && Zr.read(o);
1175
- f && i.set(s, f);
1176
- }
1177
- return t;
1178
- }, ns = typeof XMLHttpRequest < "u", rs = ns && function(e) {
1179
- return new Promise(function(n, r) {
1180
- const s = zt(e);
1181
- let o = s.data;
1182
- const i = C.from(s.headers).normalize();
1183
- let { responseType: a, onUploadProgress: f, onDownloadProgress: d } = s, u, h, y, _, l;
1184
- function m() {
1185
- _ && _(), l && l(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
1186
- }
1187
- let p = new XMLHttpRequest();
1188
- p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
1189
- function R() {
1190
- if (!p)
1191
- return;
1192
- const b = C.from(
1193
- "getAllResponseHeaders" in p && p.getAllResponseHeaders()
1194
- ), x = {
1195
- data: !a || a === "text" || a === "json" ? p.responseText : p.response,
1196
- status: p.status,
1197
- statusText: p.statusText,
1198
- headers: b,
1199
- config: e,
1200
- request: p
1201
- };
1202
- Mt(function(L) {
1203
- n(L), m();
1204
- }, function(L) {
1205
- r(L), m();
1206
- }, x), p = null;
1207
- }
1208
- "onloadend" in p ? p.onloadend = R : p.onreadystatechange = function() {
1209
- !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(R);
1210
- }, p.onabort = function() {
1211
- p && (r(new E("Request aborted", E.ECONNABORTED, e, p)), p = null);
1212
- }, p.onerror = function(T) {
1213
- const x = T && T.message ? T.message : "Network Error", B = new E(x, E.ERR_NETWORK, e, p);
1214
- B.event = T || null, r(B), p = null;
1215
- }, p.ontimeout = function() {
1216
- let T = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1217
- const x = s.transitional || qe;
1218
- s.timeoutErrorMessage && (T = s.timeoutErrorMessage), r(new E(
1219
- T,
1220
- x.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
1221
- e,
1222
- p
1223
- )), p = null;
1224
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in p && c.forEach(i.toJSON(), function(T, x) {
1225
- p.setRequestHeader(x, T);
1226
- }), c.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), a && a !== "json" && (p.responseType = s.responseType), d && ([y, l] = pe(d, !0), p.addEventListener("progress", y)), f && p.upload && ([h, _] = pe(f), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", _)), (s.cancelToken || s.signal) && (u = (b) => {
1227
- p && (r(!b || b.type ? new se(null, e, p) : b), p.abort(), p = null);
1228
- }, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
1229
- const P = Wr(s.url);
1230
- if (P && w.protocols.indexOf(P) === -1) {
1231
- r(new E("Unsupported protocol " + P + ":", E.ERR_BAD_REQUEST, e));
1232
- return;
1233
- }
1234
- p.send(o || null);
1235
- });
1236
- }, ss = (e, t) => {
1237
- const { length: n } = e = e ? e.filter(Boolean) : [];
1238
- if (t || n) {
1239
- let r = new AbortController(), s;
1240
- const o = function(d) {
1241
- if (!s) {
1242
- s = !0, a();
1243
- const u = d instanceof Error ? d : this.reason;
1244
- r.abort(u instanceof E ? u : new se(u instanceof Error ? u.message : u));
1245
- }
1246
- };
1247
- let i = t && setTimeout(() => {
1248
- i = null, o(new E(`timeout of ${t}ms exceeded`, E.ETIMEDOUT));
1249
- }, t);
1250
- const a = () => {
1251
- e && (i && clearTimeout(i), i = null, e.forEach((d) => {
1252
- d.unsubscribe ? d.unsubscribe(o) : d.removeEventListener("abort", o);
1253
- }), e = null);
1254
- };
1255
- e.forEach((d) => d.addEventListener("abort", o));
1256
- const { signal: f } = r;
1257
- return f.unsubscribe = () => c.asap(a), f;
1258
- }
1259
- }, os = function* (e, t) {
1260
- let n = e.byteLength;
1261
- if (n < t) {
1262
- yield e;
1263
- return;
1264
- }
1265
- let r = 0, s;
1266
- for (; r < n; )
1267
- s = r + t, yield e.slice(r, s), r = s;
1268
- }, is = async function* (e, t) {
1269
- for await (const n of as(e))
1270
- yield* os(n, t);
1271
- }, as = async function* (e) {
1272
- if (e[Symbol.asyncIterator]) {
1273
- yield* e;
1274
- return;
1275
- }
1276
- const t = e.getReader();
1277
- try {
1278
- for (; ; ) {
1279
- const { done: n, value: r } = await t.read();
1280
- if (n)
1281
- break;
1282
- yield r;
1283
- }
1284
- } finally {
1285
- await t.cancel();
1286
- }
1287
- }, ct = (e, t, n, r) => {
1288
- const s = is(e, t);
1289
- let o = 0, i, a = (f) => {
1290
- i || (i = !0, r && r(f));
1291
- };
1292
- return new ReadableStream({
1293
- async pull(f) {
1294
- try {
1295
- const { done: d, value: u } = await s.next();
1296
- if (d) {
1297
- a(), f.close();
1298
- return;
1299
- }
1300
- let h = u.byteLength;
1301
- if (n) {
1302
- let y = o += h;
1303
- n(y);
1304
- }
1305
- f.enqueue(new Uint8Array(u));
1306
- } catch (d) {
1307
- throw a(d), d;
1308
- }
1309
- },
1310
- cancel(f) {
1311
- return a(f), s.return();
1312
- }
1313
- }, {
1314
- highWaterMark: 2
1315
- });
1316
- }, ut = 64 * 1024, { isFunction: ue } = c, cs = (({ Request: e, Response: t }) => ({
1317
- Request: e,
1318
- Response: t
1319
- }))(c.global), {
1320
- ReadableStream: lt,
1321
- TextEncoder: ft
1322
- } = c.global, dt = (e, ...t) => {
1323
- try {
1324
- return !!e(...t);
1325
- } catch {
1326
- return !1;
1327
- }
1328
- }, us = (e) => {
1329
- e = c.merge.call({
1330
- skipUndefined: !0
1331
- }, cs, e);
1332
- const { fetch: t, Request: n, Response: r } = e, s = t ? ue(t) : typeof fetch == "function", o = ue(n), i = ue(r);
1333
- if (!s)
1334
- return !1;
1335
- const a = s && ue(lt), f = s && (typeof ft == "function" ? /* @__PURE__ */ ((l) => (m) => l.encode(m))(new ft()) : async (l) => new Uint8Array(await new n(l).arrayBuffer())), d = o && a && dt(() => {
1336
- let l = !1;
1337
- const m = new n(w.origin, {
1338
- body: new lt(),
1339
- method: "POST",
1340
- get duplex() {
1341
- return l = !0, "half";
1342
- }
1343
- }).headers.has("Content-Type");
1344
- return l && !m;
1345
- }), u = i && a && dt(() => c.isReadableStream(new r("").body)), h = {
1346
- stream: u && ((l) => l.body)
1347
- };
1348
- s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((l) => {
1349
- !h[l] && (h[l] = (m, p) => {
1350
- let R = m && m[l];
1351
- if (R)
1352
- return R.call(m);
1353
- throw new E(`Response type '${l}' is not supported`, E.ERR_NOT_SUPPORT, p);
1354
- });
1355
- });
1356
- const y = async (l) => {
1357
- if (l == null)
1358
- return 0;
1359
- if (c.isBlob(l))
1360
- return l.size;
1361
- if (c.isSpecCompliantForm(l))
1362
- return (await new n(w.origin, {
1363
- method: "POST",
1364
- body: l
1365
- }).arrayBuffer()).byteLength;
1366
- if (c.isArrayBufferView(l) || c.isArrayBuffer(l))
1367
- return l.byteLength;
1368
- if (c.isURLSearchParams(l) && (l = l + ""), c.isString(l))
1369
- return (await f(l)).byteLength;
1370
- }, _ = async (l, m) => {
1371
- const p = c.toFiniteNumber(l.getContentLength());
1372
- return p ?? y(m);
1373
- };
1374
- return async (l) => {
1375
- let {
1376
- url: m,
1377
- method: p,
1378
- data: R,
1379
- signal: P,
1380
- cancelToken: b,
1381
- timeout: T,
1382
- onDownloadProgress: x,
1383
- onUploadProgress: B,
1384
- responseType: L,
1385
- headers: Oe,
1386
- withCredentials: ie = "same-origin",
1387
- fetchOptions: Ke
1388
- } = zt(l), Xe = t || fetch;
1389
- L = L ? (L + "").toLowerCase() : "text";
1390
- let ae = ss([P, b && b.toAbortSignal()], T), X = null;
1391
- const k = ae && ae.unsubscribe && (() => {
1392
- ae.unsubscribe();
1393
- });
1394
- let We;
1395
- try {
1396
- if (B && d && p !== "get" && p !== "head" && (We = await _(Oe, R)) !== 0) {
1397
- let $ = new n(m, {
1398
- method: "POST",
1399
- body: R,
1400
- duplex: "half"
1401
- }), J;
1402
- if (c.isFormData(R) && (J = $.headers.get("content-type")) && Oe.setContentType(J), $.body) {
1403
- const [Se, ce] = ot(
1404
- We,
1405
- pe(it(B))
1406
- );
1407
- R = ct($.body, ut, Se, ce);
1408
- }
1409
- }
1410
- c.isString(ie) || (ie = ie ? "include" : "omit");
1411
- const A = o && "credentials" in n.prototype, Ge = {
1412
- ...Ke,
1413
- signal: ae,
1414
- method: p.toUpperCase(),
1415
- headers: Oe.normalize().toJSON(),
1416
- body: R,
1417
- duplex: "half",
1418
- credentials: A ? ie : void 0
1419
- };
1420
- X = o && new n(m, Ge);
1421
- let j = await (o ? Xe(X, Ke) : Xe(m, Ge));
1422
- const Ye = u && (L === "stream" || L === "response");
1423
- if (u && (x || Ye && k)) {
1424
- const $ = {};
1425
- ["status", "statusText", "headers"].forEach((Qe) => {
1426
- $[Qe] = j[Qe];
1427
- });
1428
- const J = c.toFiniteNumber(j.headers.get("content-length")), [Se, ce] = x && ot(
1429
- J,
1430
- pe(it(x), !0)
1431
- ) || [];
1432
- j = new r(
1433
- ct(j.body, ut, Se, () => {
1434
- ce && ce(), k && k();
1435
- }),
1436
- $
1437
- );
1438
- }
1439
- L = L || "text";
1440
- let sn = await h[c.findKey(h, L) || "text"](j, l);
1441
- return !Ye && k && k(), await new Promise(($, J) => {
1442
- Mt($, J, {
1443
- data: sn,
1444
- headers: C.from(j.headers),
1445
- status: j.status,
1446
- statusText: j.statusText,
1447
- config: l,
1448
- request: X
1449
- });
1450
- });
1451
- } catch (A) {
1452
- throw k && k(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
1453
- new E("Network Error", E.ERR_NETWORK, l, X, A && A.response),
1454
- {
1455
- cause: A.cause || A
1456
- }
1457
- ) : E.from(A, A && A.code, l, X, A && A.response);
1458
- }
1459
- };
1460
- }, ls = /* @__PURE__ */ new Map(), Jt = (e) => {
1461
- let t = e && e.env || {};
1462
- const { fetch: n, Request: r, Response: s } = t, o = [
1463
- r,
1464
- s,
1465
- n
1466
- ];
1467
- let i = o.length, a = i, f, d, u = ls;
1468
- for (; a--; )
1469
- f = o[a], d = u.get(f), d === void 0 && u.set(f, d = a ? /* @__PURE__ */ new Map() : us(t)), u = d;
1470
- return d;
1471
- };
1472
- Jt();
1473
- const He = {
1474
- http: Nr,
1475
- xhr: rs,
1476
- fetch: {
1477
- get: Jt
1478
- }
1479
- };
1480
- c.forEach(He, (e, t) => {
1481
- if (e) {
1482
- try {
1483
- Object.defineProperty(e, "name", { value: t });
1484
- } catch {
1485
- }
1486
- Object.defineProperty(e, "adapterName", { value: t });
1487
- }
1488
- });
1489
- const pt = (e) => `- ${e}`, fs = (e) => c.isFunction(e) || e === null || e === !1;
1490
- function ds(e, t) {
1491
- e = c.isArray(e) ? e : [e];
1492
- const { length: n } = e;
1493
- let r, s;
1494
- const o = {};
1495
- for (let i = 0; i < n; i++) {
1496
- r = e[i];
1497
- let a;
1498
- if (s = r, !fs(r) && (s = He[(a = String(r)).toLowerCase()], s === void 0))
1499
- throw new E(`Unknown adapter '${a}'`);
1500
- if (s && (c.isFunction(s) || (s = s.get(t))))
1501
- break;
1502
- o[a || "#" + i] = s;
1503
- }
1504
- if (!s) {
1505
- const i = Object.entries(o).map(
1506
- ([f, d]) => `adapter ${f} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1507
- );
1508
- let a = n ? i.length > 1 ? `since :
1509
- ` + i.map(pt).join(`
1510
- `) : " " + pt(i[0]) : "as no adapter specified";
1511
- throw new E(
1512
- "There is no suitable adapter to dispatch the request " + a,
1513
- "ERR_NOT_SUPPORT"
1514
- );
1515
- }
1516
- return s;
1517
- }
1518
- const Vt = {
1519
- /**
1520
- * Resolve an adapter from a list of adapter names or functions.
1521
- * @type {Function}
1522
- */
1523
- getAdapter: ds,
1524
- /**
1525
- * Exposes all known adapters
1526
- * @type {Object<string, Function|Object>}
1527
- */
1528
- adapters: He
1529
- };
1530
- function Ae(e) {
1531
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1532
- throw new se(null, e);
1533
- }
1534
- function ht(e) {
1535
- return Ae(e), e.headers = C.from(e.headers), e.data = Te.call(
1536
- e,
1537
- e.transformRequest
1538
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Vt.getAdapter(e.adapter || re.adapter, e)(e).then(function(r) {
1539
- return Ae(e), r.data = Te.call(
1540
- e,
1541
- e.transformResponse,
1542
- r
1543
- ), r.headers = C.from(r.headers), r;
1544
- }, function(r) {
1545
- return qt(r) || (Ae(e), r && r.response && (r.response.data = Te.call(
1546
- e,
1547
- e.transformResponse,
1548
- r.response
1549
- ), r.response.headers = C.from(r.response.headers))), Promise.reject(r);
1550
- });
1551
- }
1552
- const Kt = "1.13.5", _e = {};
1553
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1554
- _e[e] = function(r) {
1555
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1556
- };
1557
- });
1558
- const mt = {};
1559
- _e.transitional = function(t, n, r) {
1560
- function s(o, i) {
1561
- return "[Axios v" + Kt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1562
- }
1563
- return (o, i, a) => {
1564
- if (t === !1)
1565
- throw new E(
1566
- s(i, " has been removed" + (n ? " in " + n : "")),
1567
- E.ERR_DEPRECATED
1568
- );
1569
- return n && !mt[i] && (mt[i] = !0, console.warn(
1570
- s(
1571
- i,
1572
- " has been deprecated since v" + n + " and will be removed in the near future"
1573
- )
1574
- )), t ? t(o, i, a) : !0;
1575
- };
1576
- };
1577
- _e.spelling = function(t) {
1578
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1579
- };
1580
- function ps(e, t, n) {
1581
- if (typeof e != "object")
1582
- throw new E("options must be an object", E.ERR_BAD_OPTION_VALUE);
1583
- const r = Object.keys(e);
1584
- let s = r.length;
1585
- for (; s-- > 0; ) {
1586
- const o = r[s], i = t[o];
1587
- if (i) {
1588
- const a = e[o], f = a === void 0 || i(a, o, e);
1589
- if (f !== !0)
1590
- throw new E("option " + o + " must be " + f, E.ERR_BAD_OPTION_VALUE);
1591
- continue;
1592
- }
1593
- if (n !== !0)
1594
- throw new E("Unknown option " + o, E.ERR_BAD_OPTION);
1595
- }
1596
- }
1597
- const de = {
1598
- assertOptions: ps,
1599
- validators: _e
1600
- }, D = de.validators;
1601
- let M = class {
1602
- constructor(t) {
1603
- this.defaults = t || {}, this.interceptors = {
1604
- request: new rt(),
1605
- response: new rt()
1606
- };
1607
- }
1608
- /**
1609
- * Dispatch a request
1610
- *
1611
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1612
- * @param {?Object} config
1613
- *
1614
- * @returns {Promise} The Promise to be fulfilled
1615
- */
1616
- async request(t, n) {
1617
- try {
1618
- return await this._request(t, n);
1619
- } catch (r) {
1620
- if (r instanceof Error) {
1621
- let s = {};
1622
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1623
- const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1624
- try {
1625
- r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1626
- ` + o) : r.stack = o;
1627
- } catch {
1628
- }
1629
- }
1630
- throw r;
1631
- }
1632
- }
1633
- _request(t, n) {
1634
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = H(this.defaults, n);
1635
- const { transitional: r, paramsSerializer: s, headers: o } = n;
1636
- r !== void 0 && de.assertOptions(r, {
1637
- silentJSONParsing: D.transitional(D.boolean),
1638
- forcedJSONParsing: D.transitional(D.boolean),
1639
- clarifyTimeoutError: D.transitional(D.boolean),
1640
- legacyInterceptorReqResOrdering: D.transitional(D.boolean)
1641
- }, !1), s != null && (c.isFunction(s) ? n.paramsSerializer = {
1642
- serialize: s
1643
- } : de.assertOptions(s, {
1644
- encode: D.function,
1645
- serialize: D.function
1646
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), de.assertOptions(n, {
1647
- baseUrl: D.spelling("baseURL"),
1648
- withXsrfToken: D.spelling("withXSRFToken")
1649
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1650
- let i = o && c.merge(
1651
- o.common,
1652
- o[n.method]
1653
- );
1654
- o && c.forEach(
1655
- ["delete", "get", "head", "post", "put", "patch", "common"],
1656
- (l) => {
1657
- delete o[l];
1658
- }
1659
- ), n.headers = C.concat(i, o);
1660
- const a = [];
1661
- let f = !0;
1662
- this.interceptors.request.forEach(function(m) {
1663
- if (typeof m.runWhen == "function" && m.runWhen(n) === !1)
1664
- return;
1665
- f = f && m.synchronous;
1666
- const p = n.transitional || qe;
1667
- p && p.legacyInterceptorReqResOrdering ? a.unshift(m.fulfilled, m.rejected) : a.push(m.fulfilled, m.rejected);
1668
- });
1669
- const d = [];
1670
- this.interceptors.response.forEach(function(m) {
1671
- d.push(m.fulfilled, m.rejected);
1672
- });
1673
- let u, h = 0, y;
1674
- if (!f) {
1675
- const l = [ht.bind(this), void 0];
1676
- for (l.unshift(...a), l.push(...d), y = l.length, u = Promise.resolve(n); h < y; )
1677
- u = u.then(l[h++], l[h++]);
1678
- return u;
1679
- }
1680
- y = a.length;
1681
- let _ = n;
1682
- for (; h < y; ) {
1683
- const l = a[h++], m = a[h++];
1684
- try {
1685
- _ = l(_);
1686
- } catch (p) {
1687
- m.call(this, p);
1688
- break;
1689
- }
1690
- }
1691
- try {
1692
- u = ht.call(this, _);
1693
- } catch (l) {
1694
- return Promise.reject(l);
1695
- }
1696
- for (h = 0, y = d.length; h < y; )
1697
- u = u.then(d[h++], d[h++]);
1698
- return u;
1699
- }
1700
- getUri(t) {
1701
- t = H(this.defaults, t);
1702
- const n = Ht(t.baseURL, t.url, t.allowAbsoluteUrls);
1703
- return kt(n, t.params, t.paramsSerializer);
1704
- }
1705
- };
1706
- c.forEach(["delete", "get", "head", "options"], function(t) {
1707
- M.prototype[t] = function(n, r) {
1708
- return this.request(H(r || {}, {
1709
- method: t,
1710
- url: n,
1711
- data: (r || {}).data
1712
- }));
1713
- };
1714
- });
1715
- c.forEach(["post", "put", "patch"], function(t) {
1716
- function n(r) {
1717
- return function(o, i, a) {
1718
- return this.request(H(a || {}, {
1719
- method: t,
1720
- headers: r ? {
1721
- "Content-Type": "multipart/form-data"
1722
- } : {},
1723
- url: o,
1724
- data: i
1725
- }));
1726
- };
1727
- }
1728
- M.prototype[t] = n(), M.prototype[t + "Form"] = n(!0);
1729
- });
1730
- let hs = class Xt {
1731
- constructor(t) {
1732
- if (typeof t != "function")
1733
- throw new TypeError("executor must be a function.");
1734
- let n;
1735
- this.promise = new Promise(function(o) {
1736
- n = o;
1737
- });
1738
- const r = this;
1739
- this.promise.then((s) => {
1740
- if (!r._listeners) return;
1741
- let o = r._listeners.length;
1742
- for (; o-- > 0; )
1743
- r._listeners[o](s);
1744
- r._listeners = null;
1745
- }), this.promise.then = (s) => {
1746
- let o;
1747
- const i = new Promise((a) => {
1748
- r.subscribe(a), o = a;
1749
- }).then(s);
1750
- return i.cancel = function() {
1751
- r.unsubscribe(o);
1752
- }, i;
1753
- }, t(function(o, i, a) {
1754
- r.reason || (r.reason = new se(o, i, a), n(r.reason));
1755
- });
1756
- }
1757
- /**
1758
- * Throws a `CanceledError` if cancellation has been requested.
1759
- */
1760
- throwIfRequested() {
1761
- if (this.reason)
1762
- throw this.reason;
1763
- }
1764
- /**
1765
- * Subscribe to the cancel signal
1766
- */
1767
- subscribe(t) {
1768
- if (this.reason) {
1769
- t(this.reason);
1770
- return;
1771
- }
1772
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1773
- }
1774
- /**
1775
- * Unsubscribe from the cancel signal
1776
- */
1777
- unsubscribe(t) {
1778
- if (!this._listeners)
1779
- return;
1780
- const n = this._listeners.indexOf(t);
1781
- n !== -1 && this._listeners.splice(n, 1);
1782
- }
1783
- toAbortSignal() {
1784
- const t = new AbortController(), n = (r) => {
1785
- t.abort(r);
1786
- };
1787
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1788
- }
1789
- /**
1790
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1791
- * cancels the `CancelToken`.
1792
- */
1793
- static source() {
1794
- let t;
1795
- return {
1796
- token: new Xt(function(s) {
1797
- t = s;
1798
- }),
1799
- cancel: t
1800
- };
1801
- }
1802
- };
1803
- function ms(e) {
1804
- return function(n) {
1805
- return e.apply(null, n);
1806
- };
1807
- }
1808
- function Es(e) {
1809
- return c.isObject(e) && e.isAxiosError === !0;
1810
- }
1811
- const Ue = {
1812
- Continue: 100,
1813
- SwitchingProtocols: 101,
1814
- Processing: 102,
1815
- EarlyHints: 103,
1816
- Ok: 200,
1817
- Created: 201,
1818
- Accepted: 202,
1819
- NonAuthoritativeInformation: 203,
1820
- NoContent: 204,
1821
- ResetContent: 205,
1822
- PartialContent: 206,
1823
- MultiStatus: 207,
1824
- AlreadyReported: 208,
1825
- ImUsed: 226,
1826
- MultipleChoices: 300,
1827
- MovedPermanently: 301,
1828
- Found: 302,
1829
- SeeOther: 303,
1830
- NotModified: 304,
1831
- UseProxy: 305,
1832
- Unused: 306,
1833
- TemporaryRedirect: 307,
1834
- PermanentRedirect: 308,
1835
- BadRequest: 400,
1836
- Unauthorized: 401,
1837
- PaymentRequired: 402,
1838
- Forbidden: 403,
1839
- NotFound: 404,
1840
- MethodNotAllowed: 405,
1841
- NotAcceptable: 406,
1842
- ProxyAuthenticationRequired: 407,
1843
- RequestTimeout: 408,
1844
- Conflict: 409,
1845
- Gone: 410,
1846
- LengthRequired: 411,
1847
- PreconditionFailed: 412,
1848
- PayloadTooLarge: 413,
1849
- UriTooLong: 414,
1850
- UnsupportedMediaType: 415,
1851
- RangeNotSatisfiable: 416,
1852
- ExpectationFailed: 417,
1853
- ImATeapot: 418,
1854
- MisdirectedRequest: 421,
1855
- UnprocessableEntity: 422,
1856
- Locked: 423,
1857
- FailedDependency: 424,
1858
- TooEarly: 425,
1859
- UpgradeRequired: 426,
1860
- PreconditionRequired: 428,
1861
- TooManyRequests: 429,
1862
- RequestHeaderFieldsTooLarge: 431,
1863
- UnavailableForLegalReasons: 451,
1864
- InternalServerError: 500,
1865
- NotImplemented: 501,
1866
- BadGateway: 502,
1867
- ServiceUnavailable: 503,
1868
- GatewayTimeout: 504,
1869
- HttpVersionNotSupported: 505,
1870
- VariantAlsoNegotiates: 506,
1871
- InsufficientStorage: 507,
1872
- LoopDetected: 508,
1873
- NotExtended: 510,
1874
- NetworkAuthenticationRequired: 511,
1875
- WebServerIsDown: 521,
1876
- ConnectionTimedOut: 522,
1877
- OriginIsUnreachable: 523,
1878
- TimeoutOccurred: 524,
1879
- SslHandshakeFailed: 525,
1880
- InvalidSslCertificate: 526
1881
- };
1882
- Object.entries(Ue).forEach(([e, t]) => {
1883
- Ue[t] = e;
1884
- });
1885
- function Wt(e) {
1886
- const t = new M(e), n = Ct(M.prototype.request, t);
1887
- return c.extend(n, M.prototype, t, { allOwnKeys: !0 }), c.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1888
- return Wt(H(e, s));
1889
- }, n;
1890
- }
1891
- const g = Wt(re);
1892
- g.Axios = M;
1893
- g.CanceledError = se;
1894
- g.CancelToken = hs;
1895
- g.isCancel = qt;
1896
- g.VERSION = Kt;
1897
- g.toFormData = Re;
1898
- g.AxiosError = E;
1899
- g.Cancel = g.CanceledError;
1900
- g.all = function(t) {
1901
- return Promise.all(t);
1902
- };
1903
- g.spread = ms;
1904
- g.isAxiosError = Es;
1905
- g.mergeConfig = H;
1906
- g.AxiosHeaders = C;
1907
- g.formToJSON = (e) => vt(c.isHTMLForm(e) ? new FormData(e) : e);
1908
- g.getAdapter = Vt.getAdapter;
1909
- g.HttpStatusCode = Ue;
1910
- g.default = g;
1911
- const {
1912
- Axios: zs,
1913
- AxiosError: ys,
1914
- CanceledError: Js,
1915
- isCancel: Vs,
1916
- CancelToken: Ks,
1917
- VERSION: Xs,
1918
- all: Ws,
1919
- Cancel: Gs,
1920
- isAxiosError: Ys,
1921
- spread: Qs,
1922
- toFormData: Zs,
1923
- AxiosHeaders: eo,
1924
- HttpStatusCode: to,
1925
- formToJSON: no,
1926
- getAdapter: ro,
1927
- mergeConfig: so
1928
- } = g;
1929
- var Ne, Et;
1930
- function gs() {
1931
- if (Et) return Ne;
1932
- Et = 1;
1933
- const e = /* @__PURE__ */ new Set([
1934
- "ENOTFOUND",
1935
- "ENETUNREACH",
1936
- // SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
1937
- "UNABLE_TO_GET_ISSUER_CERT",
1938
- "UNABLE_TO_GET_CRL",
1939
- "UNABLE_TO_DECRYPT_CERT_SIGNATURE",
1940
- "UNABLE_TO_DECRYPT_CRL_SIGNATURE",
1941
- "UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
1942
- "CERT_SIGNATURE_FAILURE",
1943
- "CRL_SIGNATURE_FAILURE",
1944
- "CERT_NOT_YET_VALID",
1945
- "CERT_HAS_EXPIRED",
1946
- "CRL_NOT_YET_VALID",
1947
- "CRL_HAS_EXPIRED",
1948
- "ERROR_IN_CERT_NOT_BEFORE_FIELD",
1949
- "ERROR_IN_CERT_NOT_AFTER_FIELD",
1950
- "ERROR_IN_CRL_LAST_UPDATE_FIELD",
1951
- "ERROR_IN_CRL_NEXT_UPDATE_FIELD",
1952
- "OUT_OF_MEM",
1953
- "DEPTH_ZERO_SELF_SIGNED_CERT",
1954
- "SELF_SIGNED_CERT_IN_CHAIN",
1955
- "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
1956
- "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
1957
- "CERT_CHAIN_TOO_LONG",
1958
- "CERT_REVOKED",
1959
- "INVALID_CA",
1960
- "PATH_LENGTH_EXCEEDED",
1961
- "INVALID_PURPOSE",
1962
- "CERT_UNTRUSTED",
1963
- "CERT_REJECTED",
1964
- "HOSTNAME_MISMATCH"
1965
- ]);
1966
- return Ne = (t) => !e.has(t && t.code), Ne;
1967
- }
1968
- var Rs = gs();
1969
- const _s = /* @__PURE__ */ cn(Rs);
1970
- function yt(e, t, n, r, s, o, i) {
1971
- try {
1972
- var a = e[o](i), f = a.value;
1973
- } catch (d) {
1974
- n(d);
1975
- return;
1976
- }
1977
- a.done ? t(f) : Promise.resolve(f).then(r, s);
1978
- }
1979
- function Gt(e) {
1980
- return function() {
1981
- var t = this, n = arguments;
1982
- return new Promise(function(r, s) {
1983
- var o = e.apply(t, n);
1984
- function i(f) {
1985
- yt(o, r, s, i, a, "next", f);
1986
- }
1987
- function a(f) {
1988
- yt(o, r, s, i, a, "throw", f);
1989
- }
1990
- i(void 0);
1991
- });
1992
- };
1993
- }
1994
- function gt(e, t) {
1995
- var n = Object.keys(e);
1996
- if (Object.getOwnPropertySymbols) {
1997
- var r = Object.getOwnPropertySymbols(e);
1998
- t && (r = r.filter(function(s) {
1999
- return Object.getOwnPropertyDescriptor(e, s).enumerable;
2000
- })), n.push.apply(n, r);
2001
- }
2002
- return n;
2003
- }
2004
- function Ce(e) {
2005
- for (var t = 1; t < arguments.length; t++) {
2006
- var n = arguments[t] != null ? arguments[t] : {};
2007
- t % 2 ? gt(Object(n), !0).forEach(function(r) {
2008
- bs(e, r, n[r]);
2009
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : gt(Object(n)).forEach(function(r) {
2010
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
2011
- });
2012
- }
2013
- return e;
2014
- }
2015
- function bs(e, t, n) {
2016
- return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
2017
- }
2018
- var Yt = "axios-retry";
2019
- function ze(e) {
2020
- var t = ["ERR_CANCELED", "ECONNABORTED"];
2021
- return !e.response && !!e.code && // Prevents retrying cancelled requests
2022
- !t.includes(e.code) && // Prevents retrying timed out & cancelled requests
2023
- _s(e);
2024
- }
2025
- var Qt = ["get", "head", "options"], Os = Qt.concat(["put", "delete"]);
2026
- function Je(e) {
2027
- return e.code !== "ECONNABORTED" && (!e.response || e.response.status >= 500 && e.response.status <= 599);
2028
- }
2029
- function Ss(e) {
2030
- return e.config ? Je(e) && Qt.indexOf(e.config.method) !== -1 : !1;
2031
- }
2032
- function Zt(e) {
2033
- return e.config ? Je(e) && Os.indexOf(e.config.method) !== -1 : !1;
2034
- }
2035
- function en(e) {
2036
- return ze(e) || Zt(e);
2037
- }
2038
- function ws() {
2039
- return 0;
2040
- }
2041
- function tn() {
2042
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 100, n = Math.pow(2, e) * t, r = n * 0.2 * Math.random();
2043
- return n + r;
2044
- }
2045
- var Ts = {
2046
- retries: 3,
2047
- retryCondition: en,
2048
- retryDelay: ws,
2049
- shouldResetTimeout: !1,
2050
- onRetry: () => {
2051
- }
2052
- };
2053
- function As(e, t) {
2054
- return Ce(Ce(Ce({}, Ts), t), e[Yt]);
2055
- }
2056
- function Rt(e, t) {
2057
- var n = As(e, t);
2058
- return n.retryCount = n.retryCount || 0, e[Yt] = n, n;
2059
- }
2060
- function Ns(e, t) {
2061
- e.defaults.agent === t.agent && delete t.agent, e.defaults.httpAgent === t.httpAgent && delete t.httpAgent, e.defaults.httpsAgent === t.httpsAgent && delete t.httpsAgent;
2062
- }
2063
- function Cs(e, t) {
2064
- return Ie.apply(this, arguments);
2065
- }
2066
- function Ie() {
2067
- return Ie = Gt(function* (e, t) {
2068
- var {
2069
- retries: n,
2070
- retryCondition: r
2071
- } = e, s = e.retryCount < n && r(t);
2072
- if (typeof s == "object")
2073
- try {
2074
- var o = yield s;
2075
- return o !== !1;
2076
- } catch {
2077
- return !1;
2078
- }
2079
- return s;
2080
- }), Ie.apply(this, arguments);
2081
- }
2082
- function z(e, t) {
2083
- var n = e.interceptors.request.use((s) => {
2084
- var o = Rt(s, t);
2085
- return o.lastRequestTime = Date.now(), s;
2086
- }), r = e.interceptors.response.use(null, /* @__PURE__ */ (function() {
2087
- var s = Gt(function* (o) {
2088
- var {
2089
- config: i
2090
- } = o;
2091
- if (!i)
2092
- return Promise.reject(o);
2093
- var a = Rt(i, t);
2094
- if (yield Cs(a, o)) {
2095
- a.retryCount += 1;
2096
- var {
2097
- retryDelay: f,
2098
- shouldResetTimeout: d,
2099
- onRetry: u
2100
- } = a, h = f(a.retryCount, o);
2101
- if (Ns(e, i), !d && i.timeout && a.lastRequestTime) {
2102
- var y = Date.now() - a.lastRequestTime, _ = i.timeout - y - h;
2103
- if (_ <= 0)
2104
- return Promise.reject(o);
2105
- i.timeout = _;
2106
- }
2107
- return i.transformRequest = [(l) => l], yield u(a.retryCount, o, i), new Promise((l) => setTimeout(() => l(e(i)), h));
2108
- }
2109
- return Promise.reject(o);
2110
- });
2111
- return function(o) {
2112
- return s.apply(this, arguments);
2113
- };
2114
- })());
2115
- return {
2116
- requestInterceptorId: n,
2117
- responseInterceptorId: r
2118
- };
2119
- }
2120
- z.isNetworkError = ze;
2121
- z.isSafeRequestError = Ss;
2122
- z.isIdempotentRequestError = Zt;
2123
- z.isNetworkOrIdempotentRequestError = en;
2124
- z.exponentialDelay = tn;
2125
- z.isRetryableError = Je;
2126
- class Ps {
2127
- constructor(t) {
2128
- t.interceptors.response.use(async (n) => {
2129
- const r = un();
2130
- if (n.status >= 200 && n.status < 300 && n.headers.etag && ln(n.headers.etag, n.data), n.status === 304) {
2131
- const s = n.config.headers["If-Match"];
2132
- s && (n.data = r[s]);
2133
- }
2134
- return n;
2135
- });
2136
- }
2137
- }
2138
- class Ls {
2139
- constructor() {
2140
- Ze(this, "client");
2141
- this.client = g.create({
2142
- validateStatus: (t) => t >= 200 && t < 300 || t === 304
2143
- }), new Ps(this.client), z(this.client, {
2144
- retries: 3,
2145
- retryCondition: (t) => {
2146
- var n, r, s;
2147
- return (
2148
- // Don't retry 502s, as we assume the server handles retries in those cases
2149
- ze(t) || ((n = t == null ? void 0 : t.response) == null ? void 0 : n.status) >= 500 && ((r = t == null ? void 0 : t.response) == null ? void 0 : r.status) !== 502 || ((s = t == null ? void 0 : t.response) == null ? void 0 : s.status) === 429
2150
- );
2151
- },
2152
- retryDelay: tn
2153
- });
2154
- }
2155
- async fetch(t, n = "get", r, s, o) {
2156
- var a;
2157
- const i = {
2158
- url: t,
2159
- params: s,
2160
- method: n,
2161
- withCredentials: !0,
2162
- data: JSON.stringify(r),
2163
- ...o ?? {}
2164
- };
2165
- try {
2166
- const f = await this.client(i);
2167
- return [f.data, f.status, f.headers];
2168
- } catch (f) {
2169
- if (f instanceof ys && ((a = f.response) != null && a.data))
2170
- return [f.response.data, f.response.status, f.response.headers];
2171
- throw f;
2172
- }
2173
- }
2174
- }
2175
- function Ds(e) {
2176
- var t = [];
2177
- if (e.length === 0)
2178
- return "";
2179
- if (typeof e[0] != "string")
2180
- throw new TypeError("Url must be a string. Received " + e[0]);
2181
- if (e[0].match(/^[^/:]+:\/*$/) && e.length > 1) {
2182
- var n = e.shift();
2183
- e[0] = n + e[0];
2184
- }
2185
- e[0].match(/^file:\/\/\//) ? e[0] = e[0].replace(/^([^/:]+):\/*/, "$1:///") : e[0] = e[0].replace(/^([^/:]+):\/*/, "$1://");
2186
- for (var r = 0; r < e.length; r++) {
2187
- var s = e[r];
2188
- if (typeof s != "string")
2189
- throw new TypeError("Url must be a string. Received " + s);
2190
- s !== "" && (r > 0 && (s = s.replace(/^[\/]+/, "")), r < e.length - 1 ? s = s.replace(/[\/]+$/, "") : s = s.replace(/[\/]+$/, "/"), t.push(s));
2191
- }
2192
- var o = t.join("/");
2193
- o = o.replace(/\/(\?|&|#[^!])/g, "$1");
2194
- var i = o.split("?");
2195
- return o = i.shift() + (i.length > 0 ? "?" : "") + i.join("&"), o;
2196
- }
2197
- function nn() {
2198
- var e;
2199
- return typeof arguments[0] == "object" ? e = arguments[0] : e = [].slice.call(arguments), Ds(e);
2200
- }
2201
- const he = (e) => `${Pe}.${e}`, Y = (e) => {
2202
- localStorage.removeItem(he(e));
2203
- }, Q = (e, t) => {
2204
- localStorage.setItem(he(e), JSON.stringify(t));
2205
- }, G = (e) => {
2206
- try {
2207
- return JSON.parse(localStorage.getItem(he(e)));
2208
- } catch {
2209
- return localStorage.getItem(he(e));
2210
- }
2211
- }, _t = (e) => e != null && e.app_token ? (Q(O.APP_TOKEN, e.app_token), e.refresh_token && (Q(O.REFRESH_TOKEN, e.refresh_token), Q(O.PROVIDER, e.provider)), !0) : (Y(O.REFRESH_TOKEN), Y(O.APP_TOKEN), Y(O.PROVIDER), !1), xs = () => {
2212
- if (document.cookie !== void 0)
2213
- try {
2214
- return document.cookie.split("; ").find((e) => e.startsWith("XSRF-TOKEN")).split("=")[1];
2215
- } catch {
2216
- }
2217
- return null;
2218
- }, Us = new Ls(), Is = {
2219
- auth: Rn,
2220
- configs: bn,
2221
- lookup: Un,
2222
- actions: mn,
2223
- fetchers: An,
2224
- sync: qn,
2225
- _static: Bn
2226
- }, F = () => "/api/v1", rn = (e, t) => {
2227
- const n = e.startsWith(F()) ? e : `${F()}/${e.replace(/\/$/, "")}`.replace("//", "/");
2228
- return t ? t + n : n;
2229
- }, Fs = (e, t) => `${e}${t ? `${e.indexOf("?") > 0 ? "&" : "?"}${t.toString()}` : ""}`, S = (e, t, n) => {
2230
- const r = rn(nn(e, t));
2231
- return n ? Fs(r, n) : r;
2232
- }, be = (...e) => nn(...e), Ve = async (e, t = "get", n, r, s) => {
2233
- const o = G(O.APP_TOKEN), i = {
2234
- ...s ?? {},
2235
- headers: {
2236
- ...(s == null ? void 0 : s.headers) ?? {},
2237
- "Content-Type": "application/json",
2238
- "X-XSRF-TOKEN": xs()
2239
- }
2240
- };
2241
- o && !i.headers.Authorization && (i.headers.Authorization = `Bearer ${o}`);
2242
- const [a, f] = await Us.fetch(
2243
- rn(e, i.baseURL),
2244
- t,
2245
- n,
2246
- r,
2247
- i
2248
- );
2249
- if (!a)
2250
- return null;
2251
- if (f < 300 || f === 304)
2252
- return a.api_response;
2253
- if (f === 401) {
2254
- if (G(O.NEXT_LOCATION) || (Q(O.NEXT_LOCATION, window.location.pathname), Q(O.NEXT_SEARCH, window.location.search)), !e.includes("/auth/login") && G(O.REFRESH_TOKEN)) {
2255
- const d = G(O.REFRESH_TOKEN), u = G(O.PROVIDER), h = await Is.auth.login.post({
2256
- refresh_token: d,
2257
- provider: u
2258
- });
2259
- if (h) {
2260
- _t(h);
2261
- const y = await Ve(e, t, n, r);
2262
- return Y(O.NEXT_LOCATION), Y(O.NEXT_SEARCH), y;
2263
- }
2264
- }
2265
- _t({});
2266
- return;
2267
- }
2268
- throw new Error(
2269
- a.api_error_message || a || `Error while fetching ${e} - ${t.toUpperCase()}`,
2270
- {
2271
- cause: a
2272
- }
2273
- );
2274
- }, I = (e, t, n = {}) => Ve(e, "get", null, t, n), oe = (e, t, n = {}) => Ve(e, "post", t, void 0, n);
2275
- export {
2276
- Is as a,
2277
- Dn as b,
2278
- Pn as g,
2279
- be as j,
2280
- Nn as p,
2281
- Be as u
2282
- };